require '../src/ClanRuby'
include ClanRuby

#
# This sample script show the use of the mouse class
# which simply draws a red box where ever the mouse is.
#

#
# 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 )

#
# Draw some boxes
#
while ( ! KeyBoard.getKeycode( CL_KEY_ESCAPE) )

	#
	# Fill the window with white.
	#
	Display.fillRect( 0, 0, 640, 480, 1, 1, 1, 1)
	
	#
	# Draw a small box where the mouse is.
	#
	x = Mouse.x
	y = Mouse.y
	Display.fillRect( x-20, y-20, x+20, y+20, 1, 0, 0, 1)
	
	#
	# Make it all visible.
	#
	Display.flipDisplay()
	System.keepAlive(20)
end

#
# Clean up
#
SetupDisplay.deinit()
SetupCore.deinit()




