xargon
02-02-2006, 04:13 AM
Hi everyone,
I am having a strange problem when loading a bitmap as a texture. Some color channels are inverted or changed... Blue looks a weird muddy green etc.
Here is the code, I used to generate the texture. The bitmaps are quite big (1024 X 768).
glGenTextures(1, &m_Texture);
glBindTexture(GL_TEXTURE_2D, m_Texture);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTE R,GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTE R,GL_LINEAR);
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
gluBuild2DMipmaps(GL_TEXTURE_2D, GL_RGB, bitmap.bmWidth, bitmap.bmHeight, GL_RGB, GL_UNSIGNED_BYTE, bitmap.bmBits);
I do not think I have done anything out of the ordinary. Any thoughts?
Cheers,
xargy
I am having a strange problem when loading a bitmap as a texture. Some color channels are inverted or changed... Blue looks a weird muddy green etc.
Here is the code, I used to generate the texture. The bitmaps are quite big (1024 X 768).
glGenTextures(1, &m_Texture);
glBindTexture(GL_TEXTURE_2D, m_Texture);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTE R,GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTE R,GL_LINEAR);
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
gluBuild2DMipmaps(GL_TEXTURE_2D, GL_RGB, bitmap.bmWidth, bitmap.bmHeight, GL_RGB, GL_UNSIGNED_BYTE, bitmap.bmBits);
I do not think I have done anything out of the ordinary. Any thoughts?
Cheers,
xargy