From 7178d7bfcf6bb798144d7bccf3faeb801ede2dde Mon Sep 17 00:00:00 2001 From: groogy Date: Tue, 23 Nov 2010 05:59:28 +0000 Subject: [PATCH] Test to check that SFML::RenderWindow and shapes works as they should. git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/branches/sfml2@1697 4e206d99-4929-0410-ac5d-dfc041789085 --- bindings/ruby/testing/render-window-demo.rb | 24 +++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 bindings/ruby/testing/render-window-demo.rb diff --git a/bindings/ruby/testing/render-window-demo.rb b/bindings/ruby/testing/render-window-demo.rb new file mode 100644 index 00000000..146ca337 --- /dev/null +++ b/bindings/ruby/testing/render-window-demo.rb @@ -0,0 +1,24 @@ +require 'sfml/system' +require 'sfml/window' +require 'sfml/graphics' + +app = SFML::RenderWindow.new( [800, 600], "My Ruby SFML" ) +app.framerate = 100 +app.position = [300, 300] +input = app.input + +shape = SFML::Shape.rectangle( [-10, -10, 20, 20], SFML::Color::White ) + +while app.open? + while event = app.get_event + if event.type == SFML::Event::Closed + app.close + end + end + + + app.clear + shape.position = [input.mouseX, input.mouseY] + app.draw shape + app.display +end