#Include "Ninfa3d.bi"

dim Shared camera As nCAMERA
Dim chopper As nMESH

'Enable vertical synch.
EnableVsync()

'Starts the Ninfa3D Engine
InitEngine(640,480,32,0)
	BackGroundColor(128,128,128)'Background Color
	AmbientLight(255,255,255)'Ambient color
	
'Include the file "SampleFuntions.bi.
'It contains useful features, such as drawing the interface and create the test area.
#Include "SampleFunctions.bi"

'Create a camera
camera = CreateCameraFPS(200,0.25)
	PositionEntity(camera,0,128,-128)' Position

CreateGround()'Creates the test area

'Load mesh.
chopper = LoadMesh("media/chopper.b3d")

While(EngineRun)'Returns 1 if the engine is running.

	'Begins scene
	BeginScene()
	
	'By pressing the "ESCAPE" closes the engine.
	If KeyHit(KEY_ESCAPE) Then CloseEngine()

	'Update the Engine.
	'Changing the value (only affects the physics) that will update the
	'Physical faster or slower.
	UpdateEngine(0)
	
	If KeyHit(KEY_1) Then FadeIn(2000)
	If KeyHit(KEY_2) Then FadeOut(2000)

	'Displays the interface (FPS and triangles)
	Interface()
	
	Text(10,100,"Press 1 - Fade In")
	Text(10,120,"Press 2 - Fade Out")
	
	'End the scene
	EndScene()
	
Wend

'Ends Ninfa3D Engine
EndEngine()