I have a floor in my game, which is made of 100x100 quads. I couldn't do it just with 1 quad, because it would ruin lighting. And here is the problem - how do I put a single texture on all of them? This code puts texture on each of the quads, but it is not the effect I want.
glBegin(GL_QUADS);
glNormal3f(0,0,1);
for(float j = 0; j < 1; j+=0.01)
{
for(float i = 0; i < 1; i+=0.01)
{
glTexCoord2f(0.0,0.0); glVertex2f(i,j+0.01);
glTexCoord2f(1.0,0.0); glVertex2f(i,j);
glTexCoord2f(1.0,1.0); glVertex2f(i+0.01,j);
glTexCoord2f(0.0,1.0); glVertex2f(i+0.01,j+0.01);
}
}
glEnd();
glPopMatrix();