Skip to content

Commit

Permalink
GLSupport: correctly check SRGB framebuffer support
Browse files Browse the repository at this point in the history
see glXGetFBConfigAttrib return values
  • Loading branch information
paroj committed Nov 11, 2017
1 parent 340b551 commit c6bc54b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions RenderSystems/GLSupport/src/GLX/OgreGLXWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ namespace Ogre
bool vsync = false;
bool hidden = false;
unsigned int vsyncInterval = 1;
int gamma = 0;
bool gamma = false;
::GLXContext glxContext = 0;
::GLXDrawable glxDrawable = 0;
Window externalWindow = 0;
Expand Down Expand Up @@ -319,11 +319,13 @@ namespace Ogre
mGLSupport->getFBConfigAttrib(fbConfig, GLX_SAMPLES, &fsaa);
mFSAA = fsaa;

if (gamma != 0)
if (gamma)
{
mGLSupport->getFBConfigAttrib(fbConfig, GL_FRAMEBUFFER_SRGB_CAPABLE_EXT, &gamma);
int val = 0;
gamma = mGLSupport->getFBConfigAttrib(fbConfig, GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT, &val) == 0;
gamma = gamma && val; // can an supported extension return 0? lets rather be safe..
}
mHwGamma = (gamma != 0);
mHwGamma = gamma;

LogManager::getSingleton().logMessage("Actual frame buffer FSAA: " + StringConverter::toString(mFSAA) + ", gamma: " + StringConverter::toString(mHwGamma));
}
Expand Down

0 comments on commit c6bc54b

Please sign in to comment.