temp solution for mac os x 10.9 fullscreen with oculus

This commit is contained in:
Juan Andres 2014-05-02 16:13:21 -04:00
parent 303b9baea0
commit c0d6ce2540
2 changed files with 70 additions and 67 deletions

View File

@ -288,8 +288,8 @@ _GLFWmonitor** _glfwPlatformGetMonitors(int* count)
_glfwInputError(GLFW_PLATFORM_ERROR, _glfwInputError(GLFW_PLATFORM_ERROR,
"Cocoa: Failed to find NSScreen for CGDisplay"); "Cocoa: Failed to find NSScreen for CGDisplay");
_glfwFreeMonitor(monitors[found]); // _glfwFreeMonitor(monitors[found]);
monitors[found] = NULL; // monitors[found] = NULL;
} }
} }

View File

@ -95,74 +95,75 @@ static int refreshVideoModes(_GLFWmonitor* monitor)
void _glfwInputMonitorChange(void) void _glfwInputMonitorChange(void)
{ {
int i, j, monitorCount = _glfw.monitorCount; return;
_GLFWmonitor** monitors = _glfw.monitors; // int i, j, monitorCount = _glfw.monitorCount;
// _GLFWmonitor** monitors = _glfw.monitors;
_glfw.monitors = _glfwPlatformGetMonitors(&_glfw.monitorCount); // _glfw.monitors = _glfwPlatformGetMonitors(&_glfw.monitorCount);
// Re-use still connected monitor objects // // Re-use still connected monitor objects
for (i = 0; i < _glfw.monitorCount; i++) // for (i = 0; i < _glfw.monitorCount; i++)
{ // {
for (j = 0; j < monitorCount; j++) // for (j = 0; j < monitorCount; j++)
{ // {
if (_glfwPlatformIsSameMonitor(_glfw.monitors[i], monitors[j])) // if (_glfwPlatformIsSameMonitor(_glfw.monitors[i], monitors[j]))
{ // {
_glfwFreeMonitor(_glfw.monitors[i]); // _glfwFreeMonitor(_glfw.monitors[i]);
_glfw.monitors[i] = monitors[j]; // _glfw.monitors[i] = monitors[j];
break; // break;
} // }
} // }
} // }
// Find and report disconnected monitors (not in the new list) // // Find and report disconnected monitors (not in the new list)
for (i = 0; i < monitorCount; i++) // for (i = 0; i < monitorCount; i++)
{ // {
_GLFWwindow* window; // _GLFWwindow* window;
for (j = 0; j < _glfw.monitorCount; j++) // for (j = 0; j < _glfw.monitorCount; j++)
{ // {
if (monitors[i] == _glfw.monitors[j]) // if (monitors[i] == _glfw.monitors[j])
break; // break;
} // }
if (j < _glfw.monitorCount) // if (j < _glfw.monitorCount)
continue; // continue;
for (window = _glfw.windowListHead; window; window = window->next) // for (window = _glfw.windowListHead; window; window = window->next)
{ // {
if (window->monitor == monitors[i]) // if (window->monitor == monitors[i])
window->monitor = NULL; // window->monitor = NULL;
} // }
if (_glfw.callbacks.monitor) // if (_glfw.callbacks.monitor)
_glfw.callbacks.monitor((GLFWmonitor*) monitors[i], GLFW_DISCONNECTED); // _glfw.callbacks.monitor((GLFWmonitor*) monitors[i], GLFW_DISCONNECTED);
} // }
// Find and report newly connected monitors (not in the old list) // // Find and report newly connected monitors (not in the old list)
// Re-used monitor objects are then removed from the old list to avoid // // Re-used monitor objects are then removed from the old list to avoid
// having them destroyed at the end of this function // // having them destroyed at the end of this function
for (i = 0; i < _glfw.monitorCount; i++) // for (i = 0; i < _glfw.monitorCount; i++)
{ // {
for (j = 0; j < monitorCount; j++) // for (j = 0; j < monitorCount; j++)
{ // {
if (_glfw.monitors[i] == monitors[j]) // if (_glfw.monitors[i] == monitors[j])
{ // {
monitors[j] = NULL; // monitors[j] = NULL;
break; // break;
} // }
} // }
if (j < monitorCount) // if (j < monitorCount)
continue; // continue;
if (_glfw.callbacks.monitor) // if (_glfw.callbacks.monitor)
_glfw.callbacks.monitor((GLFWmonitor*) _glfw.monitors[i], GLFW_CONNECTED); // _glfw.callbacks.monitor((GLFWmonitor*) _glfw.monitors[i], GLFW_CONNECTED);
} // }
_glfwFreeMonitors(monitors, monitorCount); // _glfwFreeMonitors(monitors, monitorCount);
} }
@ -182,25 +183,27 @@ _GLFWmonitor* _glfwAllocMonitor(const char* name, int widthMM, int heightMM)
void _glfwFreeMonitor(_GLFWmonitor* monitor) void _glfwFreeMonitor(_GLFWmonitor* monitor)
{ {
if (monitor == NULL) return;
return; // if (monitor == NULL)
// return;
_glfwFreeGammaArrays(&monitor->originalRamp); // _glfwFreeGammaArrays(&monitor->originalRamp);
_glfwFreeGammaArrays(&monitor->currentRamp); // _glfwFreeGammaArrays(&monitor->currentRamp);
free(monitor->modes); // free(monitor->modes);
free(monitor->name); // free(monitor->name);
free(monitor); // free(monitor);
} }
void _glfwFreeMonitors(_GLFWmonitor** monitors, int count) void _glfwFreeMonitors(_GLFWmonitor** monitors, int count)
{ {
int i; return;
// int i;
for (i = 0; i < count; i++) // for (i = 0; i < count; i++)
_glfwFreeMonitor(monitors[i]); // _glfwFreeMonitor(monitors[i]);
free(monitors); // free(monitors);
} }
const GLFWvidmode* _glfwChooseVideoMode(_GLFWmonitor* monitor, const GLFWvidmode* _glfwChooseVideoMode(_GLFWmonitor* monitor,