Sign in to follow this  
luminusone

VBO's and NV_PRIMITIVE_RESTART extension

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this