Samuel wrote:EDIT #2:
After thinking about it for a while I don't think ClearScreen() will work in a 3D world.
When you use the 3D world you can no longer draw directly to the screen.
You need to draw to a sprite then display that sprite on the screen.
So, if I'm correct ClearScreen() is no longer necessary after you activate the 3D engine.
I think when using InitEngine3D() you need to create a camera first. ClearScreen() is then replaced by CameraBackColor().
Code: Select all
If InitEngine3D(#PB_Engine3D_DebugLog | #PB_Engine3D_DebugOutput) = 0 : End : EndIf
If InitSprite() = 0 : End : EndIf
If InitKeyboard() = 0 : End : EndIf
If OpenScreen(1024,600,32,"") = 0 : End : EndIf ; <-- Set your screen resolution here
;If OpenScreen(1600,1200,32,"") = 0 : End : EndIf ; <-- Set your screen resolution here
CreateCamera(1,0,0,100,100)
; CreateCube(0,10)
;
; If CreateTexture(0,256,256)
; If StartDrawing(TextureOutput(0))
; Box(0,0,OutputWidth(),OutputHeight(),RGB(255,255,0))
; Box(3,3,OutputWidth()-6,OutputHeight()-6,RGB(0,0,128))
; StopDrawing()
; EndIf
; CreateMaterial(0, TextureID(0))
; CreateEntity(0, MeshID(0), MaterialID(0))
; SetEntityMaterial(0, MaterialID(0))
; MoveEntity(0,0,0,-100)
; EndIf
Repeat
ExamineKeyboard()
;ClearScreen(RGB(Random(255),Random(255),Random(255)))
CameraBackColor(1,RGB(Random(255),Random(255),Random(255)))
If IsEntity(0):RotateEntity(0,1,1,1,#PB_Relative):EndIf
RenderWorld()
; display sprites here, after RenderWorld
FlipBuffers()
;Delay(20)
Until KeyboardPushed(#PB_Key_Escape)
End
So endo's minimalistic example should be:
Code: Select all
If InitEngine3D() = 0: End: EndIf
If InitSprite() = 0: End: EndIf
If InitKeyboard() = 0: End: EndIf
If OpenScreen(1024,600,32,"") = 0: End: EndIf
CreateCamera(0,0,0,100,100)
Repeat
CameraBackColor(0,RGB(Random(255),Random(255),Random(255)))
RenderWorld():FlipBuffers(): ExamineKeyboard()
Until KeyboardPushed(#PB_Key_Escape)