From 8a6e57cba1c89f922e27bb72201cfda55681f6dc Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Thu, 15 Aug 2013 18:53:55 +0200 Subject: BACKENDS: Remove OpenGL and OpenGL SDL backend. This breaks our Tizen port. --- backends/graphics/opengl/opengl-graphics.h | 351 ----------------------------- 1 file changed, 351 deletions(-) delete mode 100644 backends/graphics/opengl/opengl-graphics.h (limited to 'backends/graphics/opengl/opengl-graphics.h') diff --git a/backends/graphics/opengl/opengl-graphics.h b/backends/graphics/opengl/opengl-graphics.h deleted file mode 100644 index 9d8d418d11..0000000000 --- a/backends/graphics/opengl/opengl-graphics.h +++ /dev/null @@ -1,351 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#ifndef BACKENDS_GRAPHICS_OPENGL_H -#define BACKENDS_GRAPHICS_OPENGL_H - -#include "backends/graphics/opengl/gltexture.h" -#include "backends/graphics/graphics.h" -#include "common/array.h" -#include "common/rect.h" -#include "graphics/font.h" -#include "graphics/pixelformat.h" - -// Uncomment this to enable the 'on screen display' code. -#define USE_OSD 1 - -namespace OpenGL { -// The OpenGL GFX modes. They have to be inside the OpenGL namespace so they -// do not clash with the SDL GFX modes. -enum { - GFX_NORMAL = 0, - GFX_CONSERVE = 1, - GFX_ORIGINAL = 2 -}; - -} - -/** - * OpenGL graphics manager. This is an abstract class, it does not do the - * window and OpenGL context initialization. - * Derived classes should at least override internUpdateScreen for doing - * the buffers swap, and implement loadGFXMode for handling the window/context if - * needed. If USE_RGB_COLOR is enabled, getSupportedFormats must be implemented. - */ -class OpenGLGraphicsManager : public GraphicsManager { -public: - OpenGLGraphicsManager(); - virtual ~OpenGLGraphicsManager(); - - virtual bool hasFeature(OSystem::Feature f); - virtual void setFeatureState(OSystem::Feature f, bool enable); - virtual bool getFeatureState(OSystem::Feature f); - - static const OSystem::GraphicsMode *supportedGraphicsModes(); - virtual const OSystem::GraphicsMode *getSupportedGraphicsModes() const; - virtual int getDefaultGraphicsMode() const; - virtual bool setGraphicsMode(int mode); - virtual int getGraphicsMode() const; - virtual void resetGraphicsScale(); -#ifdef USE_RGB_COLOR - virtual Graphics::PixelFormat getScreenFormat() const; - virtual Common::List getSupportedFormats() const = 0; -#endif - virtual void initSize(uint width, uint height, const Graphics::PixelFormat *format = NULL); - virtual int getScreenChangeID() const; - - virtual void beginGFXTransaction(); - virtual OSystem::TransactionError endGFXTransaction(); - - virtual int16 getHeight(); - virtual int16 getWidth(); -protected: - // PaletteManager API - virtual void setPalette(const byte *colors, uint start, uint num); - virtual void grabPalette(byte *colors, uint start, uint num); - -public: - virtual void copyRectToScreen(const void *buf, int pitch, int x, int y, int w, int h); - virtual Graphics::Surface *lockScreen(); - virtual void unlockScreen(); - virtual void fillScreen(uint32 col); - virtual void updateScreen(); - virtual void setShakePos(int shakeOffset); - virtual void setFocusRectangle(const Common::Rect &rect); - virtual void clearFocusRectangle(); - - virtual void showOverlay(); - virtual void hideOverlay(); - virtual Graphics::PixelFormat getOverlayFormat() const; - virtual void clearOverlay(); - virtual void grabOverlay(void *buf, int pitch); - virtual void copyRectToOverlay(const void *buf, int pitch, int x, int y, int w, int h); - virtual int16 getOverlayHeight(); - virtual int16 getOverlayWidth(); - - virtual bool showMouse(bool visible); - virtual void warpMouse(int x, int y); - virtual void setMouseCursor(const void *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, bool dontScale = false, const Graphics::PixelFormat *format = NULL); - virtual void setCursorPalette(const byte *colors, uint start, uint num); - - virtual void displayMessageOnOSD(const char *msg); -protected: - /** - * Setup OpenGL settings - */ - virtual void initGL(); - - /** - * Creates and refreshs OpenGL textures. - */ - virtual void loadTextures(); - - // - // GFX and video - // - enum { - kTransactionNone = 0, - kTransactionActive = 1, - kTransactionRollback = 2 - }; - - struct TransactionDetails { - bool sizeChanged; - bool needRefresh; - bool needUpdatescreen; - bool filterChanged; -#ifdef USE_RGB_COLOR - bool formatChanged; -#endif - }; - TransactionDetails _transactionDetails; - int _transactionMode; - - struct VideoState { - bool setup; - - bool fullscreen; - - int mode; - int scaleFactor; - bool antialiasing; - bool aspectRatioCorrection; - - int screenWidth, screenHeight; - int overlayWidth, overlayHeight; - int hardwareWidth, hardwareHeight; -#ifdef USE_RGB_COLOR - Graphics::PixelFormat format; -#endif - }; - VideoState _videoMode, _oldVideoMode; - - /** - * Sets the OpenGL texture format for the given pixel format. If format is not support will raise an error. - */ - virtual void getGLPixelFormat(Graphics::PixelFormat pixelFormat, byte &bpp, GLenum &intFormat, GLenum &glFormat, GLenum &type); - - virtual void internUpdateScreen(); - virtual bool loadGFXMode(); - virtual void unloadGFXMode(); - - /** - * Setup the fullscreen mode state. - */ - void setFullscreenMode(bool enable); - - /** - * Query the fullscreen state. - */ - inline bool getFullscreenMode() const { return _videoMode.fullscreen; } - - /** - * Set the scale factor. - * - * This can only be used in a GFX transaction. - * - * @param newScale New scale factor. - */ - void setScale(int newScale); - - /** - * Query the scale factor. - */ - inline int getScale() const { return _videoMode.scaleFactor; } - - /** - * Toggle the antialiasing state of the current video mode. - * - * This can only be used in a GFX transaction. - */ - void toggleAntialiasing(); - - /** - * Query the antialiasing state. - */ - inline bool getAntialiasingState() const { return _videoMode.antialiasing; } - - // Drawing coordinates for the current display mode and scale - int _displayX; - int _displayY; - int _displayWidth; - int _displayHeight; - - virtual const char *getCurrentModeName(); - - virtual void calculateDisplaySize(int &width, int &height); - virtual void refreshDisplaySize(); - - uint getAspectRatio() const; - - void setFormatIsBGR(bool isBGR) { _formatBGR = isBGR; } - bool _formatBGR; - - // - // Game screen - // - GLTexture *_gameTexture; - Graphics::Surface _screenData; - int _screenChangeCount; - bool _screenNeedsRedraw; - Common::Rect _screenDirtyRect; - -#ifdef USE_RGB_COLOR - Graphics::PixelFormat _screenFormat; -#endif - byte *_gamePalette; - - virtual void refreshGameScreen(); - - // Shake mode - int _shakePos; - - // - // Overlay - // - GLTexture *_overlayTexture; - Graphics::Surface _overlayData; - Graphics::PixelFormat _overlayFormat; - bool _overlayVisible; - bool _overlayNeedsRedraw; - Common::Rect _overlayDirtyRect; - - virtual void refreshOverlay(); - - // - // Mouse - // - struct MousePos { - // The mouse position in hardware screen coordinates. - int16 x, y; - - // The size and hotspot of the original cursor image. - int16 w, h; - int16 hotX, hotY; - - // The size and hotspot of the scaled cursor, in real coordinates. - int16 rW, rH; - int16 rHotX, rHotY; - - // The size and hotspot of the scaled cursor, in game coordinates. - int16 vW, vH; - int16 vHotX, vHotY; - - MousePos() : x(0), y(0), w(0), h(0), hotX(0), hotY(0), - rW(0), rH(0), rHotX(0), rHotY(0), vW(0), vH(0), - vHotX(0), vHotY(0) {} - }; - - GLTexture *_cursorTexture; - Graphics::Surface _cursorData; - Graphics::PixelFormat _cursorFormat; - byte *_cursorPalette; - bool _cursorPaletteDisabled; - MousePos _cursorState; - bool _cursorVisible; - uint32 _cursorKeyColor; - bool _cursorDontScale; - bool _cursorNeedsRedraw; - - /** - * Set up the mouse position for graphics output. - * - * @param x X coordinate in native coordinates. - * @param y Y coordinate in native coordinates. - */ - void setMousePosition(int x, int y) { _cursorState.x = x; _cursorState.y = y; } - - virtual void refreshCursor(); - virtual void refreshCursorScale(); - - /** - * Set up the mouse position for the (event) system. - * - * @param x X coordinate in native coordinates. - * @param y Y coordinate in native coordinates. - */ - virtual void setInternalMousePosition(int x, int y) = 0; - - /** - * Adjusts hardware screen coordinates to either overlay or game screen - * coordinates depending on whether the overlay is visible or not. - * - * @param x X coordinate of the mouse position. - * @param y Y coordinate of the mouse position. - */ - virtual void adjustMousePosition(int16 &x, int16 &y); - - // - // Misc - // - virtual bool saveScreenshot(const char *filename); - -#ifdef USE_OSD - /** - * Returns the font used for on screen display - */ - virtual const Graphics::Font *getFontOSD(); - - /** - * Update the OSD texture / surface. - */ - void updateOSD(); - - /** - * The OSD contents. - */ - Common::Array _osdLines; - - GLTexture *_osdTexture; - Graphics::Surface _osdSurface; - uint8 _osdAlpha; - uint32 _osdFadeStartTime; - bool _requireOSDUpdate; - enum { - kOSDFadeOutDelay = 2 * 1000, - kOSDFadeOutDuration = 500, - kOSDInitialAlpha = 80 - }; -#endif -}; - -#endif -- cgit v1.2.3 From 46323074e77622e7d08fe20bfdcc459b8eba08a3 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Fri, 16 Aug 2013 05:29:56 +0200 Subject: OPENGL: Add new generic OpenGL (ES) backend. This backend is based on ideas of the old OpenGL backend, of the Android GL backend and of the iPhone GL backend. --- backends/graphics/opengl/opengl-graphics.h | 418 +++++++++++++++++++++++++++++ 1 file changed, 418 insertions(+) create mode 100644 backends/graphics/opengl/opengl-graphics.h (limited to 'backends/graphics/opengl/opengl-graphics.h') diff --git a/backends/graphics/opengl/opengl-graphics.h b/backends/graphics/opengl/opengl-graphics.h new file mode 100644 index 0000000000..e21bda4b8a --- /dev/null +++ b/backends/graphics/opengl/opengl-graphics.h @@ -0,0 +1,418 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#ifndef BACKENDS_GRAPHICS_OPENGL_OPENGL_GRAPHICS_H +#define BACKENDS_GRAPHICS_OPENGL_OPENGL_GRAPHICS_H + +#include "backends/graphics/opengl/opengl-sys.h" +#include "backends/graphics/graphics.h" + +#include "common/frac.h" + +namespace OpenGL { + +class Texture; + +enum { + GFX_LINEAR = 0, + GFX_NEAREST = 1 +}; + +class OpenGLGraphicsManager : public GraphicsManager { +public: + OpenGLGraphicsManager(); + virtual ~OpenGLGraphicsManager(); + + // GraphicsManager API + virtual bool hasFeature(OSystem::Feature f); + virtual void setFeatureState(OSystem::Feature f, bool enable); + virtual bool getFeatureState(OSystem::Feature f); + + virtual const OSystem::GraphicsMode *getSupportedGraphicsModes() const; + virtual int getDefaultGraphicsMode() const; + virtual bool setGraphicsMode(int mode); + virtual int getGraphicsMode() const; + + virtual void resetGraphicsScale() {} + +#ifdef USE_RGB_COLOR + virtual Graphics::PixelFormat getScreenFormat() const; + virtual Common::List getSupportedFormats() const = 0; +#endif + + virtual void beginGFXTransaction(); + virtual OSystem::TransactionError endGFXTransaction(); + + virtual int getScreenChangeID() const; + + virtual void initSize(uint width, uint height, const Graphics::PixelFormat *format); + + virtual int16 getWidth(); + virtual int16 getHeight(); + + virtual void copyRectToScreen(const void *buf, int pitch, int x, int y, int w, int h); + virtual void fillScreen(uint32 col); + + virtual void setShakePos(int shakeOffset); + + virtual void updateScreen(); + + virtual Graphics::Surface *lockScreen(); + virtual void unlockScreen(); + + virtual void setFocusRectangle(const Common::Rect& rect); + virtual void clearFocusRectangle(); + + virtual int16 getOverlayWidth(); + virtual int16 getOverlayHeight(); + + virtual void showOverlay(); + virtual void hideOverlay(); + + virtual Graphics::PixelFormat getOverlayFormat() const; + + virtual void copyRectToOverlay(const void *buf, int pitch, int x, int y, int w, int h); + virtual void clearOverlay(); + virtual void grabOverlay(void *buf, int pitch); + + virtual bool showMouse(bool visible); + virtual void warpMouse(int x, int y); + virtual void setMouseCursor(const void *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, bool dontScale, const Graphics::PixelFormat *format); + virtual void setCursorPalette(const byte *colors, uint start, uint num); + + virtual void displayMessageOnOSD(const char *msg); + + // PaletteManager interface + virtual void setPalette(const byte *colors, uint start, uint num); + virtual void grabPalette(byte *colors, uint start, uint num); + +protected: + /** + * Set up the actual screen size available for the OpenGL code to do any + * drawing. + * + * @param width The width of the screen. + * @param height The height of the screen. + */ + void setActualScreenSize(uint width, uint height); + + /** + * Notify the manager of a OpenGL context change. This should be the first + * thing to call when you create an OpenGL (ES) context! + * + * @param defaultFormat The new default format for the game screen + * (this is used for the CLUT8 game screens). + * @param defaultFromatAlpha The new default format with an alpha channel + * (this is used for the overlay and cursor). + */ + void notifyContextChange(const Graphics::PixelFormat &defaultFormat, const Graphics::PixelFormat &defaultFormatAlpha); + + /** + * Adjust the physical mouse coordinates according to the currently visible screen. + */ + void adjustMousePosition(int16 &x, int16 &y); + + /** + * Set up the mouse position for graphics output. + * + * @param x X coordinate in physical coordinates. + * @param y Y coordinate in physical coordinates. + */ + void setMousePosition(int x, int y) { _cursorX = x; _cursorY = y; } + + /** + * Set up the mouse position for the (event) system. + * + * @param x X coordinate in physical coordinates. + * @param y Y coordinate in physical coordinates. + */ + virtual void setInternalMousePosition(int x, int y) = 0; + +private: + // + // Transaction support + // + struct VideoState { + VideoState() : valid(false), gameWidth(0), gameHeight(0), +#ifdef USE_RGB_COLOR + gameFormat(), +#endif + aspectRatioCorrection(false), graphicsMode(GFX_LINEAR) { + } + + bool valid; + + uint gameWidth, gameHeight; +#ifdef USE_RGB_COLOR + Graphics::PixelFormat gameFormat; +#endif + bool aspectRatioCorrection; + int graphicsMode; + + bool operator==(const VideoState &right) { + return gameWidth == right.gameWidth && gameHeight == right.gameHeight +#ifdef USE_RGB_COLOR + && gameFormat == right.gameFormat +#endif + && aspectRatioCorrection == right.aspectRatioCorrection + && graphicsMode == right.graphicsMode; + } + + bool operator!=(const VideoState &right) { + return !(*this == right); + } + }; + + /** + * The currently setup video state. + */ + VideoState _currentState; + + /** + * The old video state used when doing a transaction rollback. + */ + VideoState _oldState; + +protected: + enum TransactionMode { + kTransactionNone = 0, + kTransactionActive = 1, + kTransactionRollback = 2 + }; + + TransactionMode getTransactionMode() const { return _transactionMode; } + +private: + /** + * The current transaction mode. + */ + TransactionMode _transactionMode; + + /** + * The current screen change ID. + */ + int _screenChangeID; + +protected: + /** + * Set up the requested video mode. This takes parameters which describe + * what resolution the game screen requests (this is possibly aspect ratio + * corrected!). + * + * A sub-class should take these parameters as hints. It might very well + * set up a mode which it thinks suites the situation best. + * + * @parma requestedWidth This is the requested actual game screen width. + * @param requestedHeight This is the requested actual game screen height. + * @param format This is the requested pixel format of the virtual game screen. + * @return true on success, false otherwise + */ + virtual bool loadVideoMode(uint requestedWidth, uint requestedHeight, const Graphics::PixelFormat &format) = 0; + +private: + // + // OpenGL utilities + // + + /** + * Try to determine the internal parameters for a given pixel format. + * + * @return true when the format can be used, false otherwise. + */ + bool getGLPixelFormat(const Graphics::PixelFormat &pixelFormat, GLenum &glIntFormat, GLenum &glFormat, GLenum &glType) const; + + // + // Actual hardware screen + // + + /** + * The width of the physical output. + */ + uint _outputScreenWidth; + + /** + * The height of the physical output. + */ + uint _outputScreenHeight; + + /** + * @return The desired aspect of the game screen. + */ + frac_t getDesiredGameScreenAspect() const; + + /** + * Recalculates the area used to display the game screen. + */ + void recalculateDisplayArea(); + + /** + * The X coordinate of the game screen. + */ + uint _displayX; + + /** + * The Y coordinate of the game screen. + */ + uint _displayY; + + /** + * The width of the game screen in physical coordinates. + */ + uint _displayWidth; + + /** + * The height of the game screen in physical coordinates. + */ + uint _displayHeight; + + /** + * The default pixel format of the backend. + */ + Graphics::PixelFormat _defaultFormat; + + /** + * The default pixel format with an alpha channel. + */ + Graphics::PixelFormat _defaultFormatAlpha; + + // + // Game screen + // + + /** + * The virtual game screen. + */ + Texture *_gameScreen; + + /** + * The game palette if in CLUT8 mode. + */ + byte _gamePalette[3 * 256]; + + /** + * The offset by which the screen is moved vertically. + */ + int _gameScreenShakeOffset; + + // + // Overlay + // + + /** + * The overlay screen. + */ + Texture *_overlay; + + /** + * Whether the overlay is visible or not. + */ + bool _overlayVisible; + + // + // Cursor + // + + /** + * Set up the correct cursor palette. + */ + void updateCursorPalette(); + + /** + * The cursor image. + */ + Texture *_cursor; + + /** + * X coordinate of the cursor in phyiscal coordinates. + */ + uint _cursorX; + + /** + * Y coordinate of the cursor in physical coordinates. + */ + uint _cursorY; + + /** + * The X offset for the cursor hotspot in unscaled coordinates. + */ + uint _cursorHotspotX; + + /** + * The Y offset for the cursor hotspot in unscaled coordinates. + */ + uint _cursorHotspotY; + + /** + * Recalculate the cursor scaling. Scaling is always done according to + * the game screen. + */ + void recalculateCursorScaling(); + + /** + * The X offset for the cursor hotspot in scaled coordinates. + */ + uint _cursorHotspotXScaled; + + /** + * The Y offset for the cursor hotspot in scaled coordinates. + */ + uint _cursorHotspotYScaled; + + /** + * The width of the cursor scaled coordinates. + */ + uint _cursorWidthScaled; + + /** + * The height of the cursor scaled coordinates. + */ + uint _cursorHeightScaled; + + /** + * The key color. + */ + uint32 _cursorKeyColor; + + /** + * Whether the cursor is actually visible. + */ + bool _cursorVisible; + + /** + * Whether no cursor scaling should be applied. + */ + bool _cursorDontScale; + + /** + * Whether the special cursor palette is enabled. + */ + bool _cursorPaletteEnabled; + + /** + * The special cursor palette in case enabled. + */ + byte _cursorPalette[3 * 256]; +}; + +} // End of namespace OpenGL + +#endif -- cgit v1.2.3 From 5ce830b97643fc76bdcafdbbe09e226519a9d2e6 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sun, 18 Aug 2013 16:56:34 +0200 Subject: SDL: Add a OpenGL SDL backend and hook it into the SDL backend. The hooking code is nearly exactly the old hooking code. Only the OpenGL SDL creation has been adapted since it uses a different constructor now. --- backends/graphics/opengl/opengl-graphics.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'backends/graphics/opengl/opengl-graphics.h') diff --git a/backends/graphics/opengl/opengl-graphics.h b/backends/graphics/opengl/opengl-graphics.h index e21bda4b8a..5aa521cb7a 100644 --- a/backends/graphics/opengl/opengl-graphics.h +++ b/backends/graphics/opengl/opengl-graphics.h @@ -47,6 +47,10 @@ public: virtual void setFeatureState(OSystem::Feature f, bool enable); virtual bool getFeatureState(OSystem::Feature f); + // HACK: This is required for the SDL backend to switch between OpenGL SDL + // and Surface SDL. + static const OSystem::GraphicsMode *supportedGraphicsModes(); + virtual const OSystem::GraphicsMode *getSupportedGraphicsModes() const; virtual int getDefaultGraphicsMode() const; virtual bool setGraphicsMode(int mode); -- cgit v1.2.3 From cc9c991d7711ec08b7f06ca712cd7dfabe69f752 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Mon, 19 Aug 2013 00:44:55 +0200 Subject: OPENGL: Add OSD support. --- backends/graphics/opengl/opengl-graphics.h | 48 ++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) (limited to 'backends/graphics/opengl/opengl-graphics.h') diff --git a/backends/graphics/opengl/opengl-graphics.h b/backends/graphics/opengl/opengl-graphics.h index 5aa521cb7a..d4bd0137ed 100644 --- a/backends/graphics/opengl/opengl-graphics.h +++ b/backends/graphics/opengl/opengl-graphics.h @@ -27,9 +27,19 @@ #include "backends/graphics/graphics.h" #include "common/frac.h" +#include "common/mutex.h" + +namespace Graphics { +class Font; +} // End of namespace Graphics namespace OpenGL { +// HACK: We use glColor in the OSD code. This might not be working on GL ES but +// we still enable it because Tizen already shipped with it. Also, the +// SurfaceSDL backend enables it and disabling it can cause issues in sdl.cpp. +#define USE_OSD 1 + class Texture; enum { @@ -415,6 +425,44 @@ private: * The special cursor palette in case enabled. */ byte _cursorPalette[3 * 256]; + +#ifdef USE_OSD + // + // OSD + // +protected: + /** + * Returns the font used for on screen display + */ + virtual const Graphics::Font *getFontOSD(); + +private: + /** + * The OSD's contents. + */ + Texture *_osd; + + /** + * Current opacity level of the OSD. + */ + uint8 _osdAlpha; + + /** + * When fading the OSD has started. + */ + uint32 _osdFadeStartTime; + + /** + * Mutex to allow displayMessageOnOSD to be used from the audio thread. + */ + Common::Mutex _osdMutex; + + enum { + kOSDFadeOutDelay = 2 * 1000, + kOSDFadeOutDuration = 500, + kOSDInitialAlpha = 80 + }; +#endif }; } // End of namespace OpenGL -- cgit v1.2.3 From 20e4a7f0ce86bc93511643e4943b29044c84263f Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Mon, 19 Aug 2013 02:10:43 +0200 Subject: TIZEN: Adapt to new OpenGL code. Thanks to Chris Warren-Smith for testing this a bit. --- backends/graphics/opengl/opengl-graphics.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'backends/graphics/opengl/opengl-graphics.h') diff --git a/backends/graphics/opengl/opengl-graphics.h b/backends/graphics/opengl/opengl-graphics.h index d4bd0137ed..67ad5aa067 100644 --- a/backends/graphics/opengl/opengl-graphics.h +++ b/backends/graphics/opengl/opengl-graphics.h @@ -153,6 +153,11 @@ protected: */ void setMousePosition(int x, int y) { _cursorX = x; _cursorY = y; } + /** + * Query the mouse position in physical coordinates. + */ + void getMousePosition(int16 &x, int16 &y) const { x = _cursorX; y = _cursorY; } + /** * Set up the mouse position for the (event) system. * -- cgit v1.2.3 From 05c347fc8ad8edc990c9d6e7c15a12d93bd8a3a3 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sat, 19 Oct 2013 20:39:01 +0200 Subject: OPENGL/SDL: Add screenshot support. --- backends/graphics/opengl/opengl-graphics.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'backends/graphics/opengl/opengl-graphics.h') diff --git a/backends/graphics/opengl/opengl-graphics.h b/backends/graphics/opengl/opengl-graphics.h index 67ad5aa067..ebfe38fb60 100644 --- a/backends/graphics/opengl/opengl-graphics.h +++ b/backends/graphics/opengl/opengl-graphics.h @@ -247,6 +247,14 @@ protected: */ virtual bool loadVideoMode(uint requestedWidth, uint requestedHeight, const Graphics::PixelFormat &format) = 0; + /** + * Save a screenshot of the full display as BMP to the given file. This + * uses Common::DumpFile for writing the screenshot. + * + * @param filename The output filename. + */ + void saveScreenshot(const Common::String &filename) const; + private: // // OpenGL utilities -- cgit v1.2.3