Demonstrate the window ruby binding
git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/branches/sfml2@1647 4e206d99-4929-0410-ac5d-dfc041789085
This commit is contained in:
parent
756874a4ba
commit
262d9bfc1d
17
bindings/ruby/testing/window-demo.rb
Normal file
17
bindings/ruby/testing/window-demo.rb
Normal file
@ -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
|
Loading…
Reference in New Issue
Block a user