Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I am the author of ruby-sdl-ffi. This question was brought to my attention today, so I am answering for the benefit of anyone who is still curious.</p> <p>The main difference is that ruby-sdl-ffi is pure Ruby code that accesses SDL (and related libraries) via FFI (foreign function interface), whereas rubysdl is an extension written in C that links to SDL (and related libraries). There are pros and cons to each approach. (Obviously, I feel that FFI is the better approach, or I would not have bothered to write ruby-sdl-ffi.)</p> <p>Both libraries offer similar feature sets, although there are some differences (noted below). They can both do 2D games with images, sounds/music, and user input from keyboard, mouse, and/or joystick/gamepad. They can also both be used with OpenGL (via ruby-opengl or ffi-opengl) to create hardware-accelerated 3D games. They can both be used on Windows, MacOS X, and Linux (and perhaps other platforms), although rubysdl only works on MacOS X if you use a special Ruby interpreter wrapper called "rsdl".</p> <p>I have not run any serious benchmarks, so I can't provide any definitive data about raw performance. My general impression is that rubysdl might have a slight performance advantage, but they are close enough that performance isn't the main factor when deciding between the two libraries.</p> <p>Here is how I would summarize the pros and cons of the two libraries:</p> <p><strong>ruby-sdl-ffi</strong></p> <ul> <li>Easier for users to install the gem. It does not need to be compiled, so users don't need to install a C compiler or toolchain.</li> <li>Works with MRI (the "usual" Ruby interpreter), JRuby, and probably Rubinius.</li> <li>No special interpreter is required on MacOS X. However, the MacOS X support may need to be updated to get it working totally right on the latest versions of MacOS X. (Apple keeps changing things.)</li> <li>Lower-level API, more closely mirrors the C libraries. This may be good or bad depending on your perspective.</li> <li>Currently has bindings for SDL, SDL_gfx, SDL_image, SDL_mixer, and SDL_ttf libraries. (Compared to rubysdl, it adds SDL_gfx but lacks SGE and SMPEG.) Adding bindings for other libraries is quite easy.</li> <li>Not actively developed or maintained anymore. I don't have the time or interest anymore, but someone is welcome to take over, and I can provide guidance.</li> <li>Somewhat experimental, and has some rough edges.</li> </ul> <p><strong>rubysdl</strong></p> <ul> <li>More mature and polished, has withstood the test of time.</li> <li>Better support for Japanese text input and rendering.</li> <li>Higher-level, more abstract API.</li> <li>Binds SDL, SGE, SMPEG, SDL_image, SDL_mixer, and SDL_ttf libraries.</li> <li>Requires users to have a C compiler to install the gem. This can be quite a headache on Windows and MacOS X.</li> <li>Requires MacOS X users to run your game using the special "rsdl" Ruby interpreter. Thus, to my knowledge, it will not work with JRuby or Rubinius on MacOS X.</li> <li>Does not seem to be actively developed or maintained anymore either.</li> </ul>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload