aboutsummaryrefslogtreecommitdiff
path: root/backends/graphics/openglsdl
diff options
context:
space:
mode:
authorAlejandro Marzini2010-07-24 05:54:51 +0000
committerAlejandro Marzini2010-07-24 05:54:51 +0000
commitb89412d7e4a8473292a041f0fe6519ccd2d06621 (patch)
treeb2c943dde353a6de1ba7a6870d69a32a4a5c2fc3 /backends/graphics/openglsdl
parentbbdb87a83151e1fdf6770523f0a90fe825e88965 (diff)
downloadscummvm-rg350-b89412d7e4a8473292a041f0fe6519ccd2d06621.tar.gz
scummvm-rg350-b89412d7e4a8473292a041f0fe6519ccd2d06621.tar.bz2
scummvm-rg350-b89412d7e4a8473292a041f0fe6519ccd2d06621.zip
OPENGL: Redesign blitting system. Add basics for aspect correction.
Removed the extra surface in GLTexture. Now there are copies of the texture data in their original format (so engine can get the original data when lockScreen or grabOverlay is called). This copies will be updated when the engine calls a function that modifies the game screen/overlay, and the textures will be marked as dirty. When updating screen, the textures will be updated from the copies data if they are dirty. svn-id: r51234
Diffstat (limited to 'backends/graphics/openglsdl')
-rw-r--r--backends/graphics/openglsdl/openglsdl-graphics.cpp29
-rw-r--r--backends/graphics/openglsdl/openglsdl-graphics.h3
2 files changed, 29 insertions, 3 deletions
diff --git a/backends/graphics/openglsdl/openglsdl-graphics.cpp b/backends/graphics/openglsdl/openglsdl-graphics.cpp
index aa0a9aa717..6f2ba0df9c 100644
--- a/backends/graphics/openglsdl/openglsdl-graphics.cpp
+++ b/backends/graphics/openglsdl/openglsdl-graphics.cpp
@@ -44,6 +44,28 @@ OpenGLSdlGraphicsManager::~OpenGLSdlGraphicsManager() {
}
+
+bool OpenGLSdlGraphicsManager::hasFeature(OSystem::Feature f) {
+ return
+ (f == OSystem::kFeatureFullscreenMode) ||
+ (f == OSystem::kFeatureIconifyWindow) ||
+ OpenGLGraphicsManager::hasFeature(f);
+}
+
+void OpenGLSdlGraphicsManager::setFeatureState(OSystem::Feature f, bool enable) {
+ switch (f) {
+ case OSystem::kFeatureFullscreenMode:
+ setFullscreenMode(enable);
+ break;
+ case OSystem::kFeatureIconifyWindow:
+ if (enable)
+ SDL_WM_IconifyWindow();
+ break;
+ default:
+ OpenGLGraphicsManager::setFeatureState(f, enable);
+ }
+}
+
#ifdef USE_RGB_COLOR
const Graphics::PixelFormat RGBList[] = {
@@ -202,9 +224,9 @@ void OpenGLSdlGraphicsManager::internUpdateScreen() {
bool OpenGLSdlGraphicsManager::handleScalerHotkeys(Common::KeyCode key) {
// Ctrl-Alt-a toggles aspect ratio correction
- /*if (key == 'a') {
+ if (key == 'a') {
beginGFXTransaction();
- setFeatureState(OSystem::kFeatureAspectRatioCorrection, !_videoMode.aspectRatioCorrection);
+ setAspectRatioCorrection(-1);
endGFXTransaction();
#ifdef USE_OSD
char buffer[128];
@@ -222,7 +244,7 @@ bool OpenGLSdlGraphicsManager::handleScalerHotkeys(Common::KeyCode key) {
#endif
internUpdateScreen();
return true;
- }*/
+ }
// Ctrl-Alt-f toggles antialiasing
if (key == 'f') {
@@ -329,6 +351,7 @@ bool OpenGLSdlGraphicsManager::notifyEvent(const Common::Event &event) {
_videoMode.hardwareHeight = event.mouse.y;
_screenResized = true;
_transactionDetails.sizeChanged = true;
+ _transactionDetails.newContext = true;
endGFXTransaction();
return true;
diff --git a/backends/graphics/openglsdl/openglsdl-graphics.h b/backends/graphics/openglsdl/openglsdl-graphics.h
index b0bf12cd4d..f11782131c 100644
--- a/backends/graphics/openglsdl/openglsdl-graphics.h
+++ b/backends/graphics/openglsdl/openglsdl-graphics.h
@@ -42,6 +42,9 @@ public:
OpenGLSdlGraphicsManager();
virtual ~OpenGLSdlGraphicsManager();
+ virtual bool hasFeature(OSystem::Feature f);
+ virtual void setFeatureState(OSystem::Feature f, bool enable);
+
#ifdef USE_RGB_COLOR
virtual Common::List<Graphics::PixelFormat> getSupportedFormats() const;
#endif