|
|
|
|
||||||
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
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 |
|
Messages: n/a
Hébergeur: |
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 |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
Thanx, I solved the problem by using the sdl library
|
|
![]() |
| Outils de la discussion | |
|
|