Opening Second Windowed Screen (with InitEngine3D) Crashes

Everything related to 3D programming
coco2
Enthusiast
Enthusiast
Posts: 368
Joined: Mon Nov 25, 2013 5:38 am
Location: Australia

Opening Second Windowed Screen (with InitEngine3D) Crashes

Post by coco2 »

See the code below, it is InitEngine3D() that causes the crash

Code: Select all

ExamineDesktops()

Desktop_W = DesktopWidth(0)
Desktop_H = DesktopHeight(0) 

InitEngine3D(#PB_Engine3D_DebugLog)
InitSprite()
InitKeyboard()

OpenWindow(0, 0, 0, Desktop_W/2, Desktop_H/2, "Test", #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget | #PB_Window_SizeGadget | #PB_Window_ScreenCentered)
OpenWindowedScreen(WindowID(0), 0, 0, Desktop_W/2, Desktop_H/2, #True, 0, 0)
Debug "Window 1 opened"
Delay(1000)
CloseScreen()
CloseWindow(0)
Debug "Window 1 closed"
Delay(1000)
Debug "Opening window 2"
OpenWindow(0, 0, 0, Desktop_W/2, Desktop_H/2, "Test", #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget | #PB_Window_SizeGadget | #PB_Window_ScreenCentered)
Debug "Opening window 2 screen"
OpenWindowedScreen(WindowID(0), 0, 0, Desktop_W/2, Desktop_H/2, #True, 0, 0)
Debug "Window 2 opened"
Repeat
  Repeat ; process all events
    Window_Event = WindowEvent()
    Select Window_Event
      Case #PB_Event_CloseWindow
        Quit = 1
    EndSelect
  Until Window_Event = 0  
  ExamineKeyboard()
  Delay(100)
  RenderWorld()
  FlipBuffers()
Until KeyboardPushed(#PB_Key_Escape) Or Quit = 1
EDIT: I changed the title to show the error more accurately, it is not crashing when going from full screen to window, it happens because I am trying to open WindowScreen a second time.

EDIT2: I found this thread: http://www.purebasic.fr/english/viewtop ... =4&t=53166
Fred doesn't seem to think he can fix it. It's deep inside Ogre somewhere.

EDIT3: is this any help Fred? http://ogre3d.org/forums/viewtopic.php? ... 1&start=25