From: "David" <abcdefg@...>
>> > I've written Haskell bindings for OpenGL, GLUT, OpenAL and ALUT, and I
>> > think a good advice for any binding is: Don't fight the original
>> > intention and design of the library being wrapped. All four mentioned
>> > libraries have a very strong notion of implicit state (current rendering
>> > context, current window, etc.), and at least for OpenGL there is a *very*
>> > good reason for this (context switches are extremely expensive). The
>> > other libraries follow OpenGL's design, and I think so should every
>> > binding...
> The design of this binding is that one part provides three modules GL, GLU and
> GLUT, this are non-object-oriented modules that have the same functions that
> opengl and glut have. Except that the syntax is different and some postfixes
> that opengl functions have aren't here. For instance
> GLUT.init_window_size(200, 200)
> Note that this was already written by Yoshi except that the syntax was still
> very c like and I've changed this to be more ruby like.
> The other part is a object oriented layer that uses the three modules
> described above. So it currenly is and always will be possible to use low
> level functions.
> I must admid I haven't thinked about performance much yet. I will focus on
> making the low level binding and functions more complete and add some
> functions to speed up programmingen but don't decrease performance. On a
> later stage I will think if it is smart to continue with the OO layer.
Nice to see another Ruby user using freeglut! I'm interested in how
your bindings turn out.
By the way, I'm already using freeglut with Ruby, using Yoshi's GLUT
On top of Yoshi's bindings, I've implemented a simple GLUTWindow class,
GLUT.InitDisplayMode(GLUT::DOUBLE | GLUT::RGB)
main1 = GLUTWindow.new(100, 100, 800, 600, "foobar")
m1s1 = main1.new_child(10, 10, 320, 240, "foobar child1")
m1s2 = main1.new_child(400, 10, 320, 240, "foobar child2")
main2 = GLUTWindow.new(100, 100, 800, 600, "xyzzy")
m2s1 = main2.new_child(10, 10, 320, 240, "xyzzy child1")
m2s2 = main2.new_child(400, 10, 320, 240, "xyzzy child2")
Because multiple windows are important to my application.
(Other than that, I'm pure OpenGL.)