I looked at the PB example for it. The example worked well for choosing which one got displayed over the other, but the cubes were overlapping each other.
I tried moving one of the cubes 30 units in front of the other, but SetRenderQueue() no longer worked.
Looking through some OGRE documentation I thought this was possible, but maybe I've misunderstood how SetRenderQueue() works.
I'd greatly appreciate it if someone could explain how SetRenderQueue() works to me.
Code: Select all
;
; ------------------------------------------------------------
;
; PureBasic - SetRenderQueue
;
; (c) 2013 - Fantaisie Software
;
; ------------------------------------------------------------
;
;Use [F5]/[F6]
#CameraSpeed = 1
#Camera = 0
#Entity0 = 0
#Entity1 = 1
#Material0 = 0
#Material1 = 1
#Mesh = 0
#Texture0 = 0
#Texture1 = 1
If InitEngine3D()
Add3DArchive(#PB_Compiler_Home+"/Examples/3D/Data/Textures", #PB_3DArchive_FileSystem)
Add3DArchive(#PB_Compiler_Home+"/Examples/3D/Data/Packs/skybox.zip", #PB_3DArchive_Zip)
InitSprite()
InitKeyboard()
InitMouse()
ExamineDesktops()
DesktopW=DesktopWidth(0)
DesktopH=DesktopHeight(0)
If OpenWindow(0, 0, 0, DesktopW, DesktopH, "Test")
If OpenWindowedScreen(WindowID(0), 0, 0, DesktopW, DesktopH, 0, 0, 0)
CreateMaterial(#Material0, LoadTexture(#Texture0, "clouds.jpg"))
CreateMaterial(#Material1, LoadTexture(#Texture1, "Dirt.jpg"))
CreateCube(#Mesh, 20)
CreateEntity(0, MeshID(#Mesh), MaterialID(#Material0), 0, 0, 0)
CreateEntity(1, MeshID(#Mesh), MaterialID(#Material1), 0, 0, 30)
SetRenderQueue(EntityID(0), 0)
SetRenderQueue(EntityID(1), 1)
SkyBox("stevecube.jpg")
CreateCamera(#Camera, 0, 0, 100, 100)
MoveCamera(#Camera, 40, 0, 150, #PB_Absolute)
Repeat
Event=WaitWindowEvent()
If ExamineKeyboard()
If KeyboardReleased(#PB_Key_F5)
SetRenderQueue(EntityID(#Entity0), 1)
SetRenderQueue(EntityID(#Entity1), 0)
ElseIf KeyboardReleased(#PB_Key_F6)
SetRenderQueue(EntityID(#Entity0), 0)
SetRenderQueue(EntityID(#Entity1), 1)
EndIf
EndIf
RenderWorld()
FlipBuffers()
Until Event = #PB_Event_CloseWindow Or KeyboardPushed(#PB_Key_Escape)
EndIf
EndIf
Else
MessageRequester("Error", "The 3D Engine can't be initialized",0)
EndIf
End

