25 #ifndef GRAPHICS_VERTEXBUFFER_H 26 #define GRAPHICS_VERTEXBUFFER_H 51 VertexAttrib(GLuint i, GLint s, GLenum t, GLsizei st = 0,
const GLvoid *p = 0) :
104 GLvoid *
getData(
size_t vertexDecl);
107 const GLvoid *
getData(
size_t vertexDecl)
const;
119 void initGL(GLuint hint = GL_STATIC_DRAW);
151 #endif // GRAPHICS_VERTEXBUFFER_H
Vertex texture coordinates, VTCOORDi = VTCOORD + i.
uint32 getCount() const
Get vertex count.
uint32 _size
Size of a buffer element in bytes (vertex attributes size sum).
GLuint index
Index of the vertex attribute (see VertexAttribIdEnum).
GLuint _vbo
Vertex Buffer Object.
GLenum type
Data type of each attribute component in the array.
void updateGLBound() const
Update an existing GL buffer object, assuming it is already bound.
void setVertexDeclInterleave(uint32 vertCount, VertexDecl &decl)
Set the interleaved vertex declaration for this buffer.
void setVertexDecl(const VertexDecl &decl)
Set vertex declaration for this buffer.
const GLvoid * pointer
Offset of the first component of the first generic vertex attribute.
std::vector< VertexAttrib > VertexDecl
Vertex data layout.
const VertexDecl & getVertexDecl() const
Access vertex declaration.
static uint32 getTypeSize(GLenum type)
void destroyGL()
Clear (destroy) GL resources associated with the buffer.
VertexAttribIdEnum
Vertex attribute data index enum, hardcoded for now.
void setVertexDeclLinear(uint32 vertCount, VertexDecl &decl)
Set the linear vertex declaration for this buffer.
uint32 getSize() const
Get vertex element size in bytes.
Buffer containing vertex data.
VertexAttrib(GLuint i, GLint s, GLenum t, GLsizei st=0, const GLvoid *p=0)
GLuint _hint
GL hint for static or dynamic data.
VertexDecl _decl
Vertex declaration.
GLint size
Number of components per vertex attribute, must be 1, 2, 3, 4.
VertexBuffer & operator=(const VertexBuffer &other)
GLvoid * getData()
Access buffer data.
uint32 _count
Number of elements in buffer.
void draw(GLenum mode, const IndexBuffer &indexBuffer) const
Draw this IndexBuffer/VertexBuffer combination.
Buffer containing indices data.
void initGL(GLuint hint=GL_STATIC_DRAW)
Initialise internal buffer object for GL handling.
GLsizei stride
Byte offset between consecutive vertex attributes.
void updateGL()
Update existing GL buffer object.
Generic vertex attribute data.
void setSize(uint32 vertCount, uint32 vertSize)
Change buffer size.