From 262d9bfc1de77b4bfcf458f348c6025cb2551d39 Mon Sep 17 00:00:00 2001 From: groogy Date: Mon, 15 Nov 2010 10:03:25 +0000 Subject: [PATCH] Demonstrate the window ruby binding git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/branches/sfml2@1647 4e206d99-4929-0410-ac5d-dfc041789085 --- bindings/ruby/testing/window-demo.rb | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 bindings/ruby/testing/window-demo.rb diff --git a/bindings/ruby/testing/window-demo.rb b/bindings/ruby/testing/window-demo.rb new file mode 100644 index 00000000..3912dd03 --- /dev/null +++ b/bindings/ruby/testing/window-demo.rb @@ -0,0 +1,17 @@ +require 'sfml/system' +require 'sfml/window' + +app = SFML::Window.new( SFML::VideoMode.new( 800, 600 ), "My Ruby SFML" ) +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