Merge branch 'master' into multi-monitor

This commit is contained in:
Camilla Berglund
2012-10-22 02:46:06 +02:00
6 changed files with 30 additions and 16 deletions
+3 -4
View File
@@ -654,9 +654,9 @@ static GLboolean initializeAppKit(void)
// Implicitly create shared NSApplication instance
[GLFWApplication sharedApplication];
// Setting up the menu bar must go between sharedApplication
// above and finishLaunching below, in order to properly emulate the
// behavior of NSApplicationMain
// Menu bar setup must go between sharedApplication above and
// finishLaunching below, in order to properly emulate the behavior
// of NSApplicationMain
createMenuBar();
[NSApp finishLaunching];
@@ -969,7 +969,6 @@ void _glfwPlatformDestroyWindow(_GLFWwindow* window)
[window->NSGL.pixelFormat release];
window->NSGL.pixelFormat = nil;
[NSOpenGLContext clearCurrentContext];
[window->NSGL.context release];
window->NSGL.context = nil;
-5
View File
@@ -528,11 +528,6 @@ int _glfwCreateContext(_GLFWwindow* window,
void _glfwDestroyContext(_GLFWwindow* window)
{
// This is duplicated from glfwDestroyWindow
// TODO: Stop duplicating code
if (window == _glfwCurrentWindow)
_glfwPlatformMakeContextCurrent(NULL);
if (window->WGL.context)
{
wglDeleteContext(window->WGL.context);
+8
View File
@@ -964,8 +964,16 @@ int _glfwPlatformCreateWindow(_GLFWwindow* window,
// we're just creating an OpenGL 3.0+ context with the same pixel
// format, but it's not worth the added code complexity
// First we clear the current context (the one we just created)
// This is usually done by glfwDestroyWindow, but as we're not doing
// full window destruction, it's duplicated here
_glfwPlatformMakeContextCurrent(NULL);
// Next destroy the Win32 window and WGL context (without resetting or
// destroying the GLFW window object)
destroyWindow(window);
// ...and then create them again, this time with better APIs
if (!createWindow(window, wndconfig, fbconfig))
return GL_FALSE;
}
+2 -2
View File
@@ -477,8 +477,8 @@ GLFWAPI void glfwDestroyWindow(GLFWwindow handle)
if (window == NULL)
return;
// Clear the current context if this window's context is current
// TODO: Re-examine this in light of multithreading
// The window's context must not be current on another thread when the
// window is destroyed
if (window == _glfwPlatformGetCurrentContext())
_glfwPlatformMakeContextCurrent(NULL);
-2
View File
@@ -619,8 +619,6 @@ void _glfwDestroyContext(_GLFWwindow* window)
if (window->GLX.context)
{
// Release and destroy the context
glXMakeCurrent(_glfwLibrary.X11.display, None, NULL);
glXDestroyContext(_glfwLibrary.X11.display, window->GLX.context);
window->GLX.context = NULL;
}