Skip to content

Commit

Permalink
OpenGL: Remove bogus error in textures example on ES 2 platforms
Browse files Browse the repository at this point in the history
The call to glGetBooleanv(GL_FRAMEBUFFER_SRGB_CAPABLE_EXT) in
QGLExtensions::currentContextExtensions() was resulting in an invalid
enum on ES 2 systems. This was not being cleared and subsequentally
being interpreted as a failed texture upload in the textures example.

This enum doesn't exist on ES 2 so don't query it.

Change-Id: I84f9c4b0aa8b11b6036eeed1f9378d110d9ea69d
Reviewed-by: Samuel Rødal <[email protected]>
  • Loading branch information
seanharmer authored and The Qt Project committed Dec 1, 2012
1 parent 5573a44 commit a7c9d5c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/opengl/qgl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4798,12 +4798,14 @@ QGLExtensions::Extensions QGLExtensions::currentContextExtensions()
if (extensions.match("GL_EXT_bgra"))
glExtensions |= BGRATextureFormat;

#if !defined(QT_OPENGL_ES)
{
GLboolean srgbCapableFramebuffers = false;
glGetBooleanv(GL_FRAMEBUFFER_SRGB_CAPABLE_EXT, &srgbCapableFramebuffers);
if (srgbCapableFramebuffers)
glExtensions |= SRGBFrameBuffer;
}
#endif

return glExtensions;
}
Expand Down

0 comments on commit a7c9d5c

Please sign in to comment.