I am playing with texturing in OpenGL and I have bumped into something I don't understand concerning texture coordinates:
I have a 512x512 texture and thought both codes would behave in the same way :
//int size = something;
glTexCoord2i(0, 0); glVertex2i(0, 0);
glTexCoord2i(0, 511); glVertex2i(0, size);
glTexCoord2i(511, 511); glVertex2i(size, size);
glTexCoord2i(511, 0); glVertex2i(size, 0);
//int size = something;
glTexCoord2f(0, 0); glVertex2i(0, 0);
glTexCoord2f(0, 1); glVertex2i(0, size);
glTexCoord2f(1, 1); glVertex2i(size, size);
glTexCoord2f(1, 0); glVertex2i(size, 0);
But they don't.
The code using glTexCoord2f gives me what I want, but the code using glTexCoord2i gives very strange results, where the texture appears to be totally messed up depending on size's value.