How to start OpenGL programming with Ruby?

Hi,

I’m new to OpenGL and I was wondering where I should start learning to program OpenGL.
I wanted to use Ruby to do so and I’ve gotten OpenGL to work with Ruby by installing the gems (there are still some errors trying to execute some of the examples which came with the gem).
But now I’m stuck with OpenGL. Where should I start learning? Are there any good books I should read?

All help is appreciated!

No one? :slight_smile:

This is not exactly a vibrant community of Ruby programmers. You would be more likely to find an answer by asking on a Ruby forum.

Hmm, I thought coding OpenGL in Ruby wouldn’t be that different from coding it with C++. I’m going through the basic NeHe tutorials with the Ruby code for the examples and they seem quite similar…

If you’re looking for general information about getting started with OpenGL, you should look at the OpenGL Wiki.

Hi,
9 years ago I did some Ruby Opengl and liked it. Digging out my old code I find that it begins with:

require ‘matrix’
require ‘opengl’
require ‘glut’

and the bottom of the code, called at the start as I’ve put procedures I’ve written above that, is

GLUT.Init
GLUT.InitDisplayMode( GLUT::SINGLE | GLUT::RGB )
GLUT.InitWindowSize( 1000, 700 )
GLUT.InitWindowPosition( 0, 0 )
GLUT.CreateWindow( “Ants” )
init()
GLUT.DisplayFunc( display )
GLUT.MainLoop()

where the “display” function that is passed by DisplayFunc() starts out as

display = Proc.new { # CALLED WHEN DISPLAY CHANGES FOR GRAPHICAL OUTPUT

GL.Clear( GL::COLOR_BUFFER_BIT )
GL.Color( 1.0, 1.0, 1.0 )

So that’s a framework of code that worked a long time ago in a galaxy far, far away…sorry I don’t remember what dlls I put where (and maybe freeglut has eclipsed the use of glut) but there should be intro sites that cover those basics.
Good luck,
Stig

Hi, your code should work yeah (if gotten further in Ruby-OpenGL). I know what to do now but have some more specific OpenGL questions so I’ll probably make a new thread.

The wiki doesn’t seem to hold that much documentation on OpenGL functions…

Thanks for the replies.

The wiki doesn’t seem to hold that much documentation on OpenGL functions.

Are you sure? The only undocumented functions are those intentionally undocumented: the ones from the compatibility profile.

Oh, guess I may have written it off too soon because I couldn’t find anything on Quadrics…
I’ll post what I’m trying to make in another thread :slight_smile: