Formatting.
This commit is contained in:
parent
e188f6c4e1
commit
c68a4aa2ef
@ -91,48 +91,45 @@ _GLFWmonitor* _glfwDestroyMonitor(_GLFWmonitor* monitor)
|
|||||||
|
|
||||||
_GLFWmonitor* _glfwCreateMonitors(void)
|
_GLFWmonitor* _glfwCreateMonitors(void)
|
||||||
{
|
{
|
||||||
_GLFWmonitor* monitorList;
|
_GLFWmonitor* monitorList = NULL;
|
||||||
|
|
||||||
monitorList = NULL;
|
|
||||||
|
|
||||||
if (_glfwLibrary.X11.RandR.available)
|
if (_glfwLibrary.X11.RandR.available)
|
||||||
{
|
{
|
||||||
#if defined (_GLFW_HAS_XRANDR)
|
#if defined (_GLFW_HAS_XRANDR)
|
||||||
|
int oi;
|
||||||
XRRScreenResources* resources;
|
XRRScreenResources* resources;
|
||||||
int outputIDX;
|
_GLFWmonitor** monitor = &monitorList;
|
||||||
_GLFWmonitor** curMonitor;
|
|
||||||
|
|
||||||
curMonitor = &monitorList;
|
|
||||||
|
|
||||||
resources = XRRGetScreenResources(_glfwLibrary.X11.display,
|
resources = XRRGetScreenResources(_glfwLibrary.X11.display,
|
||||||
_glfwLibrary.X11.root);
|
_glfwLibrary.X11.root);
|
||||||
|
|
||||||
for (outputIDX = 0; outputIDX < resources->noutput; outputIDX++)
|
for (oi = 0; oi < resources->noutput; oi++)
|
||||||
{
|
{
|
||||||
// physical device
|
// physical device
|
||||||
XRROutputInfo* outputInfo = NULL;
|
XRROutputInfo* outputInfo = NULL;
|
||||||
// logical surface
|
// logical surface
|
||||||
XRRCrtcInfo* crtcInfo = NULL;
|
XRRCrtcInfo* crtcInfo = NULL;
|
||||||
int crtcIDX;
|
|
||||||
|
|
||||||
outputInfo = XRRGetOutputInfo(_glfwLibrary.X11.display,
|
outputInfo = XRRGetOutputInfo(_glfwLibrary.X11.display,
|
||||||
resources,
|
resources,
|
||||||
resources->outputs[outputIDX]);
|
resources->outputs[oi]);
|
||||||
|
|
||||||
if (outputInfo->connection == RR_Connected)
|
if (outputInfo->connection == RR_Connected)
|
||||||
{
|
{
|
||||||
for (crtcIDX = 0; crtcIDX < outputInfo->ncrtc; crtcIDX++)
|
int ci;
|
||||||
|
|
||||||
|
for (ci = 0; ci < outputInfo->ncrtc; ci++)
|
||||||
{
|
{
|
||||||
if (outputInfo->crtc == outputInfo->crtcs[crtcIDX])
|
if (outputInfo->crtc == outputInfo->crtcs[ci])
|
||||||
{
|
{
|
||||||
crtcInfo = XRRGetCrtcInfo(_glfwLibrary.X11.display,
|
crtcInfo = XRRGetCrtcInfo(_glfwLibrary.X11.display,
|
||||||
resources,
|
resources,
|
||||||
outputInfo->crtcs[crtcIDX]);
|
outputInfo->crtcs[ci]);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
curMonitor = _glfwCreateMonitor(curMonitor, outputInfo, crtcInfo);
|
monitor = _glfwCreateMonitor(monitor, outputInfo, crtcInfo);
|
||||||
|
|
||||||
// Freeing of the outputInfo is done in _glfwDestroyMonitor
|
// Freeing of the outputInfo is done in _glfwDestroyMonitor
|
||||||
XRRFreeCrtcInfo(crtcInfo);
|
XRRFreeCrtcInfo(crtcInfo);
|
||||||
|
Loading…
Reference in New Issue
Block a user