From b0042601ed8056c9ed6056c26f71dfa9fbc951ce Mon Sep 17 00:00:00 2001 From: Christian Ehrlicher Date: Fri, 13 Sep 2019 20:43:09 +0200 Subject: Cleanup QtOpenGL examples Cleanup the OpenGL examples - use nullptr (clang-tidy) - use member-initialization - avoid redundant checks for != nullptr when deleting a pointer Change-Id: I3e4702690ed79e71c3e952d51ceef83b907b45b7 Reviewed-by: Edward Welbourne Reviewed-by: Laszlo Agocs --- examples/opengl/hellogles3/glwindow.h | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'examples/opengl/hellogles3/glwindow.h') diff --git a/examples/opengl/hellogles3/glwindow.h b/examples/opengl/hellogles3/glwindow.h index fba997bee4..dfa0680714 100644 --- a/examples/opengl/hellogles3/glwindow.h +++ b/examples/opengl/hellogles3/glwindow.h @@ -90,23 +90,23 @@ public: private slots: void startSecondStage(); private: - QOpenGLTexture *m_texture; - QOpenGLShaderProgram *m_program; - QOpenGLBuffer *m_vbo; - QOpenGLVertexArrayObject *m_vao; + QOpenGLTexture *m_texture = nullptr; + QOpenGLShaderProgram *m_program = nullptr; + QOpenGLBuffer *m_vbo = nullptr; + QOpenGLVertexArrayObject *m_vao = nullptr; Logo m_logo; - int m_projMatrixLoc; - int m_camMatrixLoc; - int m_worldMatrixLoc; - int m_myMatrixLoc; - int m_lightPosLoc; + int m_projMatrixLoc = 0; + int m_camMatrixLoc = 0; + int m_worldMatrixLoc = 0; + int m_myMatrixLoc = 0; + int m_lightPosLoc = 0; QMatrix4x4 m_proj; QMatrix4x4 m_world; QVector3D m_eye; - QVector3D m_target; - bool m_uniformsDirty; - float m_r; - float m_r2; + QVector3D m_target = {0, 0, -1}; + bool m_uniformsDirty = true; + float m_r = 0; + float m_r2 = 0; }; #endif -- cgit v1.2.3