|
Loading Multiple Textures!!!!!!
Thnx 4 that, but it still doesn''t work... The original code (changed by u) now reads...
hehe funny thing, i went over to NeHe
heres a snipet from Lesson 17
glGenTextures(2, &texture[0]); // Create Two Texture
"Another important line to double check. I can''t begin to tell you how many emails I''ve received from people asking "why am I only seeing one texture, or why are my textures all white!?!". Usually this line is the problem. If you were to replace the 2 with a 1, only one texture would be created and the second texture would appear all white. If you replaced the 2 with a 3 you''re program may crash!
"
heres a snipet from Lesson 17
glGenTextures(2, &texture[0]); // Create Two Texture
"Another important line to double check. I can''t begin to tell you how many emails I''ve received from people asking "why am I only seeing one texture, or why are my textures all white!?!". Usually this line is the problem. If you were to replace the 2 with a 1, only one texture would be created and the second texture would appear all white. If you replaced the 2 with a 3 you''re program may crash!
"
Romance is dead,it was bougth by Disney and Hallmark and sold to the public in small portions.
November 30, 2001 03:55 PM
this line:
Image1 = auxDIBImageLoad("D:/My Documents/SIMON/PROGRAMMING/C++/Textures/BackGround.bmp");
goes before:
glGenTextures(2,&Textures[0]);
Image1 = auxDIBImageLoad("D:/My Documents/SIMON/PROGRAMMING/C++/Textures/BackGround.bmp");
goes before:
glGenTextures(2,&Textures[0]);
this line:
Image1 = auxDIBImageLoad("D:/My Documents/SIMON/PROGRAMMING/C++/Textures/BackGround.bmp");
goes before:
glGenTextures(2,&Textures[0]);
Edited by - Load Runner on November 30, 2001 4:59:33 PM
Edited by - Load Runner on November 30, 2001 5:00:30 PM
Edited by - Load Runner on November 30, 2001 5:03:24 PM
Image1 = auxDIBImageLoad("D:/My Documents/SIMON/PROGRAMMING/C++/Textures/BackGround.bmp");
goes before:
glGenTextures(2,&Textures[0]);
|
Edited by - Load Runner on November 30, 2001 4:59:33 PM
Edited by - Load Runner on November 30, 2001 5:00:30 PM
Edited by - Load Runner on November 30, 2001 5:03:24 PM
Romance is dead,it was bougth by Disney and Hallmark and sold to the public in small portions.
Afraid that doesn''t work either! I''ve had this problem with 3 different re-writes of the texture code 4 my program... Thanks all 4 any help... Sy
...okay I will replace my whole code without error I hope...at home It works!!
GLuint name[2];
AUX_RGBImageRec *texture[2];
glGenTextures(2,name);
texture[0]=auxDIBImageLoad("blablabla.bmp");
texture[1]=auxDIBImageLoad("xxxx.bmp");
for (int j=0;j<=1;j++) {
glBindTexture(GL_TEXTURE_2D,name[j]);
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
glTexImage2D(GL_TEXTURE_2D, 0, 3, texture[j]->sizeX, texture[j]->sizeY, 0, GL_RGB, GL_UNSIGNED_BYTE, texture[j]->data);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);
}
Edited by - Major on November 30, 2001 5:20:36 PM
GLuint name[2];
AUX_RGBImageRec *texture[2];
glGenTextures(2,name);
texture[0]=auxDIBImageLoad("blablabla.bmp");
texture[1]=auxDIBImageLoad("xxxx.bmp");
for (int j=0;j<=1;j++) {
glBindTexture(GL_TEXTURE_2D,name[j]);
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
glTexImage2D(GL_TEXTURE_2D, 0, 3, texture[j]->sizeX, texture[j]->sizeY, 0, GL_RGB, GL_UNSIGNED_BYTE, texture[j]->data);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);
}
Edited by - Major on November 30, 2001 5:20:36 PM
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement