From: Bill Kelly Date: 2006-07-09T14:21:37+09:00 Subject: Re: [ANN] ruby-opengl From: "John Gabriele" > On 7/7/06, Bill Kelly wrote: >> From: "John Gabriele" >> > >> > I'm not trying to be the new maintainer of ruby-opengl per se. >> >> Rats. Because I really liked the web site. :) >> > > Well then, I'll have to see what I can do: > http://www.simisen.com/cgi-bin/jmg/ruby-opengl.rb > > I reverted my changes to the method names, so it's back to being > "ruby-opengl". Please take a 2nd look. Awesome! Much appreciated... It's a weight off my mind to not have to worry about the API changing. BTW, here's one possible way to define the prefixed methods and constants, if you prefer to work with them that way. You could require a file that does something like the following: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ require 'opengl' class Object (GL.methods - Object.methods).each do |m| define_method("gl#{m}") {|*args| GL.send(m, *args)} end (GLU.methods - Object.methods).each do |m| define_method("glu#{m}") {|*args| GLU.send(m, *args)} end end GL.constants.each do |c| Object.const_set("GL_#{c}", GL.const_get(c)) end GLU.constants.each do |c| Object.const_set("GLU_#{c}", GLU.const_get(c)) end ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This should import the GL and GLU methods and constants into the global namespace, using their traditional prefixed nomenclature. (Note: Only lightly tested... but I think it works.. :) Regards, Bill