glRect.3   [plain text]


'\" e  
'\"macro stdmacro
.ds Vn Version 1.2
.ds Dt 24 September 1999
.ds Re Release 1.2.1
.ds Dp May 22 14:46
.ds Dm 5 May 22 14:
.ds Xs 25554     4
.TH GLRECT 3G
.SH NAME
.B "glRectd, glRectf, glRecti, glRects, glRectdv, glRectfv, glRectiv, glRectsv
\- draw a rectangle

.SH C SPECIFICATION
void \f3glRectd\fP(
GLdouble \fIx1\fP,
.nf
.ta \w'\f3void \fPglRectd( 'u
	GLdouble \fIy1\fP,
	GLdouble \fIx2\fP,
	GLdouble \fIy2\fP )
.fi
void \f3glRectf\fP(
GLfloat \fIx1\fP,
.nf
.ta \w'\f3void \fPglRectf( 'u
	GLfloat \fIy1\fP,
	GLfloat \fIx2\fP,
	GLfloat \fIy2\fP )
.fi
void \f3glRecti\fP(
GLint \fIx1\fP,
.nf
.ta \w'\f3void \fPglRecti( 'u
	GLint \fIy1\fP,
	GLint \fIx2\fP,
	GLint \fIy2\fP )
.fi
void \f3glRects\fP(
GLshort \fIx1\fP,
.nf
.ta \w'\f3void \fPglRects( 'u
	GLshort \fIy1\fP,
	GLshort \fIx2\fP,
	GLshort \fIy2\fP )
.fi

.SH PARAMETERS
.TP \w'\f2x1\fP\ \f2y1\fP\ \ 'u 
\f2x1\fP, \f2y1\fP
Specify one vertex of a rectangle.
.TP
\f2x2\fP, \f2y2\fP
Specify the opposite vertex of the rectangle.
.SH C SPECIFICATION
void \f3glRectdv\fP(
const GLdouble \fI*v1\fP,
.nf
.ta \w'\f3void \fPglRectdv( 'u
	const GLdouble \fI*v2\fP )
.fi
void \f3glRectfv\fP(
const GLfloat \fI*v1\fP,
.nf
.ta \w'\f3void \fPglRectfv( 'u
	const GLfloat \fI*v2\fP )
.fi
void \f3glRectiv\fP(
const GLint \fI*v1\fP,
.nf
.ta \w'\f3void \fPglRectiv( 'u
	const GLint \fI*v2\fP )
.fi
void \f3glRectsv\fP(
const GLshort \fI*v1\fP,
.nf
.ta \w'\f3void \fPglRectsv( 'u
	const GLshort \fI*v2\fP )
.fi

.BP
.SH PARAMETERS
.TP
\f2v1\fP
Specifies a pointer to one vertex of a rectangle.
.TP
\f2v2\fP
Specifies a pointer to the opposite vertex of the rectangle.
.SH DESCRIPTION
\%\f3glRect\fP supports efficient specification of rectangles as two corner points.
Each 
rectangle command takes four arguments,
organized either as two consecutive pairs of (\f2x\fP,\f2y\fP) coordinates,
or as two pointers to arrays,
each containing an (\f2x\fP,\f2y\fP) pair.
The resulting rectangle is defined in the \f2z\fP = 0 plane.
.P
\%\f3glRect\fP(\f2x1\fP, \f2y1\fP, \f2x2\fP, \f2y2\fP)
is exactly equivalent to the following sequence:
.Ex 6
glBegin(\%\f3GL_POLYGON\fP);
glVertex2(\f2x1\fP, \f2y1\fP);
glVertex2(\f2x2\fP, \f2y1\fP);
glVertex2(\f2x2\fP, \f2y2\fP);
glVertex2(\f2x1\fP, \f2y2\fP);
glEnd();
.Ee
Note that if the second vertex is above and to the right of the first vertex,
the rectangle is constructed with a counterclockwise winding.
.SH ERRORS
\%\f3GL_INVALID_OPERATION\fP is generated if \%\f3glRect\fP
is executed between the execution of \%\f3glBegin\fP
and the corresponding execution of \%\f3glEnd\fP.
.SH SEE ALSO
\%\f3glBegin\fP,
\%\f3glVertex\fP