Thread: a class for representing usage

  1. #1

    a class for representing usage

    class g_cPolygon: public g_cDrawable, public g_cUser<g_cVertexArray>
    g_cArray<g_cIndex> m_iIndexes;
    virtual ~g_cPolygon();

    virtual void m_vfDraw();

    Today I was going to make a polygon class that supported vertex arrays wanted to place a static vertex array in the polygon class. Although, I also wanted to make the program as extencible as I could and therefor wanted all classes that used vertex arrays to be able to share the same one and having the vertex array in the class at the same time. First of all I though about using the "static" keyword, although after a few seconds of consideration I discovered that it wouldn't work. Then I thought that I could make sort of a user class from which the polygon class could inherit, in which I would have something static.
    I just wonder if any of you have had any experence with this, if there are better solutions and offcourse: why aren't there a feature like this within the language?

  2. #2
    I belive my last post above is a bit fuzzy and I therefore feel a need to explain my problem more clearly: I want to make a user class so that I can inherit a static thing into my class like this:

    template <class t_cUsed>
    class g_cUser
    t_cUsed m_uUsed;
    //.... some functions.

    class Polygon: public g_cUser<g_cVertexArray>
    // Some functions

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Screwy Linker Error - VC2005
    By Tonto in forum C++ Programming
    Replies: 5
    Last Post: 06-19-2007, 02:39 PM
  2. Creating a database
    By Shamino in forum Game Programming
    Replies: 19
    Last Post: 06-10-2007, 01:09 PM
  3. Mmk, I give up, lets try your way. (Resource Management)
    By Shamino in forum Game Programming
    Replies: 31
    Last Post: 01-18-2006, 08:54 AM
  4. class errors
    By romeoz in forum C++ Programming
    Replies: 3
    Last Post: 09-16-2003, 07:57 PM
  5. Abstract class problem
    By VanJay011379 in forum C++ Programming
    Replies: 9
    Last Post: 07-31-2002, 01:30 PM
Website Security Test