Ruby-SDL-FFI 0.3 is now available. The biggest change is that Ruby-SDL-FFI apps (and Rubygame apps) can now run on Mac OS X with no special interpreter. In the past, Mac users had to run apps a special Ruby interpreter called RSDL. Now, this is no longer necessary — Mac users can now use the standard Ruby interpreter, even JRuby. (Eternal thanks to erisdiscord and jlnr for their advice and tips!)
This solution has only been tested on Mac OS X 10.5 (Leopard) on an Intel Mac. If you try it on a different setup, please leave a comment to let me know whether it works or not.
- Ruby-SDL-FFI can now work on Mac OS X without the need for a special interpreter (i.e. rsdl). If this causes issues for you, you can disable it by setting the
RUBYSDLFFI_NOCOCOAenvironment variable to "
- Added the SDL::set_app_name() method. This sets the application name in a platform-appropriate way, or does nothing if the platform is not supported. On Mac OS X, it changes the text in the menu bar. Support for other platforms may be added in the future.
- Ruby-SDL-FFI now reads the
RUBYSDLFFI_PATHenvironment variable for additional library load paths. It should be a colon-separated (Linux/Mac) or semicolon-separated (Windows) list of directories to search for libraries
- The SDL::Palette class is now Enumerable. You can iterate over it with #each, #collect, etc. You can also read a specific index using #at (but not #, which is reserved for struct access)
- SDL.GL_GetAttribute() now returns an integer, like it should. Before, it would return an FFI::Buffer.
- SDL.GetKeyRepeat() is now easier to use. It returns an Array of two integers: [delay, interval]. Before, you had to pass two output buffers, then extract the integers afterwards.
- Fixed a NoMethodError in SDL.WaitEvent().
- Ruby-SDL-FFI now uses FFI::Buffer instead of FFI::MemoryPointer in many places. This should give a slight performance boost on JRuby, and potentially other platforms.
The easiest way to install Ruby-SDL-FFI is with
gem install ruby-sdl-ffi. (If you want to use Ruby-SDL-FFI or Rubygame on JRuby, you should install the ffi stub gem first.) Gem and source tarballs are also available, and you can get the source from Github too: