Jump to content

  • Log In with Google      Sign In   
  • Create Account

any reason this won't work?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 GOOSEDUMP   Members   -  Reputation: 122

Like
Likes
Like

Posted 30 July 2001 - 09:52 PM

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 }

Sponsor:

#2 GOOSEDUMP   Members   -  Reputation: 122

Like
Likes
Like

Posted 30 July 2001 - 10:21 PM

how silly, I figured it out...
texture[2]




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS