diff options
author | Max Horn | 2010-07-20 07:10:25 +0000 |
---|---|---|
committer | Max Horn | 2010-07-20 07:10:25 +0000 |
commit | 5b626533cdbc2b9a8cb0b478d8e93ece852de1b9 (patch) | |
tree | 3bd0cbca8487e521683fc6f34749f03cdd265b6a /backends/graphics/opengl/opengl-graphics.cpp | |
parent | 302400a701187eba6d0dee2daa253da87b29d83f (diff) | |
download | scummvm-rg350-5b626533cdbc2b9a8cb0b478d8e93ece852de1b9.tar.gz scummvm-rg350-5b626533cdbc2b9a8cb0b478d8e93ece852de1b9.tar.bz2 scummvm-rg350-5b626533cdbc2b9a8cb0b478d8e93ece852de1b9.zip |
Change CHECK_GL_ERROR to not take a 'call statement' as parameter
Passing a 'call statement' to CHECK_GL_ERROR has various issues.
For once, it confuses code parsers in many editors and other
tools that work with C++ source directly.
Moreover, this can lead to subtle bugs if a mistake is
made with the definition of CHECK_GL_ERROR.
It also causes incorrect warnings if CHECK_GL_ERROR is
used with an "empty" call statement.
svn-id: r51050
Diffstat (limited to 'backends/graphics/opengl/opengl-graphics.cpp')
-rw-r--r-- | backends/graphics/opengl/opengl-graphics.cpp | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/backends/graphics/opengl/opengl-graphics.cpp b/backends/graphics/opengl/opengl-graphics.cpp index 540e1ada0e..4b0591e420 100644 --- a/backends/graphics/opengl/opengl-graphics.cpp +++ b/backends/graphics/opengl/opengl-graphics.cpp @@ -527,7 +527,7 @@ void OpenGLGraphicsManager::getGLPixelFormat(Graphics::PixelFormat pixelFormat, void OpenGLGraphicsManager::internUpdateScreen() { // Clear the screen - CHECK_GL_ERROR( glClear(GL_COLOR_BUFFER_BIT) ); + glClear(GL_COLOR_BUFFER_BIT); CHECK_GL_ERROR(); // Draw the game screen _gameTexture->drawTexture(0, 0, _videoMode.hardwareWidth, _videoMode.hardwareHeight); @@ -550,33 +550,33 @@ void OpenGLGraphicsManager::initGL() { GLTexture::initGLExtensions(); // Disable 3D properties - CHECK_GL_ERROR( glDisable(GL_CULL_FACE) ); - CHECK_GL_ERROR( glDisable(GL_DEPTH_TEST) ); - CHECK_GL_ERROR( glDisable(GL_LIGHTING) ); - CHECK_GL_ERROR( glDisable(GL_FOG) ); - CHECK_GL_ERROR( glDisable(GL_DITHER) ); - CHECK_GL_ERROR( glShadeModel(GL_FLAT) ); - CHECK_GL_ERROR( glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST) ); + glDisable(GL_CULL_FACE); CHECK_GL_ERROR(); + glDisable(GL_DEPTH_TEST); CHECK_GL_ERROR(); + glDisable(GL_LIGHTING); CHECK_GL_ERROR(); + glDisable(GL_FOG); CHECK_GL_ERROR(); + glDisable(GL_DITHER); CHECK_GL_ERROR(); + glShadeModel(GL_FLAT); CHECK_GL_ERROR(); + glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST); CHECK_GL_ERROR(); // Setup alpha blend (For overlay and cursor) - CHECK_GL_ERROR( glEnable(GL_BLEND) ); - CHECK_GL_ERROR( glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) ); + glEnable(GL_BLEND); CHECK_GL_ERROR(); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); CHECK_GL_ERROR(); // Enable rendering with vertex and coord arrays - CHECK_GL_ERROR( glEnableClientState(GL_VERTEX_ARRAY) ); - CHECK_GL_ERROR( glEnableClientState(GL_TEXTURE_COORD_ARRAY) ); + glEnableClientState(GL_VERTEX_ARRAY); CHECK_GL_ERROR(); + glEnableClientState(GL_TEXTURE_COORD_ARRAY); CHECK_GL_ERROR(); - CHECK_GL_ERROR( glEnable(GL_TEXTURE_2D) ); + glEnable(GL_TEXTURE_2D); CHECK_GL_ERROR(); // Setup the GL viewport - CHECK_GL_ERROR( glViewport(0, 0, _videoMode.hardwareWidth, _videoMode.hardwareHeight) ); + glViewport(0, 0, _videoMode.hardwareWidth, _videoMode.hardwareHeight); CHECK_GL_ERROR(); // Setup coordinates system - CHECK_GL_ERROR( glMatrixMode(GL_PROJECTION) ); - CHECK_GL_ERROR( glLoadIdentity() ); - CHECK_GL_ERROR( glOrtho(0, _videoMode.hardwareWidth, _videoMode.hardwareHeight, 0, -1, 1) ); - CHECK_GL_ERROR( glMatrixMode(GL_MODELVIEW) ); - CHECK_GL_ERROR( glLoadIdentity() ); + glMatrixMode(GL_PROJECTION); CHECK_GL_ERROR(); + glLoadIdentity(); CHECK_GL_ERROR(); + glOrtho(0, _videoMode.hardwareWidth, _videoMode.hardwareHeight, 0, -1, 1); CHECK_GL_ERROR(); + glMatrixMode(GL_MODELVIEW); CHECK_GL_ERROR(); + glLoadIdentity(); CHECK_GL_ERROR(); } bool OpenGLGraphicsManager::loadGFXMode() { |