summaryrefslogtreecommitdiffstats
path: root/examples/opengl/hellogl2/glwidget.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/opengl/hellogl2/glwidget.cpp')
-rw-r--r--examples/opengl/hellogl2/glwidget.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/examples/opengl/hellogl2/glwidget.cpp b/examples/opengl/hellogl2/glwidget.cpp
index 6d2ffb3b581..aad83cc2af5 100644
--- a/examples/opengl/hellogl2/glwidget.cpp
+++ b/examples/opengl/hellogl2/glwidget.cpp
@@ -7,6 +7,7 @@
#include <QCoreApplication>
#include <math.h>
+// Set from main
bool GLWidget::m_transparent = false;
GLWidget::GLWidget(QWidget *parent)
@@ -209,9 +210,11 @@ void GLWidget::setupVertexAttribs()
void GLWidget::paintGL()
{
+ glClearColor(0, 0, 0, m_transparent ? 0 : 1);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glEnable(GL_DEPTH_TEST);
glEnable(GL_CULL_FACE);
+ setupVertexAttribs();
m_world.setToIdentity();
m_world.rotate(180.0f - (m_xRot / 16.0f), 1, 0, 0);