--####################################################################################################
-- Name : LuaPlayer Eurphoria Sample.
-- Programmer : Zack (Danny Glover) : danny86@live.ie  - http://www.retroemu.com
--####################################################################################################

-- NOTE : I have chosen not to have input in the Sample, to show you the true FPS.
-- (If i enabled screen.waitVblankStart or pad = Controls.Read() the framerate would be capped to 60fps.

--//## Load a Image for the background
bkIMG = Image.load("bk.png")

--//## Initialize the Ogg library
Ogg.init()

--//## Load Ogg File
Ogg.load("sample.ogg")

--//## Play the Ogg
Ogg.play()

--//## Set CPU speed
System.setCpuSpeed(222)

--//## MAIN ##\\ --

while not Controls.read():start() do

	--Initialize the GU (Note : Any graphical functions MUST be placed AFTER this)
	System.draw()
	
	--Clear the screen
	screen:clear()

	--//## Blit the background Image
 	screen:blit(0, 0, bkIMG)
	
	--Finish the GU and Sync
	System.endDraw()
	
	--Show the FPS (Note : MUST be called after System.endDraw()
	System.showFPS()
	screen.flip()
end

System.quit() -- Quit the application after the main loop breaks
