PDA

View Full Version : Texture Coordinates/speed concerns.



SquidMan
12-16-2001, 12:26 PM
Situation: You have a quad and you want to use an entire texture map on it, so you specify coordinates using integers, like so:

glTexCoord2i(0,0);
glTexCoord2i(1,0);
glTexCoord2i(1,1);
glTexCoord2i(0,1);

And what happens is that a border is drawn around the edges of the quad! You can solve this problem by using floats and using 0.01 and 0.99 instead of 0's and 1's, but wouldn't that be slower?

Korval
12-16-2001, 06:18 PM
No, it's not any slower. Those ints get converted into floats internally anyway.

Actually, as I think about it, I'm wondering if it your code as written even works. I thought that when you use ints, it assumes that MAX_INT is 1.0 and MIN_INT is -1.0.

[This message has been edited by Korval (edited 12-16-2001).]

Jantje
12-17-2001, 05:19 AM
Your code is correct and no border should be drawn if you didn't load one with glTexImage2D.