Tiled textures?

How do i do it?? I have been told that you can do this when you are initially binding them, but i cant figure out how?

When I tile a texture, I use the glTexCoord2i() function to change how often the texture is repeated.

unsigned int repeats = 2;

glTexCoord2i(0, 0);
glVertex3f(-1.0f,-1.0f, 0.0f);
glTexCoord2i(repeats, 0);
glVertex3f( 1.0f,-1.0f, 0.0f);
glTexCoord2i(repeats, repeats);
glVertex3f( 1.0f, 1.0f, 0.0f);
glTexCoord2i(0, repeats);
glVertex3f(-1.0f, 1.0f, 0.0f);

What Antiox said is true for rendering. When you first create your texture object, you want to use glTexParameter to set up the way that OGL handles your texture coordinates:


I think that OGL defaults to GL_REPEAT, but it’s not a bad idea to use these lines of code anyway, just for safety’s sake.