Merge fixes for X11

This commit is contained in:
Bailey Cosier 2017-09-17 00:31:41 +07:00
parent 40de269e91
commit 98563d8d4b
3 changed files with 67 additions and 71 deletions

View File

@ -120,9 +120,9 @@ selectionloop:
XFree( visualinfo );
}
u->redBits = getFBConfigAttrib(n, GLX_RED_SIZE);
u->greenBits = getFBConfigAttrib(n, GLX_GREEN_SIZE);
u->blueBits = getFBConfigAttrib(n, GLX_BLUE_SIZE);
u->redBits = getGLXFBConfigAttrib(n, GLX_RED_SIZE);
u->greenBits = getGLXFBConfigAttrib(n, GLX_GREEN_SIZE);
u->blueBits = getGLXFBConfigAttrib(n, GLX_BLUE_SIZE);
u->alphaBits = getGLXFBConfigAttrib(n, GLX_ALPHA_SIZE);
u->depthBits = getGLXFBConfigAttrib(n, GLX_DEPTH_SIZE);

View File

@ -480,6 +480,7 @@ static GLFWbool initExtensions(void)
}
_glfw.x11.xi.handle = dlopen("libXi.so.6", RTLD_LAZY | RTLD_GLOBAL);
if (_glfw.x11.xi.handle)
{
_glfw.x11.xi.QueryVersion = (PFN_XIQueryVersion)
@ -506,10 +507,6 @@ static GLFWbool initExtensions(void)
}
// Check for RandR extension
if (XRRQueryExtension(_glfw.x11.display,
&_glfw.x11.randr.eventBase,
&_glfw.x11.randr.errorBase)) {
_glfw.x11.randr.handle = dlopen("libXrandr.so.2", RTLD_LAZY | RTLD_GLOBAL);
if (_glfw.x11.randr.handle)
@ -570,7 +567,7 @@ static GLFWbool initExtensions(void)
}
}
}
}
if (_glfw.x11.randr.available)
{
XRRScreenResources* sr = XRRGetScreenResourcesCurrent(_glfw.x11.display,
@ -1056,4 +1053,3 @@ const char* _glfwPlatformGetVersionString(void)
#endif
;
}

View File

@ -1808,14 +1808,14 @@ int _glfwPlatformCreateWindow(_GLFWwindow* window,
{
if (!_glfwInitGLX())
return GLFW_FALSE;
if (!_glfwChooseVisualGLX(ctxconfig, fbconfig, &visual, &depth))
if (!_glfwChooseVisualGLX(wndconfig, ctxconfig, fbconfig, &visual, &depth))
return GLFW_FALSE;
}
else if (ctxconfig->source == GLFW_EGL_CONTEXT_API)
{
if (!_glfwInitEGL())
return GLFW_FALSE;
if (!_glfwChooseVisualEGL(ctxconfig, fbconfig, &visual, &depth))
if (!_glfwChooseVisualEGL(wndconfig, ctxconfig, fbconfig, &visual, &depth))
return GLFW_FALSE;
}
else if (ctxconfig->source == GLFW_OSMESA_CONTEXT_API)