aboutsummaryrefslogtreecommitdiff
path: root/backends/graphics/opengl
diff options
context:
space:
mode:
authorJohannes Schickel2015-12-21 04:49:25 +0100
committerJohannes Schickel2016-03-16 20:29:25 +0100
commit5752f125e1a0d334c3a5bfcea314c4ffceede640 (patch)
tree96755c08c8a8221f2cb744b2a7edf203e66f4225 /backends/graphics/opengl
parent1802c939a1a46d89df05cae5e30e2014646e30fa (diff)
downloadscummvm-rg350-5752f125e1a0d334c3a5bfcea314c4ffceede640.tar.gz
scummvm-rg350-5752f125e1a0d334c3a5bfcea314c4ffceede640.tar.bz2
scummvm-rg350-5752f125e1a0d334c3a5bfcea314c4ffceede640.zip
OPENGL: Make Context::reset explicitly reset state.
Diffstat (limited to 'backends/graphics/opengl')
-rw-r--r--backends/graphics/opengl/context.cpp15
-rw-r--r--backends/graphics/opengl/opengl-graphics.cpp2
-rw-r--r--backends/graphics/opengl/opengl-sys.h5
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;