You need to call glBindTexture
just before performing a draw call:
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, textures[0]);
glActiveTexture(GL_TEXTURE1);
glBindTexture(GL_TEXTURE_2D, textures[1]);
draw_things();
In the above example, whatever you draw with draw_things
will have access to both textures 0 and 1 (GL_TEXTURE0 and GL_TEXTURE1).
Now, if what you want is to draw many things, but each with a different texture, then you need to:
glActiveTexture(GL_TEXTURE0); // activate any texture unit
glEnable(GL_TEXTURE_2D); // make sure texturing is enabled
glBindTexture(GL_TEXTURE_2D, thing1_texture);
draw_thing1();
glBindTexture(GL_TEXTURE_2D, thing2_texture);
draw_thing2();
// etecetera