Archived

This topic is now archived and is closed to further replies.

GOOSEDUMP

any reason this won't work?

Recommended Posts

I am using code from NEHE and I was trying to load in 2 peices of textures but it seems like texture[0] and texture[1] are the SAME THING!!!! kinda wierd.. wonder if I''m doing anything wrong... help would be appreciated... int cDisplayOpenGl::LoadGLTextures() // Load Bitmaps And Convert To Textures { int Status=FALSE; // Status Indicator AUX_RGBImageRec *TextureImage[2]; // Create Storage Space For The Texture memset(TextureImage,0,sizeof(void *)*1); // Set The Pointer To NULL // Load The Bitmap, Check For Errors, If Bitmap''s Not Found Quit Status=TRUE; // Set The Status To TRUE glGenTextures(2, texture); // Create The Texture TextureImage[0]=LoadBMP("test2.bmp"); // Typical Texture Generation Using Data From The Bitmap glBindTexture(GL_TEXTURE_2D, texture[0]); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR); glTexImage2D(GL_TEXTURE_2D, 0, 3, TextureImage[0]->sizeX, TextureImage[0]->sizeY, 0, GL_RGB, GL_UNSIGNED_BYTE, TextureImage[0]->data); free(TextureImage[0]); TextureImage[1]=LoadBMP("test.bmp"); // Typical Texture Generation Using Data From The Bitmap glBindTexture(GL_TEXTURE_2D, texture[1]); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR); glTexImage2D(GL_TEXTURE_2D, 0, 3, TextureImage[1]->sizeX, TextureImage[1]->sizeY, 0, GL_RGB, GL_UNSIGNED_BYTE, TextureImage[1]->data); free(TextureImage[1]); return Status; // Return The Status }

Share this post


Link to post
Share on other sites