I want to know how can I do to apply different textures to a same object.
Because I load a map in ASE Format and I want to have a texture for the wall and
a another texture for the ground and a another for the sky etc…
Originally posted by Booba: I want to know how can I do to apply different textures to a same object.
I think you refer to change the texture you are using. This is made with
glBindTexture(GL_TEXTURE2D,number);
where ‘number’ is the ID of the texture you got by calling glGenTextures. You shouldn’t type that ID directly in the function call, as you are doing in your code. You’d better use the variable you have passed to glGenTextures.
You shouldn’t type that ID directly in the function call, as you are doing in your code.
There’s nothing wrong with using your own texture IDs. glGenTextures always gives you an unused ID, but if you can make this guarantee yourself, then there’s nothing wrong with that.
glGenTextures does nothing but returning a number to an unused texture ID, it does not “prepare” the use of the texture or anything like that, so you can safely use your own numbers.