Patch [#26799] 2.5x blenderplayer (BGE) anti-aliasing & embedding by Sebastian Korcza...
[blender-staging.git] / intern / ghost / intern / GHOST_SystemWin32.cpp
index ffc090ba0588b2b2fce5a3e23f25b68667462043..2fdddda835dadfdcb3d1077ecb62eb1b819e44b6 100644 (file)
@@ -238,7 +238,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, numOfAASamples);
+       window = new GHOST_WindowWin32 (this, title, left, top, width, height, state, type, stereoVisual, numOfAASamples, parentWindow);
        if (window) {
                if (window->getValid()) {
                        // Store the pointer to the window
@@ -247,6 +247,14 @@ GHOST_IWindow* GHOST_SystemWin32::createWindow(
 //                     }
                }
                else {
+
+                       // Invalid parent window hwnd
+                       if (((GHOST_WindowWin32*)window)->getNextWindow() == NULL) {
+                               delete window;
+                               window = 0;
+                               return window;
+                       }
+
                        // An invalid window could be one that was used to test for AA
                        window = ((GHOST_WindowWin32*)window)->getNextWindow();