diff options
Diffstat (limited to 'examples/opengl/hellogl2/glwidget.cpp')
-rw-r--r-- | examples/opengl/hellogl2/glwidget.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/examples/opengl/hellogl2/glwidget.cpp b/examples/opengl/hellogl2/glwidget.cpp index 318adb5043..543e70f8ac 100644 --- a/examples/opengl/hellogl2/glwidget.cpp +++ b/examples/opengl/hellogl2/glwidget.cpp @@ -57,11 +57,7 @@ bool GLWidget::m_transparent = false; GLWidget::GLWidget(QWidget *parent) - : QOpenGLWidget(parent), - m_xRot(0), - m_yRot(0), - m_zRot(0), - m_program(0) + : QOpenGLWidget(parent) { m_core = QSurfaceFormat::defaultFormat().profile() == QSurfaceFormat::CoreProfile; // --transparent causes the clear color to be transparent. Therefore, on systems that @@ -133,7 +129,7 @@ void GLWidget::cleanup() makeCurrent(); m_logoVbo.destroy(); delete m_program; - m_program = 0; + m_program = nullptr; doneCurrent(); } @@ -250,8 +246,10 @@ void GLWidget::setupVertexAttribs() QOpenGLFunctions *f = QOpenGLContext::currentContext()->functions(); f->glEnableVertexAttribArray(0); f->glEnableVertexAttribArray(1); - f->glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 6 * sizeof(GLfloat), 0); - f->glVertexAttribPointer(1, 3, GL_FLOAT, GL_FALSE, 6 * sizeof(GLfloat), reinterpret_cast<void *>(3 * sizeof(GLfloat))); + f->glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 6 * sizeof(GLfloat), + nullptr); + f->glVertexAttribPointer(1, 3, GL_FLOAT, GL_FALSE, 6 * sizeof(GLfloat), + reinterpret_cast<void *>(3 * sizeof(GLfloat))); m_logoVbo.release(); } |