This is the Ruby bindings of the SFML library developed and maintained by Groogy
I hope you enjoy using rbSFML. If you make anything in it then we are very interested in hearing about it. We can always be reached at http://www.sfml-dev.org/forum for support, ideas or just have a nice chat.
If you have questions or need help then please post it on the forum or write us an email. The issue tracker is for bugs and suggestions only please. If you are uncertain then write it on the forum instead.
Of course this means this library depends on SFML so you'll have to install SFML2 on your development machine in order to compile rbSFML. rbSFML comes with a cloned module from the SFML Github repository that rbSFML is known to compile against but you can try and use the latest version of SFML as long as SFML has not come with anything API breaking. If that is the case then you don't even need to recompile rbSFML but only replace the SFML shared libraries.
Recommended is this setup: (lowers or highers versions might work too)
-
Install Ruby. The simple Ruby Installer works fine.
-
Open
cmd
and navigate to a folder where you want to install rbSFML source files. -
Clone this repository with
git clone git@github.com:Groogy/rbSFML.git
. -
Ensure that your C++ compiler's location is in your PATH environment variable. Run
rake verbose
to see what compiler Ruby thinks you have. If the SFML headers and libraries are not in your compiler's default search paths, set theSFML_INCLUDE
andSFML_LIB
environment variables to their locations. -
Run one of the following commands in your terminal:
rake
- Build all SFML as shared libraries (need DLLs) - recommended.rake static
- Build all SFML as static libraries (don't need DLLs).rake graphics
- Build only the graphics module (and its dependencies). You can use any other module (audio
,system
andwindow
) with it. You can also addstatic
.
-
If you built SFML as a shared library, you will need the SFML DLLs in your PATH in order to
require
any of the rbSFML files (this can be accomplished by copying them to the directory where rbSFML is beingrequire
d). -
Run
rake test
to ensure everything is working and thenrake gem
to package rbSFML as a Ruby gem. -
You can build the documentation (at doc/frames.html) with
rake doc
and run the samples withrake samples
.
-
Install Ruby. If your flavor of Linux does not provide a package for this (which is unlikely), you can compile Ruby from source and follow its instructions for installation.
-
You must have a recent build of SFML installed. If your flavor of Linux does not provide a package for this (which is likely), you will need to compile SFML from source and follow its instructions for installation.
-
Ensure that the SFML headers and libraries are in your C++ compiler's search paths. The easiest way is to try compiling and running a simple SFML app.
-
Navigate to a folder where you want to install rbSFML source files.
-
Clone this repository with
git clone git@github.com:Groogy/rbSFML.git
. -
From the rbSFML directory, run one of the following commands in your terminal:
rake
- Build all SFML as shared libraries.rake graphics
- Build only the graphics module (and its dependencies). You can use any other module (audio
,system
andwindow
) with it.
-
Run
rake test
to ensure everything is working and thenrake gem
to package rbSFML as a Ruby gem. -
You can build the documentation (at doc/frames.html) with
rake doc
and run the samples withrake samples
.
Groogy: