diff options
author | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2019-09-13 20:43:09 +0200 |
---|---|---|
committer | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2019-09-30 22:16:27 +0200 |
commit | b0042601ed8056c9ed6056c26f71dfa9fbc951ce (patch) | |
tree | 9288bbda958a9e0755d3179de0fe5325d9bd7898 /examples/opengl/hellogles3/glwindow.h | |
parent | fbda189e081e6c7abf82334c0ac71b16ec2c37dd (diff) |
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 <edward.welbourne@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'examples/opengl/hellogles3/glwindow.h')
-rw-r--r-- | examples/opengl/hellogles3/glwindow.h | 26 |
1 files changed, 13 insertions, 13 deletions
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 |