1GLRECT(3G) OpenGL Manual GLRECT(3G)
2
3
4
6 glRect - draw a rectangle
7
9 void glRectd(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2);
10
11 void glRectf(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2);
12
13 void glRecti(GLint x1, GLint y1, GLint x2, GLint y2);
14
15 void glRects(GLshort x1, GLshort y1, GLshort x2, GLshort y2);
16
18 x1, y1
19 Specify one vertex of a rectangle.
20
21 x2, y2
22 Specify the opposite vertex of the rectangle.
23
25 void glRectdv(const GLdouble * v1, const GLdouble * v2);
26
27 void glRectfv(const GLfloat * v1, const GLfloat * v2);
28
29 void glRectiv(const GLint * v1, const GLint * v2);
30
31 void glRectsv(const GLshort * v1, const GLshort * v2);
32
34 v1
35 Specifies a pointer to one vertex of a rectangle.
36
37 v2
38 Specifies a pointer to the opposite vertex of the rectangle.
39
41 glRect supports efficient specification of rectangles as two corner
42 points. Each rectangle command takes four arguments, organized either
43 as two consecutive pairs of x y coordinates or as two pointers to
44 arrays, each containing an x y pair. The resulting rectangle is defined
45 in the z = 0 plane.
46
47 glRect(x1, y1, x2, y2) is exactly equivalent to the following sequence:
48
49 glBegin(GL_POLYGON);
50 glVertex2(x1, y1);
51 glVertex2(x2, y1);
52 glVertex2(x2, y2);
53 glVertex2(x1, y2);
54 glEnd();
55
56
57 Note that if the second vertex is above and to the right of the first
58 vertex, the rectangle is constructed with a counterclockwise winding.
59
61 GL_INVALID_OPERATION is generated if glRect is executed between the
62 execution of glBegin() and the corresponding execution of glEnd().
63
65 glBegin(), glVertex()
66
68 Copyright © 1991-2006 Silicon Graphics, Inc. This document is licensed
69 under the SGI Free Software B License. For details, see
70 http://oss.sgi.com/projects/FreeB/.
71
73 opengl.org
74
75
76
77opengl.org 07/13/2018 GLRECT(3G)