Hi,
i am very new to opengl, so i guess that what i am going to ask is pretty basic.
I am using Visual Studio 2008 .net. I am trying to load a texture using glaux, everithing works fine, i was able to load the textures and displaying them as i wanted. The thing is, i wanted to load 6 textures within a loop, and the first few load without any hassle, however, the last 4 of them don’t work.
I’ll paste a bit of code:
[b]
for(Mmedia i = 0; i < 9;i++)
{
TexImg = new AUX_RGBImageRec;
.
.
TexImg= auxDIBImageLoad(dest2);
glBindTexture(GL_TEXTURE_2D, texmap[i]);
cout << "texmap[i]--->"<< texmap[i] << endl;
glTexImage2D(GL_TEXTURE_2D,
0,
3,
TexImg->sizeX,
TexImg->sizeY,
0,
GL_RGB,
GL_UNSIGNED_BYTE,
TexImg->data);
glTexParameteri(GL_TEXTURE_2D,
GL_TEXTURE_MIN_FILTER,GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D,
GL_TEXTURE_MAG_FILTER,GL_LINEAR);
delete TexImg->data;
delete TexImg;
}
[/b]
[/b][/QUOTE]
when i print out the texmap contents it prints out only two valid values, the rest is garbage.
Am i doing something wrong? Thank you very much for your help.