Orzech
11-24-2004, 01:26 PM
Hello!
I have a 2D vector of floats representing a position. It's important that the numbers describing the position need to be rounded to integer values when I use them in drawing. Which method would be faster :
1) convert floats to ints at the level of C code
iX = (int) fX;
iY = (int) fY;2) pass floats as arguments to glVertex2i() and hope that OpenGL does the rounding better than pure C does
glVertex2i(fX, fY)Which one seems more efficient? Maybe there is some other - better - solution?
Thanks in advance! :)
I have a 2D vector of floats representing a position. It's important that the numbers describing the position need to be rounded to integer values when I use them in drawing. Which method would be faster :
1) convert floats to ints at the level of C code
iX = (int) fX;
iY = (int) fY;2) pass floats as arguments to glVertex2i() and hope that OpenGL does the rounding better than pure C does
glVertex2i(fX, fY)Which one seems more efficient? Maybe there is some other - better - solution?
Thanks in advance! :)