Farpetrad
01-10-2006, 04:56 PM
Im having a hard time seeing how a texture is bound. Example:
unsigned int texturedata[1];
.....
texture=LoadBMP("example.bmp");
glGenTextures(1,&texturedata);
glBindTexture(GL_TEXTURE_2D, texturedata[0]);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, width, height, 0, GL_RGB, GL_UNSIGNED_BYTE, texture);
......What I dont understand is how the texture name texturedata[0] is related to the data texture? I was looking at the nehe code for lesson 6 and they delete the data right after binding which really throws me off more, if someone could please explain thanks.
unsigned int texturedata[1];
.....
texture=LoadBMP("example.bmp");
glGenTextures(1,&texturedata);
glBindTexture(GL_TEXTURE_2D, texturedata[0]);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, width, height, 0, GL_RGB, GL_UNSIGNED_BYTE, texture);
......What I dont understand is how the texture name texturedata[0] is related to the data texture? I was looking at the nehe code for lesson 6 and they delete the data right after binding which really throws me off more, if someone could please explain thanks.