1GLRECT(3G) GLRECT(3G)
2
3
4
6 glRectd, glRectf, glRecti, glRects, glRectdv, glRectfv, glRectiv,
7 glRectsv - draw a rectangle
8
9
11 void glRectd( GLdouble x1,
12 GLdouble y1,
13 GLdouble x2,
14 GLdouble y2 )
15 void glRectf( GLfloat x1,
16 GLfloat y1,
17 GLfloat x2,
18 GLfloat y2 )
19 void glRecti( GLint x1,
20 GLint y1,
21 GLint x2,
22 GLint y2 )
23 void glRects( GLshort x1,
24 GLshort y1,
25 GLshort x2,
26 GLshort y2 )
27
28
30 x1, y1 Specify one vertex of a rectangle.
31
32 x2, y2 Specify the opposite vertex of the rectangle.
33
35 void glRectdv( const GLdouble *v1,
36 const GLdouble *v2 )
37 void glRectfv( const GLfloat *v1,
38 const GLfloat *v2 )
39 void glRectiv( const GLint *v1,
40 const GLint *v2 )
41 void glRectsv( const GLshort *v1,
42 const GLshort *v2 )
43
44
46 v1 Specifies a pointer to one vertex of a rectangle.
47
48 v2 Specifies a pointer to the opposite vertex of the rectangle.
49
51 glRect supports efficient specification of rectangles as two corner
52 points. Each rectangle command takes four arguments, organized either
53 as two consecutive pairs of (x,y) coordinates, or as two pointers to
54 arrays, each containing an (x,y) pair. The resulting rectangle is
55 defined in the z = 0 plane.
56
57 glRect(x1, y1, x2, y2) is exactly equivalent to the following sequence:
58 glBegin(GL_POLYGON); glVertex2(x1, y1); glVertex2(x2, y1); glVer‐
59 tex2(x2, y2); glVertex2(x1, y2); glEnd(); Note that if the second ver‐
60 tex is above and to the right of the first vertex, the rectangle is
61 constructed with a counterclockwise winding.
62
64 GL_INVALID_OPERATION is generated if glRect is executed between the
65 execution of glBegin and the corresponding execution of glEnd.
66
68 glBegin(3G), glVertex(3G)
69
70
71
72 GLRECT(3G)