Posted: Fri Jan 10, 2003 6:11 pm
Restored from previous forum. Originally posted by sigi.
Hi,
how can i make a 3D Screen in Windowed Mode with a Menu, without the
Screenmoderequester that is in the Examples Sources.
Here a piece of code:
If InitEngine3D()
InitSprite()
InitKeyboard()
InitMouse()
mainwin=OpenWindow(0,0,0,640,480,#PB_Window_SystemMenu|#PB_Window_WindowCentered,"test")
CreateMenu(0, WindowID())
MenuTitle("Project")
MenuItem(1, "Quit")
MenuTitle("About")
MenuItem(2, "About...")
If OpenWindowedScreen(mainwin,0,0,640,480,0,0,0)=0
MessageRequester("Error","Failed to open DirectX Window",#MB_ICONERROR)
End
EndIf
Repeat
event=WaitWindowEvent()
Select event
Case #PB_Event_Menu
Select EventMenuID()
Case 1
Quit = 1
Case 2
MessageRequester("Info", "Windowed 3D in PureBasic !", 0)
EndSelect
Case #PB_Event_CloseWindow
Quit = 1
EndSelect
If Quit = 1 : End : EndIf ; Quit the app immediately
;RenderWorld() <- if i uncomment this it crashes
;FlipBuffers() <- if i uncomment this it crashes
Until event = 0
Else
MessageRequester("Error", "The 3D Engine can't be initialized",0)
EndIf
End
please help a really newbie,
thank you
Hi,
how can i make a 3D Screen in Windowed Mode with a Menu, without the
Screenmoderequester that is in the Examples Sources.
Here a piece of code:
If InitEngine3D()
InitSprite()
InitKeyboard()
InitMouse()
mainwin=OpenWindow(0,0,0,640,480,#PB_Window_SystemMenu|#PB_Window_WindowCentered,"test")
CreateMenu(0, WindowID())
MenuTitle("Project")
MenuItem(1, "Quit")
MenuTitle("About")
MenuItem(2, "About...")
If OpenWindowedScreen(mainwin,0,0,640,480,0,0,0)=0
MessageRequester("Error","Failed to open DirectX Window",#MB_ICONERROR)
End
EndIf
Repeat
event=WaitWindowEvent()
Select event
Case #PB_Event_Menu
Select EventMenuID()
Case 1
Quit = 1
Case 2
MessageRequester("Info", "Windowed 3D in PureBasic !", 0)
EndSelect
Case #PB_Event_CloseWindow
Quit = 1
EndSelect
If Quit = 1 : End : EndIf ; Quit the app immediately
;RenderWorld() <- if i uncomment this it crashes
;FlipBuffers() <- if i uncomment this it crashes
Until event = 0
Else
MessageRequester("Error", "The 3D Engine can't be initialized",0)
EndIf
End
please help a really newbie,
thank you