@@ -39,7 +39,7 @@ static const char* FragmentShaderGlsl = R"_(
3939 )_" ;
4040
4141struct OpenGLGraphicsPlugin : public IGraphicsPlugin {
42- OpenGLGraphicsPlugin (const std::shared_ptr<Options>&, std::shared_ptr<IPlatformPlugin>){};
42+ OpenGLGraphicsPlugin (const std::shared_ptr<Options>& /* unused */ , const std::shared_ptr<IPlatformPlugin> /* unused */ & ){};
4343
4444 OpenGLGraphicsPlugin (const OpenGLGraphicsPlugin&) = delete ;
4545 OpenGLGraphicsPlugin& operator =(const OpenGLGraphicsPlugin&) = delete ;
@@ -101,7 +101,8 @@ struct OpenGLGraphicsPlugin : public IGraphicsPlugin {
101101 THROW (" Unable to create GL context" );
102102 }
103103
104- GLint major = 0 , minor = 0 ;
104+ GLint major = 0 ;
105+ GLint minor = 0 ;
105106 glGetIntegerv (GL_MAJOR_VERSION, &major);
106107 glGetIntegerv (GL_MINOR_VERSION, &minor);
107108
@@ -179,7 +180,7 @@ struct OpenGLGraphicsPlugin : public IGraphicsPlugin {
179180 glEnableVertexAttribArray (m_vertexAttribColor);
180181 glBindBuffer (GL_ARRAY_BUFFER, m_cubeVertexBuffer);
181182 glBindBuffer (GL_ELEMENT_ARRAY_BUFFER, m_cubeIndexBuffer);
182- glVertexAttribPointer (m_vertexAttribCoords, 3 , GL_FLOAT, GL_FALSE, sizeof (Geometry::Vertex), 0 );
183+ glVertexAttribPointer (m_vertexAttribCoords, 3 , GL_FLOAT, GL_FALSE, sizeof (Geometry::Vertex), nullptr );
183184 glVertexAttribPointer (m_vertexAttribColor, 3 , GL_FLOAT, GL_FALSE, sizeof (Geometry::Vertex),
184185 reinterpret_cast <const void *>(sizeof (XrVector3f)));
185186 }
@@ -253,7 +254,8 @@ struct OpenGLGraphicsPlugin : public IGraphicsPlugin {
253254
254255 // This back-buffer has no cooresponding depth-stencil texture, so create one with matching dimensions.
255256
256- GLint width, height;
257+ GLint width;
258+ GLint height;
257259 glBindTexture (GL_TEXTURE_2D, colorTexture);
258260 glGetTexLevelParameteriv (GL_TEXTURE_2D, 0 , GL_TEXTURE_WIDTH, &width);
259261 glGetTexLevelParameteriv (GL_TEXTURE_2D, 0 , GL_TEXTURE_HEIGHT, &height);
@@ -328,7 +330,7 @@ struct OpenGLGraphicsPlugin : public IGraphicsPlugin {
328330 glUniformMatrix4fv (m_modelViewProjectionUniformLocation, 1 , GL_FALSE, reinterpret_cast <const GLfloat*>(&mvp));
329331
330332 // Draw the cube.
331- glDrawElements (GL_TRIANGLES, static_cast <GLsizei>(ArraySize (Geometry::c_cubeIndices)), GL_UNSIGNED_SHORT, 0 );
333+ glDrawElements (GL_TRIANGLES, static_cast <GLsizei>(ArraySize (Geometry::c_cubeIndices)), GL_UNSIGNED_SHORT, nullptr );
332334 }
333335
334336 glBindVertexArray (0 );
@@ -337,7 +339,9 @@ struct OpenGLGraphicsPlugin : public IGraphicsPlugin {
337339
338340 // Swap our window every other eye for RenderDoc
339341 static int everyOther = 0 ;
340- if (everyOther++ & 1 ) ksGpuWindow_SwapBuffers (&window);
342+ if ((everyOther++ & 1 ) != 0 ) {
343+ ksGpuWindow_SwapBuffers (&window);
344+ }
341345 }
342346
343347 private:
0 commit comments