Jump to content
  • Advertisement
Sign in to follow this  

VBO's and NV_PRIMITIVE_RESTART extension

This topic is 4727 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

i have been having problems with NV_PRIMITIVE_RESTART it doesnt seem to want to work with VBO's... anyone else tryed using this extension with VBO's this a driver bug just me or possiable something thats just not supported? and how do i use glMultiDrawElements with VBO's i cant seem to find anything on this anywhere =(.
glGenBuffersARB(1,&VBOxy);
glGenBuffersARB(1,&VBOi);
glBindBufferARB(GL_ARRAY_BUFFER_ARB,VBOxy);
glBufferDataARB( GL_ARRAY_BUFFER_ARB, (PATCHSIZE+1) * (PATCHSIZE+1)*sizeof(float)*2, xy, GL_STATIC_DRAW_ARB );
glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB,VBOi);
glBufferDataARB( GL_ELEMENT_ARRAY_BUFFER_ARB, i * sizeof(GLuint), Index, GL_STATIC_DRAW_ARB );

.....

glGenBuffersARB(1,&patch->VBO);
glBindBufferARB(GL_ARRAY_BUFFER_ARB,patch->VBO);
glBufferDataARB(GL_ARRAY_BUFFER_ARB, (PATCHSIZE+1) * (PATCHSIZE+1)*sizeof(GLfloat), h, GL_STATIC_DRAW_ARB );

......

glPushMatrix();
glTranslatef((GLfloat)px,0.0f,(GLfloat)py);
glEnableClientState(GL_VERTEX_ARRAY);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);

glBindBufferARB( GL_ARRAY_BUFFER_ARB,patch->VBO );
glTexCoordPointer(1, GL_FLOAT, 0, (char *)NULL);

glBindBufferARB( GL_ARRAY_BUFFER_ARB, VBOxy );
glVertexPointer(2, GL_FLOAT, 0,(char *)NULL);

glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB,VBOi);
glEnableClientState(GL_PRIMITIVE_RESTART_NV);
glPrimitiveRestartIndexNV(0xffffffff);
glDrawRangeElements(GL_TRIANGLE_STRIP,0,8384,8384,GL_UNSIGNED_INT, 0);


glDisableClientState(GL_VERTEX_ARRAY);
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
glDisableClientState(GL_PRIMITIVE_RESTART_NV);
glPopMatrix();

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!