build a model (cube or plane) and before drawing them bind the texture you need. that way the texture is put on top of your geometry and everything should work. something like this (plane):
But how about the XScale, YScale, XPosition, XRepeatInterval ? OpenGL will do it automatically or I must do myself. For example, I have a texture with the width = 10, the size of wall is 50; So I have to use a for (i=0 to 5) ?
OpenGL uses normalized texture coordinates (ie rectricted to [0…1] interval). However it is possible to give texture coordinates higher than 1 or lower than 0, these ones are either clamped or repeated. For example if you choose the repeat mode, OpenGL will ignore the integer part of the coordinates and use only the fractional one and that causes a repetition of the texture image on the mapped polygon.
To choose the wrapping mode look at the function glTexParameter.
You use this one just bind the correct texture and do this to allow the texture repetition over the mapped surface:
// s texture coordinate repetition
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
// t texture coordinate repetition
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
If you use non power of two textures check that your hardware supports the extension GL_ARB_texture_non_power_of_two.