HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RE_OGLVertexArrayList.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: RE_OGLVertexArrayList.h ( RE Library, C++)
7  *
8  * COMMENTS:
9  * Implements an OpenGL Vertex Array Object, which is a collection of
10  * vertex buffer bindings to various attribute types (vertex, color,
11  * normal...)
12  *
13  * Note that this object is not shared with other shared contexts. It only
14  * exists in the OpenGL context that created it.
15  */
16 #ifndef RE_OGLVertexArrayList_h
17 #define RE_OGLVertexArrayList_h
18 
21 
23 {
24 public:
25  RE_OGLVertexArrayList() : myID(0), myCurrentElementBufferID(-1) {}
26  ~RE_OGLVertexArrayList() override;
27 
28  static void createContextDefault(RE_Render *r);
29  static void bindContextDefault(RE_Render *r);
30  static void deleteContextDefault(RE_Render *r);
31 
32  bool init(RE_Render *r) override;
33  bool bind(RE_Render *r);
34  static void unbind(RE_Render *r);
35 
36  bool setElementBuffer(int id)
37  {
38  if(myCurrentElementBufferID != id)
39  {
40  myCurrentElementBufferID = id;
41  return true;
42  }
43  return false;
44  }
45 
46  unsigned int getID() const { return myID; }
47 private:
48  unsigned int myID;
49  unsigned int myCurrentElementBufferID;
50 };
51 
54 
55 #endif
#define RE_API
Definition: RE_API.h:10
virtual bool init(RE_Render *r)=0
RE_ContextSpecificTable< RE_OGLVertexArrayList > RE_SharedVertexArray
GLuint id
Definition: glcorearb.h:655
unsigned int getID() const
GLboolean r
Definition: glcorearb.h:1222