tga loading and transparency
Hi
I''ve got a problem with tga files.
My code is heavyly based on the tutorial concerning loading of compressed and uncompressed tga files.
That works perfectly but I want them to be transparent for sprites.
So i enabled the Alphatest - I thought than the transparency from the file is used but that didn''t work.
I use the following code and it seems to work flawlessly (type is GL_RGBA) but without transparency.
Are there other things to change/include?
glGenTextures(1, &_mytextures[filename].texID);
glBindTexture(GL_TEXTURE_2D, _mytextures[filename].texID);
gluBuild2DMipmaps(GL_TEXTURE_2D,3,_mytextures[filename].width, _mytextures[filename].height, _mytextures[filename].type, GL_UNSIGNED_BYTE, _mytextures[filename].imageData);
I havent used gluBuild2DMipmaps for a long time but I belive 2nd parametr should be 4 not 3 (GL_RGBA -> 4 components). Otherwise go to www.opengl.org and read gluBuild2DMipmaps spec.
You should never let your fears become the boundaries of your dreams.
You should never let your fears become the boundaries of your dreams.
You should never let your fears become the boundaries of your dreams.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement