Is there a solution?
Example:
Code: Select all
EnableExplicit
Procedure.i Main(Width.i = 960,Height.i = 600)
Protected flags.i
If InitEngine3D() And InitSprite()
flags|#PB_Window_SystemMenu|#PB_Window_ScreenCentered
flags|#PB_Window_MinimizeGadget|#PB_Window_MaximizeGadget|#PB_Window_SizeGadget
If OpenWindow(0,0,0,Width,Height,#Null$,flags)
WindowBounds(0,Width,Height,#PB_Ignore,#PB_Ignore)
If OpenWindowedScreen(WindowID(0),0,0,Width,Height,#True,0,0)
SetFrameRate(60)
;------------------------------------------------------ setup scene
AmbientColor(RGB(0,0,20))
CreateLight(#PB_Any,RGB(160,160,180),0,100,0,#PB_Light_Point)
CreateLight(#PB_Any,RGB(160,120,100),-100,100,-50,#PB_Light_Point)
CreateCamera(0,0,0,100,100)
MoveCamera(0,0,2,-4,#PB_Absolute|#PB_Local)
CameraLookAt(0,0,0,0)
CreatePlane(0,1,1,1,1,0,0)
CreateEntity(0,MeshID(0),#PB_Material_None,0,0,0,1 << 1)
CreateSphere(1,0.05)
CreateEntity(1,MeshID(1),#PB_Material_None,0,0,0,1 << 2)
;------------------------------------------------------
Repeat
Repeat
Select WindowEvent()
Case #PB_Event_CloseWindow
Break 2
Case #Null
Break
EndSelect
ForEver
;------------------------------------------------------ mouse pick -.-
ResizeCamera(0,0,0,100,100)
If MousePick(0,WindowMouseX(0),WindowMouseY(0),1 << 1) >= 0
MoveEntity(1,PickX(),PickY(),PickZ(),#PB_Absolute)
EndIf
;------------------------------------------------------
RenderWorld()
FlipBuffers()
ForEver
EndIf
CloseWindow(0)
EndIf
EndIf
ProcedureReturn
EndProcedure
Main()
End