[ruby-opengl-devel] ruby-opengl and RMagick
Gregory Seidman
gsslist+rgl at anthropohedron.net
Sun Oct 14 19:07:40 EDT 2007
On Sun, Oct 14, 2007 at 06:50:29PM -0400, Cassius Rosenthal wrote:
> Hello all,
>
> I am interested in using opengl to resize images. I have ruby-opengl
> running, and in irb I'm trying to pass an RMagick image to
> GL.TexImage2D, but I get a type error. The roadmap page on the web site
> says, "Add image handling wrapper for easy image handling." Obviously
> that hasn't been implemented yet, but I am encouraged that I'm not the
> only one interested in functionality like that.
>
> irb> GL.TexImage2D( GL::TEXTURE_2D, 0, 3, 150, 150, 0, GL::RGB,
> GL::BYTE, @image)
> TypeError: type mismatch:#<Class:0x2aaaaf9810a0>
> from (irb):27:in `TexImage2D'
> from (irb):27
>
> Any hints on how to pass an instance of an RMagick image to GL? Has
> anybody done anything similar?
Take a look at my solution to Ruby Quiz #129:
http://rubyquiz.com/hosted_solutions/129/gregory/129.zip
It has code that uses RMagick to generate an image that is then used as a
texture map.
> Thanks!
> -Casey
--Greg
More information about the ruby-opengl-devel
mailing list