4.3 GLRECTF ( -0.5f, -0.5f, 0.5f, 0.5f)Anatomy
GLRECTF ( -0.5f, -0.5f, 0.5f, 0.5f);// GLRECTF , draw a rectangle with four parameters representing the horizontal and vertical coordinates of two points on the diagonal
Maybe a lot of beginners do not understand, in fact, I do not understand, but took two more steps.
1) The F that follows the number is a floating-point, not a double type, minus no effect
leads to the following question, said online, this is the upper left corner of the rectangle, and the lower right corner of the coordinates, the coordinates are not integers? How to have 0.5, do not understand, crazy!!!!! Unveiled as follows:
your window's default coordinate system is -1~1 , which will be clipped if it is larger than this value .
you fill in the 100*50, in fact it is painted, but more than 1 of the parts have been cut off, presented in your window is the entire screen is the color of the rectangle
B(+)
&&&&&&&&&&&&&&&&&&
& &
& &
& &
& &
& &
& &
&&&&&&&&&&&&&&&&&&
A(-1,-1)
from this figure, it should be understood:GLRECTF (100f,100f, 50f,50f);
It's painted! But it was brushed off!!
OpenGL Example 1 GLRECTF anatomy