'' ----------------------------------------------------------------------------
'' Irrlicht Wrapper For Imperative Languages - Freebasic Examples
'' Frank Dodd (2006-2010)
'' ----------------------------------------------------------------------------
'' Blitz-Irrlicht 1.8.3 Interface by Ed Musolino (AquaLung 2015)
'' ----------------------------------------------------------------------------
'' Example 31 : Loading an IrrEdit Scene
'' This example loads a scene created with the IrrEdit tool this allows a large
'' number of meshes, textures And nodes To be loaded And created in one call
'' ----------------------------------------------------------------------------

'' ////////////////////////////////////////////////////////////////////////////
'' Includes For extension libraries
Framework usr.birrlicht

'' ////////////////////////////////////////////////////////////////////////////
'' Global variables

' irrlicht objects
Global Camera%
Global CameraNode%

'' ////////////////////////////////////////////////////////////////////////////
' start the irrlicht interface
iIrr3D( 800, 600, 32, False )

' send the window caption
iAppTitle( "Example 31: Loading a scene" )

' Load an example scene created in irrEdit
iLoadScene( "./media/SimpleScene.irr" )

' we add a first person perspective camera To the scene so you can look about
' And move it into the center of the map
Camera = iCreateFPSCamera(0,100.0,0.5,-1,0,0,0,0.0)
CameraNode = Camera
iPositionNode( CameraNode, 60, 0, 0 )
iRotateNode( CameraNode, 0, -90, 0 )

' we also hide the mouse pointer To see the view better
iHideMouse()

iCameraCLSColor( 140, 255, 255 )
' -----------------------------------------------------------------------------
' While the irrlicht environment is still running
While iRun() And (Not iKeyHit( KEY_ESCAPE ))

    ' begin the scene, erasing the canvas with sky-blue before rendering
    iBeginScene()

    ' draw the scene
    iDrawScene()

    ' End drawing the scene And render it
    iEndScene()
Wend 

' -----------------------------------------------------------------------------
' Stop the irrlicht engine And Release resources
iEndIrr3D()


End