Purebasic 5.11 32bit, Windows 7 64bit, DirectX 9
Hier noch Code, in Zeile 12 muss ggfs. der Pfad angepasst werden.
Code: Alles auswählen
EnableExplicit
Define.i quit, camera, w3d, g3d_scr1, g3d_txt1, g3d_scr2, g3d_txt2
InitEngine3D()
InitSprite()
InitKeyboard()
InitMouse()
If OpenWindow(0, 0, 0, 1024, 768, "Purebasic", #PB_Window_SystemMenu|#PB_Window_ScreenCentered)
If OpenWindowedScreen(WindowID(0), 0, 0, WindowWidth(0), WindowHeight(0), 0, 0, 0, #PB_Screen_WaitSynchronization)
Add3DArchive("..\PureBasic\Examples\3D\Data\GUI", #PB_3DArchive_FileSystem) ; <- Pfad ggfs. anpassen
Else
Debug "Error, can not open screen in a window"
EndIf
EndIf
SetGUITheme3D("TaharezLook", "DejaVuSans-10")
w3d = OpenWindow3D(#PB_Any, 0, 0, 600, 300, "3D Window")
If IsWindow3D(w3d)
g3d_scr1 = ScrollBarGadget3D(#PB_Any, 20, 20, 400, 25, 0, 20, 20)
g3d_txt1 = StringGadget3D(#PB_Any, 450, 20, 100, 25, "")
g3d_scr2 = ScrollBarGadget3D(#PB_Any, 20, 60, 400, 25, 50, 100, 100)
g3d_txt2 = StringGadget3D(#PB_Any, 450, 60, 100, 25, "")
SetGadgetState3D(g3d_scr1, 10)
SetGadgetState3D(g3d_scr2, 100)
EndIf
camera = CreateCamera(#PB_Any, 0, 0, 100, 100)
ShowGUI(255, 1)
Repeat
While WindowEvent() : Wend
If ExamineKeyboard()
If KeyboardReleased(#PB_Key_Escape)
quit = #True
EndIf
EndIf
If ExamineMouse()
InputEvent3D(MouseX(), MouseY(), MouseButton(#PB_MouseButton_Left))
EndIf
SetGadgetText3D(g3d_txt1, Str(GetGadgetState3D(g3d_scr1)))
SetGadgetText3D(g3d_txt2, Str(GetGadgetState3D(g3d_scr2)))
RenderWorld()
FlipBuffers()
Until quit = #True