SimpleGL  1.1.0
A framework for platform independent rendering
vertex_array_object.hpp
Go to the documentation of this file.
1 
8 #ifndef VERTEX_ARRAY_OBJECT_HPP
9 #define VERTEX_ARRAY_OBJECT_HPP
10 
11 #include <SimpleGL_gl/SimpleGL_gl_Export.h>
12 
13 #include <GL/glew.h>
14 
15 namespace sgl {
16 
22  enum class ValueType : GLenum {
23 
25  BYTE = GL_BYTE,
26 
28  UNSIGNED_BYTE = GL_UNSIGNED_BYTE,
29 
31  SHORT = GL_SHORT,
32 
34  UNSIGNED_SHORT = GL_UNSIGNED_SHORT,
35 
37  INT = GL_INT,
38 
40  UNSIGNED_INT = GL_UNSIGNED_INT,
41 
43  FLOAT = GL_FLOAT,
44 
46  DOUBLE = GL_DOUBLE
47  };
48 
54  class SIMPLEGL_GL_EXPORT VertexArray {
55 
56  private:
58  static VertexArray* current;
59 
61  GLuint handle;
62 
63  public:
65  VertexArray(void);
66 
68  ~VertexArray(void);
69 
75  GLuint getHandle();
76 
78  void bind();
79 
85  void enableAttribute(unsigned int index);
86 
92  void disableAttribute(unsigned int index);
93 
104  void pointAttribute(unsigned int index, int size, ValueType type, bool normalized, int stride, long offset);
105  };
106 }
107 
108 #endif /* VERTEX_ARRAY_OBJECT_HPP */
This class wraps an OpenGL vertex array object.
Generic namespace for the SimpleGL framework.
Definition: application.hpp:18
Equivalent to GL_BYTE.
Equivalent to GL_UNSIGNED_SHORT.
ValueType
This enum wraps the vertex array object&#39;s value types.
Equivalent to GL_DOUBLE.
Equivalent to GL_SHORT.
Equivalent to GL_FLOAT.
Equivalent to GL_UNSIGNED_BYTE.
Equivalent to GL_INT.
Equivalent to GL_UNSIGNED_INT.