diff options
author | Johannes Schickel | 2015-12-18 21:14:48 +0100 |
---|---|---|
committer | Johannes Schickel | 2016-03-16 20:29:25 +0100 |
commit | af727afe0ceb66eaf51985ceceb2ac842b3358ee (patch) | |
tree | 90a7194bb25c83c5a50e25358e340d2a31595d4c /backends/graphics/opengl/context.cpp | |
parent | da062ad1ea2d933ae7c4b56f84f34c5fb2186196 (diff) | |
download | scummvm-rg350-af727afe0ceb66eaf51985ceceb2ac842b3358ee.tar.gz scummvm-rg350-af727afe0ceb66eaf51985ceceb2ac842b3358ee.tar.bz2 scummvm-rg350-af727afe0ceb66eaf51985ceceb2ac842b3358ee.zip |
OPENGL: Simplify context type setting.
Diffstat (limited to 'backends/graphics/opengl/context.cpp')
-rw-r--r-- | backends/graphics/opengl/context.cpp | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/backends/graphics/opengl/context.cpp b/backends/graphics/opengl/context.cpp index d1776f851d..0077cc2746 100644 --- a/backends/graphics/opengl/context.cpp +++ b/backends/graphics/opengl/context.cpp @@ -27,24 +27,32 @@ namespace OpenGL { -void Context::reset() { - ready = false; - type = kContextGL; +void Context::reset(bool full) { + if (full) { + // GLES supports least features, thus we initialize the context type + // to this on full reset. + type = kContextGLES; + } + NPOTSupported = false; } Context g_context; -void OpenGLGraphicsManager::initializeGLContext(ContextType type) { - // Initialize default state. - g_context.reset(); - +void OpenGLGraphicsManager::setContextType(ContextType type) { #if USE_FORCED_GL type = kContextGL; #elif USE_FORCED_GLES type = kContextGLES; #endif + g_context.type = type; +} + +void OpenGLGraphicsManager::initializeGLContext() { + // Initialize default state. + g_context.reset(); + // Load all functions. // We use horrible trickery to silence C++ compilers. // See backends/plugins/sdl/sdl-provider.cpp for more information. @@ -72,9 +80,6 @@ void OpenGLGraphicsManager::initializeGLContext(ContextType type) { g_context.NPOTSupported = true; } } - - g_context.ready = true; - g_context.type = type; } } // End of namespace OpenGL |