uwi2k2
12-30-2011, 06:21 AM
Hi there,
for 2 days i am trying to get a texture with aplha channel loaded, but i am not familiar enough with file formats to get it done.
i tryed .raw, .bmp, .png but could never get my load_img() function work right.
The best i could get was a whith spot where transparency should be... but i guess its because the .raw format does not support alpha channes ...
http://www.apoon.de/xmas/game.jpg
i know there are libs out there that offer easy load of texture, but i wanne understand it...
has anyone a example code that loads a .png file and uses alpha channes ... so i can use:
glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, png_data);
thanx a lot
uwi2k2
for 2 days i am trying to get a texture with aplha channel loaded, but i am not familiar enough with file formats to get it done.
i tryed .raw, .bmp, .png but could never get my load_img() function work right.
The best i could get was a whith spot where transparency should be... but i guess its because the .raw format does not support alpha channes ...
http://www.apoon.de/xmas/game.jpg
i know there are libs out there that offer easy load of texture, but i wanne understand it...
has anyone a example code that loads a .png file and uses alpha channes ... so i can use:
glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, png_data);
thanx a lot
uwi2k2