diff options
Diffstat (limited to 'backends')
-rw-r--r-- | backends/graphics/opengl/context.cpp | 15 | ||||
-rw-r--r-- | backends/graphics/opengl/opengl-graphics.cpp | 2 | ||||
-rw-r--r-- | backends/graphics/opengl/opengl-sys.h | 5 |
3 files changed, 12 insertions, 10 deletions
diff --git a/backends/graphics/opengl/context.cpp b/backends/graphics/opengl/context.cpp index 618be07a57..a58a5e060a 100644 --- a/backends/graphics/opengl/context.cpp +++ b/backends/graphics/opengl/context.cpp @@ -27,14 +27,15 @@ namespace OpenGL { -void Context::reset(bool full) { - // GLES supports least features, thus we initialize the context type - // to this on full reset. - const ContextType savedType = full ? kContextGLES : type; - - memset(this, 0, sizeof(Context)); +void Context::reset() { + NPOTSupported = false; +#if !USE_FORCED_GLES && !USE_FORCED_GLES2 + shadersSupported = false; +#endif - type = savedType; +#define GL_FUNC_DEF(ret, name, param) name = nullptr; +#include "backends/graphics/opengl/opengl-func.h" +#undef GL_FUNC_DEF } Context g_context; diff --git a/backends/graphics/opengl/opengl-graphics.cpp b/backends/graphics/opengl/opengl-graphics.cpp index 9203390489..624a5561b5 100644 --- a/backends/graphics/opengl/opengl-graphics.cpp +++ b/backends/graphics/opengl/opengl-graphics.cpp @@ -60,7 +60,7 @@ OpenGLGraphicsManager::OpenGLGraphicsManager() #endif { memset(_gamePalette, 0, sizeof(_gamePalette)); - g_context.reset(true); + g_context.reset(); } OpenGLGraphicsManager::~OpenGLGraphicsManager() { diff --git a/backends/graphics/opengl/opengl-sys.h b/backends/graphics/opengl/opengl-sys.h index 6da1850cba..239512bc8a 100644 --- a/backends/graphics/opengl/opengl-sys.h +++ b/backends/graphics/opengl/opengl-sys.h @@ -85,9 +85,10 @@ struct Context { /** * Reset context. * - * This marks all extensions as unavailable. + * This marks all extensions as unavailable and clears all function + * pointers. */ - void reset(bool full = false); + void reset(); /** Whether GL_ARB_texture_non_power_of_two is available or not. */ bool NPOTSupported; |