VBO problem :(

Hello.

I’ve been messing with VBO’s

First I use VBO to render the static scene data.
Second I try using normal vertex arrays for the dynamic objects.

But they don’t show…
When I use glDeleteBuffersARB before using my normal vertex arrays, then they do render just fine…
Rendering using immediate mode works fine too.

Is there a way to make them show up without having to call glDeleteBuffers for every frame ? This is a huge performance drop of course
Isn’t there something like glUnBufferARB ???
Or how is it done ?

Thanks.
Kris.

Maybe this could be helpful:

void CKGLLevel::RenderLevelVBO(void)
{
if(!VBOactive) GenerateVBO();

EnableArrays();

//vertex buffer
glBindBufferARB(GL_ARRAY_BUFFER_ARB, vbuffer);
glVertexPointer(3, GL_FLOAT, 0, BUFFER_OFFSET(0));

//normal buffer
glBindBufferARB(GL_ARRAY_BUFFER_ARB, nbuffer);
glNormalPointer(GL_FLOAT, 0, BUFFER_OFFSET(0));

//texcoord buffer
glBindBufferARB(GL_ARRAY_BUFFER_ARB, tbuffer);
glTexCoordPointer(2, GL_FLOAT, 0, BUFFER_OFFSET(0));

//draw it damnit
for(int h=0; h<QT_Height; h++)
{
for(int w=0; w<QT_Width; w++)
{
meshCursor = QT[w][h].Start;
while(meshCursor->next)
{
meshCursor=meshCursor->next;

  		TexDB->BindTexture(meshCursor->TexID);
  		glDrawElements(GL_TRIANGLES, meshCursor->IAsize, GL_UNSIGNED_INT, meshCursor->IA);
  	}
  }

}

//draw dynamic objects
for(h=0; h<QT_Height; h++)
{
for(int w=0; w<QT_Width; w++)
{
dynObjIDCursor = QT[w][h].DynObjIDs;
while(dynObjIDCursor->next)
{
dynObjIDCursor = dynObjIDCursor->next;

  		RenderDynObj(dynObjIDCursor->ID);
  	}
  }

}

DisableArrays();
}

void CKGLLevel::RenderDynObj(int ID)
{
dynObjCursor = DynObjects;
while(dynObjCursor->next)
{
dynObjCursor = dynObjCursor->next;
if(dynObjCursor->ID == ID)
{
glPushMatrix();
glTranslatef(dynObjCursor->translation[0],dynObjCursor->translation[1],dynObjCursor->translation[2]);
//texture
TexDB->BindTexture(dynObjCursor->TexID);

  		//if(!glIsEnabled(GL_VERTEX_ARRAY)) {Message("Arrays not enabled");exit(0);}
  		//texcoord buffer
  		glTexCoordPointer(2, GL_FLOAT, 0, dynObjCursor->TexcData);
  		//normal buffer
  		glNormalPointer(GL_FLOAT, 0, dynObjCursor->NormData);
  		//vertex buffer
  		glVertexPointer(3, GL_FLOAT, 0, dynObjCursor->VertData);

  		//draw
  		glDrawArrays(GL_TRIANGLES, 0, dynObjCursor->amount);

/*
int nv=0;
int t=0;
glBegin(GL_TRIANGLES);
for(int i=0; iamount;i++)
{
glTexCoord2f(dynObjCursor->TexcData[t+0], dynObjCursor->TexcData[t+1]);
t+=2;
glNormal3f( dynObjCursor->NormData[nv+0], dynObjCursor->NormData[nv+1], dynObjCursor->NormData[nv+2] );
glVertex3f( dynObjCursor->VertData[nv+0], dynObjCursor->VertData[nv+1], dynObjCursor->VertData[nv+2] );
nv+=3;
}
glEnd();
*/
glPopMatrix();
}
}
}

glBindBufferARB(GL_ARRAY_BUFFER_ARB, 0);
before switching from VBO to VA.
Else you work with the last binded VBO.

Whoooooooooohoooooooooooooooo
Thank you thank you thank you thank you thank you thank you thank you thank you thank you thank you thank you …

Oops, didn’t mean to spam
I’ve been looking for a solution almost all day

Thank you very much.
It works now

Kris