mirror of
https://github.com/glfw/glfw.git
synced 2026-09-20 16:30:45 +00:00
Added define guards for XRandR code.
This commit is contained in:
@@ -38,6 +38,7 @@
|
||||
////// GLFW platform API //////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if defined (_GLFW_HAS_XRANDR)
|
||||
_GLFWmonitor** _glfwCreateMonitor(_GLFWmonitor** current, XRROutputInfo* outputInfo, XRRCrtcInfo* crtcInfo)
|
||||
{
|
||||
*current = _glfwMalloc(sizeof(_GLFWmonitor));
|
||||
@@ -55,6 +56,7 @@ _GLFWmonitor** _glfwCreateMonitor(_GLFWmonitor** current, XRROutputInfo* outputI
|
||||
(*current)->X11.output = outputInfo;
|
||||
return &((*current)->next);
|
||||
}
|
||||
#endif /*_GLFW_HAS_XRANDR*/
|
||||
|
||||
_GLFWmonitor* _glfwDestroyMonitor(_GLFWmonitor* monitor)
|
||||
{
|
||||
@@ -62,7 +64,9 @@ _GLFWmonitor* _glfwDestroyMonitor(_GLFWmonitor* monitor)
|
||||
|
||||
result = monitor->next;
|
||||
|
||||
#if defined (_GLFW_HAS_XRANDR)
|
||||
XRRFreeOutputInfo(monitor->X11.output);
|
||||
#endif /*_GLFW_HAS_XRANDR*/
|
||||
|
||||
_glfwFree(monitor);
|
||||
|
||||
@@ -71,8 +75,11 @@ _GLFWmonitor* _glfwDestroyMonitor(_GLFWmonitor* monitor)
|
||||
|
||||
void _glfwInitMonitors(void)
|
||||
{
|
||||
_glfwLibrary.monitorListHead = NULL;
|
||||
|
||||
if(_glfwLibrary.X11.RandR.available == GL_TRUE)
|
||||
{
|
||||
#if defined (_GLFW_HAS_XRANDR)
|
||||
XRRScreenResources* resources;
|
||||
int outputIDX;
|
||||
_GLFWmonitor** curMonitor;
|
||||
@@ -113,6 +120,7 @@ void _glfwInitMonitors(void)
|
||||
XRRFreeCrtcInfo(crtcInfo);
|
||||
}
|
||||
}
|
||||
#endif /*_GLFW_HAS_XRANDR*/
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user