[ruby-opengl-devel] Fix to get it working on my system:

peter mclain peter.mclain at gmail.com
Wed Aug 30 20:23:13 EDT 2006


> > on my linux box (kubuntu), the glut implementation is freeglut, what's on yours ?
> > what other implementations are there in the linux world ?
> >
> > i ask this because I have to change the %include <GL/glut.h> in glut.i.

  It seems that the %include <GL/glut.h> works on systems where glut.h
has real stuff in it, but does not work on systems where glut.h simply
#includes "someother_glut.h", i.e., freeglut.  My guess is that swig
is only doing a direct include of glut.h, and not processing any
deeper #includes, i.e., the swig pre-processor ends up giving the swig
processor essentially nothing to work with, because the swig
pre-processor doesn't bother to read in "someother_glut.h".  All the
stuf in the resluting glut_wrap.c is just the boiler plate pre-amble
that swig spits out for all runs.

  Assuming the diagnosis is correct, there seem to be a couple of approaches:

  1: Try to convince swig to recurse down the #include path.  Swig has
a -includeall option that might prove useful.  The danger here is that
we might include too many things for swig to digest.

  2: Try to detect freeglut in the extconf.rb (or somewhere) and set
-DHAVE_FREEGLUT, then in the gl.i file, conditionally inlcude
freeglut_std.h instead of <GL/glut.h>.

  I do not have access to a system that exhibits the problem, so I
would appreciate if one of you would volunteer to find a solution to
the  problem and post it.  Thanks,

-- 
Peter McLain
peter.mclain at gmail.com


More information about the ruby-opengl-devel mailing list