Patch [#20588] Adding multisample support to Win32 Ghost - by Mitchell Stokes (Moguri)
[blender.git] / intern / ghost / intern / GHOST_SystemWin32.cpp
index d7d657fb4969246c5b02603f6444defd1d6289e4..7d52ab5569286a6969041cee57306cca5474b221 100644 (file)
@@ -193,7 +193,7 @@ GHOST_IWindow* GHOST_SystemWin32::createWindow(
        bool stereoVisual, const GHOST_TUns16 numOfAASamples, const GHOST_TEmbedderWindowID parentWindow )
 {
        GHOST_Window* window = 0;
-       window = new GHOST_WindowWin32 (this, title, left, top, width, height, state, type, stereoVisual);
+       window = new GHOST_WindowWin32 (this, title, left, top, width, height, state, type, stereoVisual, numOfAASamples);
        if (window) {
                if (window->getValid()) {
                        // Store the pointer to the window
@@ -202,8 +202,18 @@ GHOST_IWindow* GHOST_SystemWin32::createWindow(
 //                     }
                }
                else {
+                       // An invalid window could be one that was used to test for AA
+                       GHOST_Window *other_window = ((GHOST_WindowWin32*)window)->getNextWindow();
+
                        delete window;
                        window = 0;
+                       
+                       // If another window is found, let the wm know about that one, but not the old one
+                       if (other_window)
+                       {
+                               m_windowManager->addWindow(other_window);
+                               window = other_window;
+                       }
                }
        }
        return window;