From 538f3869c525ab151a947707a345a15d07390f24 Mon Sep 17 00:00:00 2001 From: Alex Szpakowski Date: Thu, 24 Dec 2015 15:53:50 -0500 Subject: [PATCH] Don't query the current texture bindings when initializing OpenGL. --- src/modules/graphics/opengl/OpenGL.cpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/modules/graphics/opengl/OpenGL.cpp b/src/modules/graphics/opengl/OpenGL.cpp index 19d9b2862..0e42ba4eb 100644 --- a/src/modules/graphics/opengl/OpenGL.cpp +++ b/src/modules/graphics/opengl/OpenGL.cpp @@ -136,19 +136,14 @@ void OpenGL::setupContext() state.boundTextures.clear(); state.boundTextures.resize(maxTextureUnits, 0); - GLenum curgltextureunit; - glGetIntegerv(GL_ACTIVE_TEXTURE, (GLint *) &curgltextureunit); - - state.curTextureUnit = (int) curgltextureunit - GL_TEXTURE0; - - // Retrieve currently bound textures for each texture unit. for (int i = 0; i < (int) state.boundTextures.size(); i++) { glActiveTexture(GL_TEXTURE0 + i); - glGetIntegerv(GL_TEXTURE_BINDING_2D, (GLint *) &state.boundTextures[i]); + glBindTexture(GL_TEXTURE_2D, 0); } - glActiveTexture(curgltextureunit); + glActiveTexture(GL_TEXTURE0); + state.curTextureUnit = 0; createDefaultTexture();