drawing texute multilple times

Hai,

I want to draw a Wall and fill one side bith Brick textures.

I loaded and drew the texture correctly.

But my problems is according to the wall size i want to repeat the texture, not resize.

this way i loaded the texture
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_REPEAT);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR_MIPMAP_NEAREST);
gluBuild2DMipmaps(GL_TEXTURE_2D, 3, TextureImage[0]->sizeX, TextureImage[0]->sizeY, GL_RGB, GL_UNSIGNED_BYTE, TextureImage[0]->data);

Anyone have any idea?? :frowning:

Thanks in advance :slight_smile:

You can use texture coordinates to do that. Generally, you use values between 0 and 1. Now you can use values ranged from 0 up to the value you want.

glTexCoord2f (0,0);
glTexCoord2f (2,0);
glTexCoord2f (2,2);
glTexCoord2f (0,2);

will repeat the texture twice in both directions. Just make some tests changing the values to see what happen :slight_smile:

Hello,

glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_REPEAT);?

I think you mean :
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);

Dj3hut1