' ------------------------------------------------------------
'   n3xt-D exemples
'
'   Sample 048   as   load irr scene
'   Historique   as 
'     29/03/09  19 as 16    TMyke
'
' ------------------------------------------------------------

' Includes libraries
#include "N3xtD.bi"

' Dimes
Dim app As any Ptr
Dim Quit As Integer


'----------------------------------------------------------
' open n3xt-D screen
app = _CreateGraphics3D(800,600)
If app=NULL Then
  End
End If

_ChangeWorkingDirectory("media/irrEdit")


'------------------------------
' Load irrscene
_LoadIrrScene("scenes/example.irr")

dim node_list as NArray = _CreateArray()

_SceneNodesFromType(node_list)
 
For i as Integer = 0 To _ArraySize( node_list )-1
  dim node as EntityNode =  _ArrayElement( node_list,  i) 
  'print _Text(_NodeName(*node))
Next



'------------------------------
' Create a camera
dim cam as CameraNode = _CreateCameraFPS( )
_PositionNode(cam, 0,20,-70)



' ---------------------------------------
'           Main loop
' ---------------------------------------
While Quit=0
 

' If Escape Key, Exit	
  If _GetKeyDown(KEY_ESCAPE) then
    Quit=1
  EndIf



  	' ---------------
  	'      Render
  	' ---------------
  _BeginScene()
     _DrawScene()
  _EndScene()


Wend 
' end
_FreeEngine()

