aboutsummaryrefslogtreecommitdiff
path: root/backends/graphics/opengl/opengl-graphics.h
diff options
context:
space:
mode:
authorJohannes Schickel2013-08-19 00:44:55 +0200
committerJohannes Schickel2013-10-19 22:17:39 +0200
commitcc9c991d7711ec08b7f06ca712cd7dfabe69f752 (patch)
tree27734e68f564844cc1937b3ffa8b3afd534457a7 /backends/graphics/opengl/opengl-graphics.h
parent5ce830b97643fc76bdcafdbbe09e226519a9d2e6 (diff)
downloadscummvm-rg350-cc9c991d7711ec08b7f06ca712cd7dfabe69f752.tar.gz
scummvm-rg350-cc9c991d7711ec08b7f06ca712cd7dfabe69f752.tar.bz2
scummvm-rg350-cc9c991d7711ec08b7f06ca712cd7dfabe69f752.zip
OPENGL: Add OSD support.
Diffstat (limited to 'backends/graphics/opengl/opengl-graphics.h')
-rw-r--r--backends/graphics/opengl/opengl-graphics.h48
1 files changed, 48 insertions, 0 deletions
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