Skip to content

Commit

Permalink
Made the active texture fix work on GL ES 1.1.
Browse files Browse the repository at this point in the history
  • Loading branch information
binary1248 committed Apr 28, 2014
1 parent 24c364e commit ad01d1d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
8 changes: 8 additions & 0 deletions src/SFML/Graphics/GLExtensions.hpp
Expand Up @@ -58,6 +58,10 @@
#define GLEXT_GL_DEPTH_COMPONENT GL_DEPTH_COMPONENT16_OES
#define GLEXT_GL_INVALID_FRAMEBUFFER_OPERATION GL_INVALID_FRAMEBUFFER_OPERATION_OES
#define GLEXT_texture_non_power_of_two false
#define GLEXT_multitexture true
#define GLEXT_glClientActiveTexture glClientActiveTexture
#define GLEXT_glActiveTexture glActiveTexture
#define GLEXT_GL_TEXTURE0 GL_TEXTURE0

#else

Expand Down Expand Up @@ -88,6 +92,10 @@
#define GLEXT_GL_DEPTH_COMPONENT GL_DEPTH_COMPONENT
#define GLEXT_GL_INVALID_FRAMEBUFFER_OPERATION GL_INVALID_FRAMEBUFFER_OPERATION_EXT
#define GLEXT_texture_non_power_of_two GLEW_ARB_texture_non_power_of_two
#define GLEXT_multitexture GLEW_ARB_multitexture
#define GLEXT_glClientActiveTexture glClientActiveTextureARB
#define GLEXT_glActiveTexture glActiveTextureARB
#define GLEXT_GL_TEXTURE0 GL_TEXTURE0_ARB

#endif

Expand Down
10 changes: 6 additions & 4 deletions src/SFML/Graphics/RenderTarget.cpp
Expand Up @@ -366,13 +366,15 @@ void RenderTarget::resetGLStates()
applyTransform(Transform::Identity);
applyTexture(NULL);
if (Shader::isAvailable())
{
applyShader(NULL);

// Make sure that the texture unit which is active is the number 0
glCheck(glClientActiveTextureARB(GL_TEXTURE0_ARB));
glCheck(glActiveTextureARB(GL_TEXTURE0_ARB));
// Make sure that the texture unit which is active is the number 0
if (GLEXT_multitexture)
{
glCheck(GLEXT_glClientActiveTexture(GLEXT_GL_TEXTURE0));
glCheck(GLEXT_glActiveTexture(GLEXT_GL_TEXTURE0));
}

m_cache.useVertexCache = false;

// Set the default view
Expand Down

0 comments on commit ad01d1d

Please sign in to comment.