Skip to content

Commit

Permalink
#5909: Remove check for openGL 1.3. Remove unneeded non-const referen…
Browse files Browse the repository at this point in the history
…ces.
  • Loading branch information
codereader committed Mar 13, 2022
1 parent 009ac16 commit eb0a8ea
Showing 1 changed file with 21 additions and 27 deletions.
48 changes: 21 additions & 27 deletions radiantcore/rendersystem/backend/OpenGLState.h
Expand Up @@ -501,39 +501,36 @@ class OpenGLState
glActiveTexture(textureUnit);
glClientActiveTexture(textureUnit);

if (stage)
{
auto tex = stage->getTextureTransform();
glLoadMatrixd(tex);
}
else
if (!stage)
{
glLoadIdentity();
return;
}

auto tex = stage->getTextureTransform();
glLoadMatrixd(tex);
}

// Bind the given texture to the texture unit, if it is different from the
// current state, then set the current state to the new texture.
void setTextureState(GLint& current, const GLint& texture, GLenum textureUnit, GLenum textureMode)
void setTextureState(GLint& current, const GLint texture, GLenum textureUnit, GLenum textureMode)
{
if (texture != current)
{
glActiveTexture(textureUnit);
glClientActiveTexture(textureUnit);
glBindTexture(textureMode, texture);
debug::assertNoGlErrors();
current = texture;
}
if (texture == current) return;

glActiveTexture(textureUnit);
glClientActiveTexture(textureUnit);
glBindTexture(textureMode, texture);
debug::assertNoGlErrors();
current = texture;
}

void setTextureState(GLint& current, const GLint& texture, GLenum textureMode)
void setTextureState(GLint& current, const GLint texture, GLenum textureMode)
{
if (texture != current)
{
glBindTexture(textureMode, texture);
debug::assertNoGlErrors();
current = texture;
}
if (texture == current) return;

glBindTexture(textureMode, texture);
debug::assertNoGlErrors();
current = texture;
}

// Apply all textures to texture units
Expand Down Expand Up @@ -587,11 +584,8 @@ class OpenGLState

void setTexture0()
{
if (GLEW_VERSION_1_3)
{
glActiveTexture(GL_TEXTURE0);
glClientActiveTexture(GL_TEXTURE0);
}
glActiveTexture(GL_TEXTURE0);
glClientActiveTexture(GL_TEXTURE0);
}

// Utility function to toggle an OpenGL state flag
Expand Down

0 comments on commit eb0a8ea

Please sign in to comment.