Original Post
Hello!
I've got a little problem with an nasty VBO, it's not drawing anything at all. The problem definitely lies somewhere in my VBO code, cause if i swith to immediate mode it's all fine.
I'm using GLee for handling the extensions. But this puzzles me a little bit. I'm only including GLee.h in my header files, and GLee.c in my project. Is that enough?
Here's where i bind the poor VBO (vertexBuffer is defined as a GLuint)
And here's where i draw it
As you may see, all i'm trying to do is draw a simple cube.
I've got a little problem with an nasty VBO, it's not drawing anything at all. The problem definitely lies somewhere in my VBO code, cause if i swith to immediate mode it's all fine.
I'm using GLee for handling the extensions. But this puzzles me a little bit. I'm only including GLee.h in my header files, and GLee.c in my project. Is that enough?
Here's where i bind the poor VBO (vertexBuffer is defined as a GLuint)
/* Setup our vertex buffer */ GLfloat objectVertices[] = {0.0f, 0.0f, 32.0f, 0.0f, 32.0f, 32.0f, 0.0f, 32.0f}; /* Setup the particle vertex data */ glGenBuffers(1, &(this->vertexBuffer)); /* Fill the buffer */ glBindBuffer(GL_ARRAY_BUFFER, this->vertexBuffer); glBufferData(GL_ARRAY_BUFFER, sizeof(objectVertices), objectVertices, GL_STATIC_DRAW);And here's where i draw it
/* Bind the buffer */ glBindBuffer(GL_ARRAY_BUFFER, gameManager->graphManager->vertexBuffer); /* Vertex pointer */ glVertexPointer(2, GL_FLOAT, 0, 0); /* Push the matrix */ glPushMatrix(); /* Translate to our position */ glTranslatef(this->x, this->y, 0.0f); /* Enable the client states we need */ glEnableClientState(GL_VERTEX_ARRAY); //glEnableClientState(GL_TEXTURE_COORD_ARRAY); /* Draw the object */ glDrawArrays(GL_TRIANGLE_FAN, 0, 4); /* Disable our stats */ //glDisableClientState(GL_TEXTURE_COORD_ARRAY); glDisableClientState(GL_VERTEX_ARRAY); /* Pop it back */ glPopMatrix(); /* Unbind the buffer */ glBindBuffer(GL_ARRAY_BUFFER_ARB, 0);As you may see, all i'm trying to do is draw a simple cube.