moGL
travis-test-3
Modern OpenGL wrapper, thin C++14 header-only layer on top of the OpenGL 4.5+ core spec
|
00001 00002 00003 00004 00005 00006 00007 00008 00009 00010 00011 00012 00013 #ifndef MOGL_VERTEXARRAY_INCLUDED 00014 #define MOGL_VERTEXARRAY_INCLUDED 00015 00016 #include <mogl/object/handle.hpp> 00017 00018 namespace mogl 00019 { 00020 class VertexArray : public Handle<GLuint> 00021 { 00022 public: 00023 VertexArray(); 00024 ~VertexArray(); 00025 00026 VertexArray(const VertexArray& other) = delete; 00027 VertexArray& operator=(const VertexArray& other) = delete; 00028 00029 VertexArray(VertexArray&& other) = default; 00030 00031 public: 00032 void bind(); 00033 void enableAttrib(GLuint index); 00034 void disableAttrib(GLuint index); 00035 void setVertexBuffer(GLuint bindingindex, GLuint buffer, GLintptr offset = GLintptr(0), GLsizei stride = 0); 00036 void setVertexBuffers(GLuint first, GLsizei count, const GLuint* buffers, const GLintptr* offsets, const GLsizei* strides); 00037 void setElementBuffer(GLuint buffer); 00038 void setAttribFormat(GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset); 00039 void setAttribIFormat(GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); 00040 void setAttribLFormat(GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); 00041 void setAttribBinding(GLuint attribindex, GLuint bindingindex); 00042 void setBindingDivisor(GLuint bindingindex, GLuint divisor); 00043 template <class T> void get(GLenum property, T* value); // Direct call to glGetVertexArray*v() 00044 template <class T> T get(GLenum property); 00045 template <class T> void get(GLuint index, GLenum property, T* value); // Direct call to glGetVertexArrayIndexed*v() 00046 template <class T> T get(GLuint index, GLenum property); 00047 bool isHandleValid() const override final; 00048 }; 00049 00050 using VAO = VertexArray; 00051 } 00052 00053 #include "vertexarray.inl" 00054 00055 #endif // MOGL_VERTEXARRAY_INCLUDED