From b21b65eb436f542bb9095e3756869839890458c8 Mon Sep 17 00:00:00 2001 From: Magnus Norddahl Date: Thu, 18 Aug 2016 01:32:41 +0200 Subject: [PATCH] Rearrange binding of texture and sampler to get rid of texture state usage warning --- src/gl/renderer/gl_postprocessstate.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gl/renderer/gl_postprocessstate.cpp b/src/gl/renderer/gl_postprocessstate.cpp index 7e34a1149..058e41190 100644 --- a/src/gl/renderer/gl_postprocessstate.cpp +++ b/src/gl/renderer/gl_postprocessstate.cpp @@ -59,6 +59,7 @@ FGLPostProcessState::FGLPostProcessState() glGetIntegerv(GL_ACTIVE_TEXTURE, &activeTex); glActiveTexture(GL_TEXTURE0); glGetIntegerv(GL_TEXTURE_BINDING_2D, &textureBinding); + glBindTexture(GL_TEXTURE_2D, 0); if (gl.flags & RFL_SAMPLER_OBJECTS) { glGetIntegerv(GL_SAMPLER_BINDING, &samplerBinding); @@ -117,8 +118,9 @@ FGLPostProcessState::~FGLPostProcessState() glUseProgram(currentProgram); glActiveTexture(GL_TEXTURE0); - glBindTexture(GL_TEXTURE_2D, textureBinding); + glBindTexture(GL_TEXTURE_2D, 0); if (gl.flags & RFL_SAMPLER_OBJECTS) glBindSampler(0, samplerBinding); + glBindTexture(GL_TEXTURE_2D, textureBinding); glActiveTexture(activeTex); }