# OpenGL Wrapper Bindings

**URL:** <https://www.ruby-forum.com/t/opengl-wrapper-bindings/110565>\
**Category:** Ruby\
**Created:** [July 27, 2007, 3:52pm UTC](https://www.ruby-forum.com/t/opengl-wrapper-bindings/110565 "2007-07-27T15:52:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jazcyk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e56c9b/32.png) [@jazcyk](https://www.ruby-forum.com/u/jazcyk)\
**Post date:** [July 27, 2007, 3:52pm UTC](https://www.ruby-forum.com/t/opengl-wrapper-bindings/110565/1 "2007-07-27T15:52:11Z")

</div>

Hi all,

I’ve been getting some visualisation working using the ruby-opengl  
OpenGL/GLUT wrapper.

One thing that is hampering my progress is not having a mapping from the  
Ruby commands to the GLUT/GL commands, for example:

This code: “GL.Normal(x, y, z)”  
Translates to this GL/GLUT call: “glNormal3f(x, y, z)”

I’m having difficulty finding a list, or rule, for these mappings. This  
means I’m finding it difficult to take some plain C GLUT call, and make  
the same call using the Ruby wrapper, or vice-versa.

For example, “GL.ShadeModel(GL::FLAT)” is a line from a Ruby Opengl  
example, how do I translate this to a native GLUT call to look up the  
documentation?

Or, another example, the GLUT call “glutSolidTetrahedron()”, what is the  
equivalent call for the Ruby wrapper?

Any help much appreciated, thanks for taking the time to read!

- Nex

---

<div class="post-metadata">

**Author:** ![jazcyk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e56c9b/32.png) [@jazcyk](https://www.ruby-forum.com/u/jazcyk)\
**Post date:** [July 27, 2007, 4:32pm UTC](https://www.ruby-forum.com/t/opengl-wrapper-bindings/110565/2 "2007-07-27T16:32:03Z")

</div>

On Fri, Jul 27, 2007 at 10:52:24PM +0900, Peter L. wrote:

> Hi all,
> 
> I’ve been getting some visualisation working using the ruby-opengl  
> OpenGL/GLUT wrapper.
> 
> One thing that is hampering my progress is not having a mapping from the  
> Ruby commands to the GLUT/GL commands, for example:
> 
> This code: “GL.Normal(x, y, z)”  
> Translates to this GL/GLUT call: “glNormal3f(x, y, z)”  
> […]  
> Any help much appreciated, thanks for taking the time to read!

You must be using an old version. The current version provides  
GL.glNormal3f rather than GL.Normal, and so on. An easy way to find a  
method is to run irb (with appropriate -r flags to require the right  
files)  
and something like GL.public\_methods.grep /shademodel/i

> - Nex  
> –Greg

---

<div class="post-metadata">

**Author:** ![jazcyk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e56c9b/32.png) [@jazcyk](https://www.ruby-forum.com/u/jazcyk)\
**Post date:** [July 27, 2007, 4:36pm UTC](https://www.ruby-forum.com/t/opengl-wrapper-bindings/110565/3 "2007-07-27T16:36:04Z")

</div>

Thanks for your help, I’ll try installing again as my version doesn’t  
understand standard type calls like “GL.glNormal3f”.

- Nex
