diff options
Diffstat (limited to 'backends/graphics/opengl')
-rw-r--r-- | backends/graphics/opengl/opengl-graphics.cpp | 20 | ||||
-rw-r--r-- | backends/graphics/opengl/opengl-graphics.h | 10 |
2 files changed, 29 insertions, 1 deletions
diff --git a/backends/graphics/opengl/opengl-graphics.cpp b/backends/graphics/opengl/opengl-graphics.cpp index e2b541bef8..54be9c408c 100644 --- a/backends/graphics/opengl/opengl-graphics.cpp +++ b/backends/graphics/opengl/opengl-graphics.cpp @@ -555,7 +555,7 @@ void OpenGLGraphicsManager::internUpdateScreen() { } } -bool OpenGLGraphicsManager::loadGFXMode() { +void OpenGLGraphicsManager::initGL() { // Check available GL Extensions GLTexture::initGLExtensions(); @@ -583,6 +583,10 @@ bool OpenGLGraphicsManager::loadGFXMode() { CHECK_GL_ERROR( glOrtho(0, _videoMode.hardwareWidth, _videoMode.hardwareHeight, 0, -1, 1) ); CHECK_GL_ERROR( glMatrixMode(GL_MODELVIEW) ); CHECK_GL_ERROR( glLoadIdentity() ); +} + +bool OpenGLGraphicsManager::loadGFXMode() { + initGL(); if (!_gameTexture) { byte bpp; @@ -622,6 +626,15 @@ bool OpenGLGraphicsManager::hotswapGFXMode() { return false; } +void OpenGLGraphicsManager::setScale(int newScale) { + if (newScale == _videoMode.scaleFactor) + return; + + _videoMode.scaleFactor = newScale; + + _transactionDetails.sizeChanged = true; +} + void OpenGLGraphicsManager::adjustMouseEvent(const Common::Event &event) { if (!event.synthetic) { Common::Event newEvent(event); @@ -651,6 +664,7 @@ bool OpenGLGraphicsManager::notifyEvent(const Common::Event &event) { case Common::EVENT_MBUTTONUP: adjustMouseEvent(event); return !event.synthetic; + default: break; } @@ -658,4 +672,8 @@ bool OpenGLGraphicsManager::notifyEvent(const Common::Event &event) { return false; } +bool OpenGLGraphicsManager::saveScreenshot(const char *filename) { + return false; +} + #endif diff --git a/backends/graphics/opengl/opengl-graphics.h b/backends/graphics/opengl/opengl-graphics.h index 3da501f933..d76e328d07 100644 --- a/backends/graphics/opengl/opengl-graphics.h +++ b/backends/graphics/opengl/opengl-graphics.h @@ -100,6 +100,9 @@ public: bool notifyEvent(const Common::Event &event); protected: + + virtual void initGL(); + // // GFX and video // @@ -146,6 +149,8 @@ protected: virtual void unloadGFXMode(); virtual bool hotswapGFXMode(); + virtual void setScale(int newScale); + // // Game screen // @@ -213,6 +218,11 @@ protected: virtual void refreshCursor(); virtual void adjustMouseEvent(const Common::Event &event); virtual void setMousePos(int x, int y); + + // + // Misc + // + virtual bool saveScreenshot(const char *filename); }; #endif |