OpenGL renderer : conflict with glBindBuffer() & glBufferDat
Posted: Fri Apr 01, 2005 23:02
Hello!
I have some (maybe serious, maybe not) problem. My program uses vertex and index buffers to draw a terrain. When I add the following lines to a program using CEGUI with OpenGL Renderer, the program flies away with a nice Access Violation exception.
The error occurs at the first execution of the OpenGLRenderer::renderVBuffer(), in the line
I don't know what to do, because I don't understand the problem. What does the element array buffer do with the drawing of a totally different triangle array?
I'm using a GeForce 4 Ti4200, with the 61.77 ForceWare nVidia driver.
Thanks for the help!
shat
I have some (maybe serious, maybe not) problem. My program uses vertex and index buffers to draw a terrain. When I add the following lines to a program using CEGUI with OpenGL Renderer, the program flies away with a nice Access Violation exception.
Code: Select all
int vertex_buffer_size = 128*128; // Size is irrelevant
int index_buffer_size = 128*128;
glGenBuffers(2, vertex_buffer);
glGenBuffers(2, index_buffer);
glBindBuffer(GL_ARRAY_BUFFER_ARB, vertex_buffer[0]);
glBufferData(GL_ARRAY_BUFFER_ARB, vertex_buffer_size, 0, GL_STREAM_DRAW_ARB);
glBindBuffer(GL_ARRAY_BUFFER_ARB, vertex_buffer[1]);
glBufferData(GL_ARRAY_BUFFER_ARB, vertex_buffer_size, 0, GL_STREAM_DRAW_ARB);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER_ARB, index_buffer[0]);
glBufferData(GL_ELEMENT_ARRAY_BUFFER_ARB, index_buffer_size, 0, GL_STREAM_DRAW_ARB);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER_ARB, index_buffer[1]);
glBufferData(GL_ELEMENT_ARRAY_BUFFER_ARB, index_buffer_size, 0, GL_STREAM_DRAW_ARB);
The error occurs at the first execution of the OpenGLRenderer::renderVBuffer(), in the line
Code: Select all
glDrawArrays(GL_TRIANGLES, 0, d_bufferPos);
I don't know what to do, because I don't understand the problem. What does the element array buffer do with the drawing of a totally different triangle array?
I'm using a GeForce 4 Ti4200, with the 61.77 ForceWare nVidia driver.
Thanks for the help!
shat