# Running OpenGL on Mac OS X

**URL:** <https://rubytalk.org/t/running-opengl-on-mac-os-x/5804>\
**Category:** ruby-talk\
**Created:** [28 April 2003 14:42 UTC](https://rubytalk.org/t/running-opengl-on-mac-os-x/5804 "2003-04-28T14:42:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![James\_Adam2](https://yyz1.discourse-cdn.com/flex029/user_avatar/rubytalk.org/james_adam2/32/1989_2.png) [@James\_Adam2](https://rubytalk.org/u/James_Adam2)\
**Post date:** [28 April 2003 14:42 UTC](https://rubytalk.org/t/running-opengl-on-mac-os-x/5804/1 "2003-04-28T14:42:01Z")

</div>

I couldn’t see any info describing this process on the web, so i’m  
posting it here, feel free to copy it into any wikis or how-tos or  
anything.

You’ll need X11 installed (I’ve used the apple packages, make sure you  
install the user & SDK packages), plus the ‘glut’ package from fink  
([http://www.fink.sourceforge.net](http://www.fink.sourceforge.net)). I’m also assuming that fink puts  
its files into /sw (that’s the default). Download the opengl package  
from the RAA and extract it.

1. run ‘ruby extconf.rb’ to generate the makefiles

2. edit Makefile.glut:

3. edit Makefule.ogl:

4. run ‘make’ - it should now compile fine, you’ll get some parse  
errors probably, and something about glutKeyboard that always seems to  
appear - don’t worry about it.

5. run ‘sudo make install’ to install the library

You should now be able to run the samples. Don’t forget to either run  
ruby from the X11 xterm, or have X11 running and your DISPLAY variable  
setup in the Mac OS Terminal (i.e. ’ setenv DISPLAY “:0.0” ')

More on how to integrate this with FXRuby as i figure it out.

[Background info: I’m running 10.2.3, DevTools from Dec 2002, Fink  
installed into /sw, rbogl-0.32b.tgz, ruby 1.6.8 (stable) compiled from  
source]
