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

John Gabriele jmg3000 at gmail.com
Tue Aug 29 17:17:20 EDT 2006


On 8/29/06, John Gabriele <jmg3000 at gmail.com> wrote:
> 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 )
> GL.glutFooBar( GLUT::GLUT_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 )

Gah. Whoops. Should've written the requires before the includes. Also
note that there's no "GLU" yet.

> 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 )

Whoops. I guess that would probably be:

require 'opengl'    # This is our "super_rubyish_opengl".
include 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 )

And that would probably instead be:

require 'opengl'
require 'glut'
include OpenGL
include Glut

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

Peter, do you see any name conflicts happening with this scheme (i.e.
A pure Ruby module named Glut in a file named glut.rb along with what
we currently have (GLUT.so))?

---John


More information about the ruby-opengl-devel mailing list