diff options
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 |