[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

How to load a Texture in Ruby-Opengl

onionblossom

6/19/2008 6:38:00 PM

Hi,

I don't get it working in Ruby. I try to load a texture which works
pretty easy in other languages like c++ and there are plenty of
examples in other languages but none for Ruby.

The file could be any format but I like to keep it simple: ppm or raw.
Can anyone give me a hint or a snippet how to do it?

thanx ahead
2 Answers

Jan Dvorak

6/20/2008 11:52:00 AM

0

On Thursday 19 June 2008 20:38:40 onionblossom@gmail.com wrote:
> Hi,
>
> I don't get it working in Ruby. I try to load a texture which works
> pretty easy in other languages like c++ and there are plenty of
> examples in other languages but none for Ruby.
>
> The file could be any format but I like to keep it simple: ppm or raw.
> Can anyone give me a hint or a snippet how to do it?

It works the same way as in C or other languages, you need library (like
RMagick/ImageMagick,SDL_image etc.) that decodes the image format to raw
pixel data in memory (in ruby it's represented as string), then pass it to
the opengl functions (glTexImage*).

Jan



onionblossom

6/23/2008 2:13:00 PM

0

Thanx, I solved the problem by using the sdl library