PDA

View Full Version : Problem with glTexCoord2d()



adrien.givry
03-04-2017, 11:51 AM
Hi everyone !

I'm new to OpenGL and not an english native speaker (Don't judge me ! :p).
I'm trying to make a floor with a texture. For the moment I'm drawing a square this way :

glBegin(GL_QUADS);
glTexCoord2d(0, 0); glVertex3d(0, 0, 0);
glTexCoord2d(10, 0); glVertex3d(1000, 0, 0);
glTexCoord2d(10, 10); glVertex3d(1000, 0, 1000);
glTexCoord2d(0, 10); glVertex3d(0, 0, 1000);
glEnd();

The problem is that the texture isn't repeated ! I'm using binding from SFML, so maybe SFML doesn't allow to repeat a texture, but it seems strange...

But seems being stretched (Not on all the floor, but only on a line) instead of repeated !

Thanks for your help !

GClements
03-04-2017, 07:42 PM
It's possible that SFML is explicitly setting the wrap mode to clamp. Use glTexParameter (https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/glTexParameter.xml)() to set it to repeat.