-Generate a buffer with this function
GLuint generateBuffer(GLenum target, GLsizeiptr size, GLvoid* data, GLenum usage){
GLuint ret;
glGenBuffers(1, &ret);
glBindBuffer(target, ret);
glBufferData(target, size, data, usage);
return ret;
}
-Then I bind the buffer and call the drawing function
glBindBuffer(GL_ARRAY_BUFFER, mesh->bufferID);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, mesh->indicesID);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glTexCoordPointer(3, GL_FLOAT, sizeof(BufferVertex), BUFFER_OFFSET(24));
glEnableClientState(GL_NORMAL_ARRAY);
glNormalPointer(GL_FLOAT, sizeof(BufferVertex), BUFFER_OFFSET(12));
glEnableClientState(GL_VERTEX_ARRAY);
glVertexPointer(3, GL_FLOAT, sizeof(BufferVertex), BUFFER_OFFSET(0));
The BufferVertex is a structure with this format:
struct BufferVertex{
float x, y, z; //Vertex
float nx, ny, nz; //Normal
float s0, t0, z0; //Texcoord0
};
To implement my shader for the skeletal animation I want make another buffer with attribute variables, something like what is found in this site http://www.lighthous...bute-variables/ . My problem is that I'm not using VAOs, instead I'm making two VBOs, one for the geometry (BufferVertex structure) and another for the indices.
I there a way to implement another buffer to pass to the shader without using VAOs? If yes, can anyone explain me the changes I have to do?
Cumps