PCX texture image mapping backwards
Hi all,
I have a strange quirk. I am trying to load a PCX image and map it to a cube. I am using Nehe lesson 6 (mapping a bitmap to a cube) but replacing the LoadBMP() call with LoadPCXTexture() from the OpenGL Game Programming book (typed in by hand so may have typo).
The strange thing is that the PCX image is mapping onto the cube backwards (not upside down, just backwards). I have tryed following the decoding of the PCX and that all looks okay. Anybody got any ideas?
My modified code looks like this:
texture_t *TextureImage[1];
memset(TextureImage,0,sizeof(void *)*1
if(TextureImage[0]=LoadPCXTexture("Data/ctf_r.pcx"))
{
Status=TRUE;
glGenTextures(1, &texture[0]);
glBindTexture(GL_TEXTURE_2D, texture[0]);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, TextureImage[0]->scaledWidth, TextureImage[0]->scaledHeight, 0, GL_RGBA, GL_UNSIGNED_BYTE, TextureImage[0]->data);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
}
Thanks
Will
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement