|
|
> Hi guys,
>
>
> I was wondering if it is possible for FLTK to load png images in a format that can be used for OPENGL texture maps. Cos i know FLTK has this Fl_PNG_IMAGE class that is able to load png file. THx
>
>
>
Never done it, but it looks like you can get the image buffer from:
GLvoid *pixels = png_image->data();
and check the format using:
GLenum format;
switch(png_image->d())
{
case 4: format = GL_RGBA; break;
case 3: format = GL_RGB; break;
default: foramt = -1; /* not sure */
}
use the above values in a call to glTexImage2D()
Don.
[ Direct Link to Message ] | |
|
| |