summaryrefslogtreecommitdiff
path: root/examples/activeqt/opengl/glbox.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/activeqt/opengl/glbox.cpp')
-rw-r--r--examples/activeqt/opengl/glbox.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/examples/activeqt/opengl/glbox.cpp b/examples/activeqt/opengl/glbox.cpp
index 3f2b5bb..04c854c 100644
--- a/examples/activeqt/opengl/glbox.cpp
+++ b/examples/activeqt/opengl/glbox.cpp
@@ -78,7 +78,9 @@ GLBox::GLBox( QWidget* parent, const char* name )
GLBox::~GLBox()
{
makeCurrent();
- glDeleteLists( object, 1 );
+
+ if (object)
+ glDeleteLists( object, 1 );
}
@@ -109,6 +111,8 @@ void GLBox::paintGL()
void GLBox::initializeGL()
{
+ initializeOpenGLFunctions();
+
qglClearColor(Qt::black); // Let OpenGL clear to black
object = makeObject(); // Generate an OpenGL display list
glShadeModel( GL_FLAT );