diff options
Diffstat (limited to 'backends/graphics/opengl')
-rw-r--r-- | backends/graphics/opengl/opengl-graphics.cpp | 54 | ||||
-rw-r--r-- | backends/graphics/opengl/opengl-graphics.h | 2 |
2 files changed, 26 insertions, 30 deletions
diff --git a/backends/graphics/opengl/opengl-graphics.cpp b/backends/graphics/opengl/opengl-graphics.cpp index f5f0cdeb57..49589ead30 100644 --- a/backends/graphics/opengl/opengl-graphics.cpp +++ b/backends/graphics/opengl/opengl-graphics.cpp @@ -53,26 +53,6 @@ OpenGLGraphicsManager::~OpenGLGraphicsManager() { } -void OpenGLGraphicsManager::init() { - GLTexture::initGLExtensions(); - - glDisable(GL_CULL_FACE); - glDisable(GL_DEPTH_TEST); - glDisable(GL_LIGHTING); - glDisable(GL_FOG); - glDisable(GL_DITHER); - glShadeModel(GL_FLAT); - glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST); - - glEnable(GL_BLEND); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - - glEnableClientState(GL_VERTEX_ARRAY); - glEnableClientState(GL_TEXTURE_COORD_ARRAY); - - glEnable(GL_TEXTURE_2D); -} - // // Feature // @@ -463,6 +443,32 @@ void OpenGLGraphicsManager::internUpdateScreen() { } bool OpenGLGraphicsManager::loadGFXMode() { + GLTexture::initGLExtensions(); + + glDisable(GL_CULL_FACE); + glDisable(GL_DEPTH_TEST); + glDisable(GL_LIGHTING); + glDisable(GL_FOG); + glDisable(GL_DITHER); + glShadeModel(GL_FLAT); + glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST); + + glEnable(GL_BLEND); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + + glEnableClientState(GL_VERTEX_ARRAY); + glEnableClientState(GL_TEXTURE_COORD_ARRAY); + + glEnable(GL_TEXTURE_2D); + + glViewport(0, 0, _videoMode.hardwareWidth, _videoMode.hardwareHeight); + + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + glOrtho(0, _videoMode.hardwareWidth, _videoMode.hardwareHeight, 0, -1, 1); + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + if (!_gameTexture) { byte bpp; GLenum format; @@ -485,14 +491,6 @@ bool OpenGLGraphicsManager::loadGFXMode() { _gameTexture->allocBuffer(_videoMode.screenWidth, _videoMode.screenHeight); _overlayTexture->allocBuffer(_videoMode.overlayWidth, _videoMode.overlayHeight); - glViewport(0, 0, _videoMode.hardwareWidth, _videoMode.hardwareHeight); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(0, _videoMode.hardwareWidth, _videoMode.hardwareHeight, 0, -1, 1); - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - return true; } diff --git a/backends/graphics/opengl/opengl-graphics.h b/backends/graphics/opengl/opengl-graphics.h index e0807d8a73..70a7bc0960 100644 --- a/backends/graphics/opengl/opengl-graphics.h +++ b/backends/graphics/opengl/opengl-graphics.h @@ -47,8 +47,6 @@ public: OpenGLGraphicsManager(); virtual ~OpenGLGraphicsManager(); - virtual void init(); - virtual bool hasFeature(OSystem::Feature f); virtual void setFeatureState(OSystem::Feature f, bool enable); virtual bool getFeatureState(OSystem::Feature f); |