Added initial framebuffer sRGB support.

This commit is contained in:
Camilla Berglund
2010-11-16 02:33:21 +01:00
parent 20662dd77b
commit 07260cb768
8 changed files with 53 additions and 6 deletions
+3
View File
@@ -110,6 +110,9 @@ typedef struct _GLFWcontextGLX
GLboolean has_GLX_SGI_swap_control;
GLboolean has_GLX_EXT_swap_control;
GLboolean has_GLX_ARB_multisample;
GLboolean has_GLX_ARB_fbconfig_float;
GLboolean has_GLX_ARB_framebuffer_sRGB;
GLboolean has_GLX_EXT_framebuffer_sRGB;
GLboolean has_GLX_ARB_create_context;
GLboolean has_GLX_ARB_create_context_profile;
GLboolean has_GLX_EXT_create_context_es2_profile;
+11
View File
@@ -461,6 +461,11 @@ static _GLFWfbconfig* getFBConfigs(_GLFWwindow* window, unsigned int* found)
result[*found].auxBuffers = getFBConfigAttrib(window, fbconfigs[i], GLX_AUX_BUFFERS);
result[*found].stereo = getFBConfigAttrib(window, fbconfigs[i], GLX_STEREO);
if (window->GLX.has_GLX_EXT_framebuffer_sRGB || window->GLX.has_GLX_ARB_framebuffer_sRGB)
result[*found].sRGB = getFBConfigAttrib(window, fbconfigs[i], GLX_FRAMEBUFFER_SRGB_CAPABLE_ARB);
else
result[*found].sRGB = GL_FALSE;
if (window->GLX.has_GLX_ARB_multisample)
result[*found].samples = getFBConfigAttrib(window, fbconfigs[i], GLX_SAMPLES);
else
@@ -711,6 +716,12 @@ static void initGLXExtensions(_GLFWwindow* window)
if (_glfwPlatformExtensionSupported("GLX_ARB_multisample"))
window->GLX.has_GLX_ARB_multisample = GL_TRUE;
if (_glfwPlatformExtensionSupported("GLX_EXT_framebuffer_sRGB"))
window->GLX.has_GLX_EXT_framebuffer_sRGB = GL_TRUE;
if (_glfwPlatformExtensionSupported("GLX_ARB_framebuffer_sRGB"))
window->GLX.has_GLX_ARB_framebuffer_sRGB = GL_TRUE;
if (_glfwPlatformExtensionSupported("GLX_ARB_create_context"))
{
window->GLX.CreateContextAttribsARB = (PFNGLXCREATECONTEXTATTRIBSARBPROC)