require '../src/ClanRuby'
include ClanRuby

#
# This sample simply draws a jpeg image on a window. Except for the
# obvious JPEG->PNG name changes, displaying a PNG would be exactly
# the same.
#

#
# Initialize the core and display libs.
#
SetupCore.init()
SetupDisplay.init()

#
# Create an 640 X 480 window, 16 bits of color.
#
Display.setVideoMode( 640, 480, 16, false )

#
# Open the jpeg file.
#
jpegSurface = JPEGProvider.create("sample.jpeg")

#
# Draw some boxes
#
while ( ! KeyBoard.getKeycode( CL_KEY_ESCAPE) )

	#
	# Paint the image.
	#
	jpegSurface.putScreen( 10, 10)
	
	#
	# Make it all visible.
	#
	Display.flipDisplay()
	System.keepAlive(100)
end

#
# Clean up
#
SetupDisplay.deinit()
SetupCore.deinit()




