Only generate VBO, if the glGenBuffers has been resolved

BUG: 246194

svn path=/trunk/KDE/kdebase/workspace/; revision=1157460
This commit is contained in:
Martin Gräßlin 2010-07-31 05:48:27 +00:00
parent f5d46476aa
commit a9e31c66bf

View file

@ -1082,13 +1082,19 @@ class GLVertexBufferPrivate
: hint( usageHint ) : hint( usageHint )
, numberVertices( 0 ) , numberVertices( 0 )
, dimension( 2 ) , dimension( 2 )
{
if( GLVertexBufferPrivate::supported )
{ {
glGenBuffers( 2, buffers ); glGenBuffers( 2, buffers );
} }
}
~GLVertexBufferPrivate() ~GLVertexBufferPrivate()
{
if( GLVertexBufferPrivate::supported )
{ {
glDeleteBuffers( 2, buffers ); glDeleteBuffers( 2, buffers );
} }
}
GLVertexBuffer::UsageHint hint; GLVertexBuffer::UsageHint hint;
GLuint buffers[2]; GLuint buffers[2];
int numberVertices; int numberVertices;