SFML community forums
Help => Graphics => Topic started by: Redee on July 11, 2015, 03:14:43 pm
-
If I create RectangleShape(10.5001f, 10.5001f) - see on monitor square with size of 11px width and 10px height.
Created RenderWindow with size 800x800.
Why not 11px / 11px square.
If I set 10.501f / 10.501f - got square 11 / 11.
But me need 4 signs precision after point.
-
Because of OpenGL rasterisation.
-
See also What Every Computer Scientist Should Know About Floating-Point Arithmetic (http://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html)
-
Thats why need store 2 sizes of Object >>
1 - logic math
2 - whole number without signs after point to Display
Using f.e. >> floor(x + 0.5f);