;; ////////////////////////////////////////////////////////////////////////////
;; Includes For extension libraries
XIncludeFile #PB_Compiler_Home + "Includes\IrrlichtWrapper_Include.pbi"

;; ////////////////////////////////////////////////////////////////////////////
;; Constants
  
  #WIN_WIDTH  = 800
  #WIN_HEIGHT = 600


;; ////////////////////////////////////////////////////////////////////////////
;; Variables

Global g_ScreenSize_X.l,g_ScreenSize_Y.l

g_ScreenSize_X = #WIN_WIDTH
g_ScreenSize_Y = #WIN_HEIGHT

*OurCamera  = #Null

Procedure _init()
  Shared *OurCamera.l;
  
  If IrrStartEx(#IRR_EDT_DIRECT3D9,g_ScreenSize_X, g_ScreenSize_Y,#False, #False,#False, 16, #True, #False,#False,#Null)      
                
    ; set the window caption
    IrrSetWindowCaption( "Advanced Example: SimplePacMan" )

    ;Add a Simple Box to see something
	  *box = IrrAddCubeSceneNode(10)

    IrrSetNodeMaterialFlag( *box, #IRR_EMF_LIGHTING, #False)
          
    ; add camera
    *OurCamera = IrrAddCamera(20,10,8,0,0,0)
           
  Else 
       
    MessageRequester("Problem","Could not open the Screen...")
    
    End
    
  EndIf  
  
EndProcedure

Procedure _cleanup()
  ; -----------------------------------------------------------------------------
  ; Stop the irrlicht engine and release resources
  IrrStop()
  
EndProcedure


_init()

; -----------------------------------------------------------------------------
; while the irrlicht environment is still running
While IrrRunning() And  g_GameQuit = #False

        
    ; begin the scene, erasing the canvas with sky-blue before rendering    
    IrrBeginScene( 0,0,0 )
        
    IrrDrawScene()
              
    ; end drawing the scene and render it
    IrrEndScene()
    
    Delay(1)
Wend

_cleanup()


End

; IDE Options = PureBasic 4.10 Beta 3 (Windows - x86)
; CursorPosition = 17
; Folding = -