I thought I'd show how I also mangled your example since it's also having a strange side-affect now. I'm trying to tell it to show the mouse pointer on camera 0 only and now there is no mouse at all on either camera:
Code: Select all
;
; ------------------------------------------------------------
;
; PureBasic - Window 3D
;
; (c) Fantaisie Software
;
; ------------------------------------------------------------
;
#MainWindow = 0
#CloseButton = 0
IncludeFile "Screen3DRequester.pb"
Define.f KeyX, KeyY, MouseX, MouseY
If InitEngine3D()
Add3DArchive("Data/GUI", #PB_3DArchive_FileSystem)
Add3DArchive("Data/Packs/desert.zip", #PB_3DArchive_Zip)
InitSprite()
InitKeyboard()
InitMouse()
If Screen3DRequester()
SkyBox("desert07.jpg")
CreateCamera(0, 0, 0, 100, 100)
MoveCamera(0,0,20,100, #PB_Absolute)
CameraLookAt(0,0,0,0)
CreateCamera(1, 0, 50, 50, 50)
MoveCamera(1,0,100,20, #PB_Absolute)
OpenWindow3D(#MainWindow, 100, 100, 300, 100, "Hello in 3D !",#PB_Window3D_Borderless)
ProgressBarGadget3D(0,10,35,180,20,0,7)
TextGadget3D(4,10,5,70,30,"Health")
ButtonGadget3D(10, 150, 60, 120, 25, "Quit")
OpenWindow3D(#MainWindow+1, 200, 200, 300, 100, "Hello in 3D !",#PB_Window3D_Borderless)
ProgressBarGadget3D(1,10,35,180,20,0,7)
TextGadget3D(5,10,5,70,30,"Health")
OpenWindow3D(#MainWindow+2, 300, 300, 300, 100, "Hello in 3D !",#PB_Window3D_Borderless)
ProgressBarGadget3D(2,10,35,180,20,0,7)
TextGadget3D(6,10,5,70,30,"Health")
OpenWindow3D(#MainWindow+3, 400, 400, 300, 100, "Hello in 3D !",#PB_Window3D_Borderless)
ProgressBarGadget3D(3,10,35,180,20,0,7)
TextGadget3D(7,10,5,70,30,"Health")
ShowGUI(128, #True, 0, #True)
ShowGUI(128, #False, 1, #False) ; Display the GUI, semi-transparent and display the mouse cursor
Repeat
Screen3DEvents()
If ExamineKeyboard() And ExamineMouse()
Input$ = KeyboardInkey()
InputEvent3D(MouseX(), MouseY(), MouseButton(#PB_MouseButton_Left), Input$, 0)
EndIf
; Handle the GUI 3D events, it's similar to regular GUI events
;
Repeat
Event = WindowEvent3D()
Select Event
Case #PB_Event3D_CloseWindow
If EventWindow3D() = #MainWindow
CloseWindow3D(#MainWindow)
EndIf
Case #PB_Event3D_Gadget
If EventGadget3D() = #CloseButton
Quit = 1
EndIf
EndSelect
Until Event = 0
RenderWorld()
FlipBuffers()
Until KeyboardPushed(#PB_Key_Escape) Or Quit = 1
EndIf
Else
MessageRequester("Error", "The 3D Engine can't be initialized", 0)
EndIf