(Fork of ruby-glfw — original repository died.) GLFW bindings for Ruby based on that other ruby-glfw because its maintainer disappeared/died/became a philosopher. NOTE: This project is defunct and will not be maintained or updated from this fork. Use GLFW3 instead.
C D Ruby Objective-C Shell Pascal
Switch branches/tags
Nothing to show
Failed to load latest commit information.
examples Fixing the examples. Mar 3, 2012
.gitignore Adding ignores for glfw binaries Mar 3, 2012
COPYING Added license to both COPYING & README Mar 3, 2012



What is ruby-glfw?

ruby-glfw contains Ruby bindings for the GLFW library. This currently includes the GLFW 2.7.3 source code in the package. This particular fork is my attempt to fix some build issues in ruby-glfw, and is based on the old ruby-glfw gem (unmaintained since 2008-ish) by Jan Dvorak.

What's GLFW?

A convenient quote from glfw.org:

GLFW is a free, Open Source, multi-platform library for opening a window, creating an OpenGL context and managing input. It is easy to integrate into existing applications and does not lay claim to the main loop.

Yeah, that about sums it up. It handles the things that aren't exciting so you can write the cool stuff.

What platforms are supported?

Though the original ruby-glfw gem claimed support for the three major OSes, Linux, Windows, and OS X, I cannot say the same since I haven't tested my fork on anything other than OS X.

So, OS X is the only supported platform. If you do test this on another OS, do let me know.

Because you might be looking for a list and skipping what I wrote above:

  • OS X: Works
  • Windows: Untested
  • Any variety of Linux: Untested
  • Obscure OSes only three people use: Untested


I am only using ruby-glfw under Ruby 1.9.3, so it will probably work under 1.9.x, but consider yourself warned. Chances are nothing in use requires 1.9 and up, however, and ruby-glfw originally supported 1.8.5, so just give it a shot if you're still on 1.8.5 or higher.

Run rake package and install the gem (under pkg/) and you should be fine.

$ rake package
$ cd pkg
$ sudo gem install ruby-glfw-0.9.2.gem

Substitute 0.9.2 for whatever version number you've packages, of course.

Support Notes

Some additional notes from Jan Dvorak's HTML readme thing that accompanied ruby-glfw (why it was an HTML file is beyond me), most of which I've edited for some correctness:

  • Windows notes: Originally, ruby-glfw required MSVC 6.0 -- shame on Jan for this. You need MinGW to build from this particular fork of ruby-glfw. I don't know if it works, but requiring MSVC 6.0 is cruel and unusual.

    There was also a binary gem available, this is still true for the old gem. I take no responsibility for whether that works.

  • Mac OS X notes: You may need a version of Ruby from someplace other than Apple, though this is not required under Mac OS 10.7 (Lion). Consider using rbenv and ruby-build to handle this cleanly. Avoid RVM if you can help it -- RVM wreaks havoc on your shell.

  • Linux notes: On some distributions you may need aditional development packages, like xorg-dev or ruby1.8-dev.


ruby-glfw is licensed under the zlib/libpng license, same as GLFW:

Copyright (C) 2009 Jan Dvorak <jan.dvorak@kraxnet.cz>

This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:

 1. The origin of this software must not be misrepresented; you must not
    claim that you wrote the original software. If you use this software
    in a product, an acknowledgment in the product documentation would be
    appreciated but is not required.

 2. Altered source versions must be plainly marked as such, and must not be
    misrepresented as being the original software.

 3. This notice may not be removed or altered from any source distribution.

I (Noel Cower) don't really associate myself with the copyright, since I just consider myself the jerk who updates things. This is Jan's work, I'm just making sure I can use it.