1
0
Fork 0
mirror of https://github.com/gwm17/glfw.git synced 2024-11-23 10:48:51 -05:00

Reduced the number of conditional blocks.

This commit is contained in:
Camilla Berglund 2012-07-30 20:15:34 +02:00
parent a8686ce0b5
commit 6c37c84d91

View File

@ -1139,20 +1139,14 @@ void _glfwPlatformRestoreWindow(_GLFWwindow* window)
void _glfwPlatformRefreshWindowParams(void) void _glfwPlatformRefreshWindowParams(void)
{ {
#if defined(_GLFW_HAS_XRANDR)
XRRScreenConfiguration* sc;
#endif /*_GLFW_HAS_XRANDR*/
#if defined(_GLFW_HAS_XF86VIDMODE)
XF86VidModeModeLine modeline;
int dotclock;
float pixels_per_second, pixels_per_frame;
#endif /*_GLFW_HAS_XF86VIDMODE*/
_GLFWwindow* window = _glfwLibrary.currentWindow; _GLFWwindow* window = _glfwLibrary.currentWindow;
// Retrieve refresh rate if possible // Retrieve refresh rate if possible
if (_glfwLibrary.X11.RandR.available) if (_glfwLibrary.X11.RandR.available)
{ {
#if defined(_GLFW_HAS_XRANDR) #if defined(_GLFW_HAS_XRANDR)
XRRScreenConfiguration* sc;
sc = XRRGetScreenInfo(_glfwLibrary.X11.display, _glfwLibrary.X11.root); sc = XRRGetScreenInfo(_glfwLibrary.X11.display, _glfwLibrary.X11.root);
window->refreshRate = XRRConfigCurrentRate(sc); window->refreshRate = XRRConfigCurrentRate(sc);
XRRFreeScreenConfigInfo(sc); XRRFreeScreenConfigInfo(sc);
@ -1161,6 +1155,10 @@ void _glfwPlatformRefreshWindowParams(void)
else if (_glfwLibrary.X11.VidMode.available) else if (_glfwLibrary.X11.VidMode.available)
{ {
#if defined(_GLFW_HAS_XF86VIDMODE) #if defined(_GLFW_HAS_XF86VIDMODE)
XF86VidModeModeLine modeline;
int dotclock;
float pixels_per_second, pixels_per_frame;
// Use the XF86VidMode extension to get current video mode // Use the XF86VidMode extension to get current video mode
XF86VidModeGetModeLine(_glfwLibrary.X11.display, XF86VidModeGetModeLine(_glfwLibrary.X11.display,
_glfwLibrary.X11.screen, _glfwLibrary.X11.screen,