[ruby-opengl-devel] Re : about gl_untyped.i

John Gabriele jmg3000 at gmail.com
Tue Aug 29 16:36:04 EDT 2006

On 8/29/06, minh thu <noteed at gmail.com> wrote:
> 2006/8/29, Robert Krimen <grin.k1tt3n at gmail.com>:
> > So would super_rubyish_opengl be the package where we define the
> > glVertex call that can
> > accept a Vector object?
> yep, that's the idea (although, i should have chosen another module name :)
> thu

There will be a couple of different ways to use ruby-opengl, and I'm
sure we want to keep it as simple as possible.

At this point, two possible (but onerous) usages are either:

require 'GL'
require 'GLU'
require 'GLUT'

GL.glFooBar( GL::GL_FOO_BAR )
GL.gluFooBar( GLU::GLU_FOO_BAR )

or else this:

include GL
include GLU
include GLUT

require 'GL'
require 'GLU'
require 'GLUT'

glFooBar( GL_FOO_BAR )
gluFooBar( GLU_FOO_BAR )
glutFooBar( GLUT_FOO_BAR )

Since both of those have a lot of require's and include's to type, I'm
guessing that we'll very soon add two convenience modules to the lib
directory, so that you can simply do:

require 'opengl'    # This is our "super_rubyish_opengl".
glFooBar( GL_FOO_BAR )
gluFooBar( GLU_FOO_BAR )

or else, if you're using GLUT too:

require 'glut'    # A 2nd "super_rubyish_opengl".
glFooBar( GL_FOO_BAR )
gluFooBar( GLU_FOO_BAR )
glutFooBar( GLUT_FOO_BAR )

If you are running older code that uses the previous ruby-opengl names
(written for Yoshi's ruby-opengl), then the idea is to be able to have
code like this:

require 'glut_prev'
GL.FooBar( GL::FOO_BAR )

I'm not too interested in trying to add our own Vector class, and
modifying glVertex to accept it as an arg. My guess is that there are
already a number of good math-oriented modules out there, and I don't
want to reinvent the wheel, nor to select one as "the one". If the
users want this functionality, they can bind their favorite math
module to ruby-opengl as they see fit and we'll be happy to put a link
to their module on our site. :)


More information about the ruby-opengl-devel mailing list