1
0
Fork 0
mirror of https://github.com/gwm17/glfw.git synced 2024-11-27 04:28:52 -05:00

Added workaround for missing window bit in VB GL.

This commit is contained in:
Camilla Berglund 2012-06-03 16:09:13 +02:00
parent 322407ae9f
commit fc07e1d7eb

View File

@ -128,6 +128,8 @@ static _GLFWfbconfig* getFBConfigs(_GLFWwindow* window, unsigned int* found)
GLXFBConfig* fbconfigs; GLXFBConfig* fbconfigs;
_GLFWfbconfig* result; _GLFWfbconfig* result;
int i, count = 0; int i, count = 0;
const char* vendor;
GLboolean trustWindowBit = GL_TRUE;
*found = 0; *found = 0;
@ -141,6 +143,11 @@ static _GLFWfbconfig* getFBConfigs(_GLFWwindow* window, unsigned int* found)
} }
} }
vendor = glXGetClientString(_glfwLibrary.X11.display, GLX_VENDOR);
if (strcmp(vendor, "Chromium") == 0)
trustWindowBit = GL_FALSE;
if (window->GLX.SGIX_fbconfig) if (window->GLX.SGIX_fbconfig)
{ {
fbconfigs = window->GLX.ChooseFBConfigSGIX(_glfwLibrary.X11.display, fbconfigs = window->GLX.ChooseFBConfigSGIX(_glfwLibrary.X11.display,
@ -192,11 +199,16 @@ static _GLFWfbconfig* getFBConfigs(_GLFWwindow* window, unsigned int* found)
continue; continue;
} }
if (!(getFBConfigAttrib(window, fbconfigs[i], GLX_DRAWABLE_TYPE) & GLX_WINDOW_BIT)) if (!(getFBConfigAttrib(window,
fbconfigs[i],
GLX_DRAWABLE_TYPE) & GLX_WINDOW_BIT))
{
if (trustWindowBit)
{ {
// Only consider window GLXFBConfigs // Only consider window GLXFBConfigs
continue; continue;
} }
}
result[*found].redBits = getFBConfigAttrib(window, fbconfigs[i], GLX_RED_SIZE); result[*found].redBits = getFBConfigAttrib(window, fbconfigs[i], GLX_RED_SIZE);
result[*found].greenBits = getFBConfigAttrib(window, fbconfigs[i], GLX_GREEN_SIZE); result[*found].greenBits = getFBConfigAttrib(window, fbconfigs[i], GLX_GREEN_SIZE);