PDA

View Full Version : VBO cannot be deleted?



SagoO
03-29-2011, 12:26 AM
Hi,


GLuint a,vboID;
GLubyte *pointer;

glGenBuffersARB(1, &vboID);
glBindBufferARB(GL_ARRAY_BUFFER_ARB, vboID);
glBufferDataARB(GL_ARRAY_BUFFER_ARB, sizeof(packet_payload), packet_payload, GL_DYNAMIC_DRAW_ARB);
glBindBufferARB(GL_ARRAY_BUFFER_ARB, 0);

glBindBufferARB(GL_ARRAY_BUFFER_ARB, vboID);
pointer = (GLubyte*)glMapBufferARB(GL_ARRAY_BUFFER_ARB,GL_RE AD_ONLY_ARB);

printf("Payload:");

int p=0;

for(a=0;a<noOfpacket*2048;a++)
{
printf("%c",pointer[a]);
p++;
if(p==2048)
{
printf("\n");
p =0;
}
}

glUnmapBufferARB(GL_ARRAY_BUFFER_ARB);
glDeleteBuffersARB(1, &amp;vboID);

Why i cannot delete the vbo even though I have use glDeleteBuffersARB here? I check already. When I change send a new data into the VBO again and read it out, the data still contains the previous data. Just the current data has replace some of the previous data.

SagoO
03-29-2011, 12:36 AM
Sry...problem solved..