PDA

View Full Version : VBO mapping problem



grunt123
12-08-2003, 05:33 PM
i'm having a problem with using glMapBufferARB(...). I can render by using glBufferDataARB(...) however. The following is how i set up VBO calls in my rendering code (i call glGenBuffer/glBindBuffer in my init function)

glBufferDataARB(GL_ARRAY_BUFFER_ARB, 80000*3*sizeof(float), NULL, GL_STREAM_DRAW_ARB);
float *mapper = (float*)glMapBufferARB(GL_ARRAY_BUFFER_ARB, GL_WRITE_ONLY_ARB);
for (int i = 0; i < this->num_vertices * 3; i++) {
mapper[i] = this->m_pVertices[i];
}
glUnmapBufferARB(GL_ARRAY_BUFFER_ARB);

It seems that glMapBuffer(...) call causes an access violation error.

thanks

grunt123
12-08-2003, 06:00 PM
never mind, i forgot to initialize opengl extensions ... stupid ... lol