Allolib  1.0
C++ Components For Interactive Multimedia
al_VAO.hpp
1 #ifndef INCLUDE_AL_VAO_HPP
2 #define INCLUDE_AL_VAO_HPP
3 
4 /* Keehong Youn, 2017, younkeehong@gmail.com
5  */
6 
7 #include "al/graphics/al_BufferObject.hpp"
8 #include "al/graphics/al_OpenGL.hpp"
9 
10 #include <cstddef>
11 
12 namespace al {
18 class VAO : public GPUObject {
19  public:
20  enum DataType : unsigned int /* GLenum */ {
21  BYTE = GL_BYTE,
22  UBYTE = GL_UNSIGNED_BYTE,
23  SHORT = GL_SHORT,
24  USHORT = GL_UNSIGNED_SHORT,
25  INT = GL_INT,
26  UINT = GL_UNSIGNED_INT,
27  FLOAT = GL_FLOAT,
28  DOUBLE = GL_DOUBLE
29  };
30 
31  VAO();
32  virtual ~VAO();
33 
34  virtual void onCreate() override;
35  virtual void onDestroy() override;
36 
37  void bind();
38  void unbind();
39 
40  void enableAttrib(unsigned int index);
41  void disableAttrib(unsigned int index);
42  void attribPointer(unsigned int index, BufferObject& buffer,
43  int size, // components
44  unsigned int type = GL_FLOAT,
45  unsigned char normalized = GL_FALSE, int stride = 0,
46  void const* offset = NULL // offset of the first component
47  );
48 };
49 
50 } // namespace al
51 
52 #endif
VAO class.
Definition: al_VAO.hpp:18
virtual void onDestroy() override
Called when currently assigned context is destroyed.
virtual void onCreate() override
Called when currently assigned context is created.
Definition: al_App.hpp:23