mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-04-21 09:50:36 +02:00
added some code to test buffer deletion
This commit is contained in:
parent
f6a93d3dff
commit
b87c5d08c7
1 changed files with 27 additions and 0 deletions
|
|
@ -46,8 +46,21 @@ static void DrawObject( const struct object *obj )
|
|||
glBindBufferARB(GL_ARRAY_BUFFER_ARB, obj->BufferID);
|
||||
glVertexPointer(3, GL_FLOAT, 0, (void *) obj->VertexOffset);
|
||||
glEnable(GL_VERTEX_ARRAY);
|
||||
|
||||
/* test push/pop attrib */
|
||||
/* XXX this leads to a segfault with NVIDIA's 53.36 driver */
|
||||
#if 0
|
||||
if (1)
|
||||
{
|
||||
glPushClientAttrib(GL_CLIENT_VERTEX_ARRAY_BIT);
|
||||
/*glVertexPointer(3, GL_FLOAT, 0, (void *) (obj->VertexOffset + 10000));*/
|
||||
glBindBufferARB(GL_ARRAY_BUFFER_ARB, 999999);
|
||||
glPopClientAttrib();
|
||||
}
|
||||
#endif
|
||||
glColorPointer(3, GL_FLOAT, 0, (void *) obj->ColorOffset);
|
||||
glEnable(GL_COLOR_ARRAY);
|
||||
|
||||
if (obj->NumElements > 0) {
|
||||
/* indexed arrays */
|
||||
glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, obj->ElementsBufferID);
|
||||
|
|
@ -304,6 +317,20 @@ static void Init( void )
|
|||
}
|
||||
printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
|
||||
|
||||
/* Test buffer object deletion */
|
||||
if (1) {
|
||||
static GLubyte data[1000];
|
||||
GLuint id = 999;
|
||||
glBindBufferARB(GL_ARRAY_BUFFER_ARB, id);
|
||||
glBufferDataARB(GL_ARRAY_BUFFER_ARB, 1000, data, GL_STATIC_DRAW_ARB);
|
||||
glVertexPointer(3, GL_FLOAT, 0, (void *) 0);
|
||||
glDeleteBuffersARB(1, &id);
|
||||
/*assert(!glIsBufferARB(id));*/
|
||||
glBindBufferARB(GL_ARRAY_BUFFER_ARB, 0);
|
||||
glVertexPointer(3, GL_FLOAT, 0, (void *) 0);
|
||||
/*assert(!glIsBufferARB(id));*/
|
||||
}
|
||||
|
||||
MakeObject1(Objects + 0);
|
||||
MakeObject2(Objects + 1);
|
||||
MakeObject3(Objects + 2);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue