2010-11-15 18:03:25 +08:00
|
|
|
require 'sfml/system'
|
|
|
|
require 'sfml/window'
|
|
|
|
|
|
|
|
app = SFML::Window.new( SFML::VideoMode.new( 800, 600 ), "My Ruby SFML" )
|
2010-11-16 16:10:47 +08:00
|
|
|
app.framerate = 100
|
2010-11-15 18:03:25 +08:00
|
|
|
input = app.input
|
|
|
|
|
|
|
|
while app.open?
|
|
|
|
while event = app.get_event
|
|
|
|
if event.type == SFML::Event::Closed
|
|
|
|
app.close
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
p [input.mouse_x, input.mouse_y]
|
|
|
|
|
|
|
|
app.display
|
|
|
|
end
|