FLTK logo

[fltk.general] Re: Loading OpenGL textures from FLTK

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.general  ]
 
Previous Message ]New Message | Reply ]Next Message ]

Re: Loading OpenGL textures from FLTK FOSS Dev Oct 10, 2020  
 
Thank you very much.

Here is the OpenGL texture class which uses FLTK:

On Saturday, October 10, 2020 at 3:46:48 PM UTC+5:30 Manolo wrote:
You can get an Fl_RGB_Image object from a .png file with:
and similarly with .jpeg:
and .bmp:

In all these cases, the resulting Fl_RGB_Image object, supposing you call it img, will tell you
if its RGB (img->d() == 3) or RGBA (img->d() == 4)and its width (img->w()) and height (img->h()).
In some cases, the row length is bigger than img->w()*img->d(). In that case img->ld() is != 0
and gives that length. Finally, you get the address of the first byte of the RGB or RGBA data
by img->array of type const unsigned char *. That should put you in the position to build a texture.

--
You received this message because you are subscribed to the Google Groups "fltk.general" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkgeneral+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkgeneral/79febdd4-4f51-4fe7-b822-0a3f075fe0c5n%40googlegroups.com.
Direct Link to Message ]
 
     
Previous Message ]New Message | Reply ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.