for(GLuint i=0; iimageData; // Temporarily Store The Value At Image Data ''i''
texture->imageData = texture->imageData; // Set The 1st Byte To The Value Of The 3rd Byte
texture->imageData = temp; // Set The 3rd Byte To The Value In ''temp'' (1st Byte Value)
}
</pre>
If I wanted to be able to put the any black pixel with an alpha value of 0.0f and all other with an alpha value of 1.0f I guess I would have to modify this particular piece of code.
How can I check the value for the colors is it something like :
( pseudo-code )
if
texture->imageData != 0.0f &&
texture->imageData[i+1] != 0.0f &&
texture->imageData[i+2] != 0.0f
then
texture->imageData[i+3] = 0.0f
else
texture->imageData[i+3] = 1.0f
or :
if
texture->imageData = 0 &&
texture->imageData[i+1] = 0 &&
texture->imageData[i+2] = 0
then
texture->imageData[i+3] = 0
else
texture->imageData[i+3] = 1
Or maybe Im wrong and I should do some other thing at some other place ? And how can I know what system is used for color representation ? int, floats, gl, standard ? </i> </pre>
NeHe's TGA loading code
I don''t know if anyone here is familiar with NeHe''s tga loading code, but ill include a small sample about the section ill be refereing to :
WHO DO THEYTHINK THEY'REFOOLING : YOU ?
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement