[ruby-opengl-devel] Re : Requirements and Design

John Gabriele jmg3000 at gmail.com
Sat Sep 2 04:41:44 EDT 2006

On 9/2/06, minh thu <noteed at gmail.com> wrote:
> > [...]
> > >  Further, I'm also warming up to the
> > > idea of having the module names first-letter-only-capitalized:
> >
> >   I'm not worrying about the "Gl" vs "GL" issue right now.  That's a
> > ten second fix in the code, and a simple query replace in the ruby
> > scripts if we get it wrong.  I have a preference for doing it the ruby
> > way, unless there is a compelling reason not to, so I'd lean toward
> > "Gl".
> My idea is that I'm likely to make mistake in a two letter name which
> has upper and lower case.. I find it more readable in only one case.

Note, if your editor does syntax highlighting, it should be pretty
readable. For example, Emacs colors the "Gl" a different color than
the ".glFooBar".

> Anyway, if the ruby way is to have 'Gl', I'm fine with it. (but it's
> against the C closeness we wanted)

Well, the way we achieve that API similarity is when the user does
that `include` statement at the top. When they do that, they no longer
need the "Gl" prefixing everything anyway. :)

> But ... I thought that 'somewhat standard' libs have lowercase name,
> am I wrong ?
> (I agree this is a very litte issue :)

The filenames of the modules are lowercase. The module names inside
those files Are Written Like This (first letter is capitalized).

Directory names could go either way, but using the "GL" for that seems
kinda' reminiscent of

#include <GL/gl.h>
#include <GL/glu.h>

to me.

> >
> > > * Regarding tracking of different versions of GL and GLUT, 0.32pre2
> > > already has Yoshi's conditional stuff in it for older versions. Anyone
> > > know how difficult it would be with SWIG to get it to do the same sort
> > > of thing?
> > >
> > > Peter -- have you formed an opinion on the SWIG issue yet?
> >
> >   My only reluctance in doing it by hand is the tedium of ensuring we
> > get it *all* done.  I guess in either case, we'll want a test suite
> > that excercises all of the functions.  I imagine a quick script to
> > read gl.h and spit out some c-stubs might be in order.  I'm ok going
> > with the non-swig.
> >
> There is the same question about ruby versions... for this issue, swig
> has a lot of conditionals in its generated code.

I'm not sure what you're saying here. Looking at gl_wrap.c, I don't
see anything in there about conditional compilation based on differing
versions of OpenGL.

I *do* see such conditional compilation happening in the 0.34pre2
ogl.c though. Seems simple enough there.

> I'm trying the non-swig and non-manual, i.e. the script, way. It seems
> promising to me and could be reused to write test code. I hope to have
> something concrete to show by the end of the day; anyway I will commit
> it tonigth (if I my connection doesn't get down like yesterday :).

No need to commit that script unless we decide to alter the repository
to contain 0.34pre2. You might mail it to the list though, just to
give us an idea of what you've got. My guess is that there's all sorts
of ways we could make Ruby munge OpenGL headers for us to make our job
easier. :)

Peter and Thu: if you've got confidence we can drop swig and do
ruby-opengl bare-handed frontier-style (*snicker* :) ) without too
much trouble, let me know (and back up your sandboxes, just in case)
and I'll totally replace the contents of the relevant .c and .rb files
in trunk/ext/{gl,glut} using what we've got in 0.34pre2. Also, I'll
leave the rakefiles, but get rid of the .i files.

What we'll be left with then will be broken, but we'll cobble it
together over the next 2 days so as to at least have a
HelloWorldRubyOpenGL sample program running before Peter leaves on


More information about the ruby-opengl-devel mailing list