PDA

View Full Version : stupid question about texturing



miko
11-25-2002, 11:36 AM
how is the damn glBindTexture() working??? i don't understand in at all! ok... i understand what glBindTexture() should do when i use an used texture name.

but what happens when parameter is unused texture...??? how can i then bind name with some real bitmap???

plz, hlp!!!

Deiussum
11-25-2002, 12:09 PM
Usually to intialize textures you have something like so... (Pseudocode)




foreach texture
{
glBindTexture(someUniqueTexID); // can get unique texIDs with glGenTextures

glTexParameter(); // use this to set mag/min filter and wrap parameters

glTexImage2d(); // use this to specify the texture data
}


Then for drawing you just do:



glBindTexture(texID);
drawObject();

nexusone
11-25-2002, 12:10 PM
You have to load the bitmap texture first before you can bind it, openGL does not have any texture file loading routines.
So you have ether write one or use someone elses.

I have an example with a TGA bitmap loader, which I use in my examples on my wet site.
GLblackjack and glBall.
http://www.angelfire.com/linux/nexusone/


Originally posted by miko:
how is the damn glBindTexture() working??? i don't understand in at all! ok... i understand what glBindTexture() should do when i use an used texture name.

but what happens when parameter is unused texture...??? how can i then bind name with some real bitmap???

plz, hlp!!!

miko
11-29-2002, 08:25 AM
tnx, you help me much!