glRectsv function
The glRectsv function draws a rectangle.
Syntax
void WINAPI glRectsv(
const GLshort *v1,
const GLshort *v2
);
Parameters
-
v1
-
A pointer to one vertex of a rectangle.
-
v2
-
a pointer to the opposite vertex of the rectangle.
Return value
This function does not return a value.
Error codes
The following error code can be retrieved by the glGetError function.
Name | Meaning |
---|---|
|
The function was called between a call to glBegin and the corresponding call to glEnd. |
Remarks
The glRects function supports efficient specification of rectangles as two corner points. Each rectangle command takes four arguments, organized either as two consecutive pairs of (x, y) coordinates, or as two pointers to arrays, each containing an (x, y) pair. The resulting rectangle is defined in the z = 0 plane.
The glRects(x1, y1, x2, y2) function is exactly equivalent to the following sequence:
glBegin(GL_POLYGON);
glVertex2( x1, y1 );
glVertex2( x2, y1 );
glVertex2( x2, y2 );
glVertex2( x1, y2 );
glEnd( );
Notice that if the second vertex is above and to the right of the first vertex, the rectangle is constructed with a counterclockwise winding.
Requirements
Requirement | Value |
---|---|
Minimum supported client |
Windows 2000 Professional [desktop apps only] |
Minimum supported server |
Windows 2000 Server [desktop apps only] |
Header |
|
Library |
|
DLL |
|