1*5f2bebf7SJérôme Gardou /* $Id: rect.c,v 1.5 1997/07/24 01:25:18 brianp Exp $ */
2*5f2bebf7SJérôme Gardou
3*5f2bebf7SJérôme Gardou /*
4*5f2bebf7SJérôme Gardou * Mesa 3-D graphics library
5*5f2bebf7SJérôme Gardou * Version: 2.4
6*5f2bebf7SJérôme Gardou * Copyright (C) 1995-1997 Brian Paul
7*5f2bebf7SJérôme Gardou *
8*5f2bebf7SJérôme Gardou * This library is free software; you can redistribute it and/or
9*5f2bebf7SJérôme Gardou * modify it under the terms of the GNU Library General Public
10*5f2bebf7SJérôme Gardou * License as published by the Free Software Foundation; either
11*5f2bebf7SJérôme Gardou * version 2 of the License, or (at your option) any later version.
12*5f2bebf7SJérôme Gardou *
13*5f2bebf7SJérôme Gardou * This library is distributed in the hope that it will be useful,
14*5f2bebf7SJérôme Gardou * but WITHOUT ANY WARRANTY; without even the implied warranty of
15*5f2bebf7SJérôme Gardou * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16*5f2bebf7SJérôme Gardou * Library General Public License for more details.
17*5f2bebf7SJérôme Gardou *
18*5f2bebf7SJérôme Gardou * You should have received a copy of the GNU Library General Public
19*5f2bebf7SJérôme Gardou * License along with this library; if not, write to the Free
20*5f2bebf7SJérôme Gardou * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21*5f2bebf7SJérôme Gardou */
22*5f2bebf7SJérôme Gardou
23*5f2bebf7SJérôme Gardou
24*5f2bebf7SJérôme Gardou /*
25*5f2bebf7SJérôme Gardou * $Log: rect.c,v $
26*5f2bebf7SJérôme Gardou * Revision 1.5 1997/07/24 01:25:18 brianp
27*5f2bebf7SJérôme Gardou * changed precompiled header symbol from PCH to PC_HEADER
28*5f2bebf7SJérôme Gardou *
29*5f2bebf7SJérôme Gardou * Revision 1.4 1997/05/28 03:26:18 brianp
30*5f2bebf7SJérôme Gardou * added precompiled header (PCH) support
31*5f2bebf7SJérôme Gardou *
32*5f2bebf7SJérôme Gardou * Revision 1.3 1997/04/29 01:27:13 brianp
33*5f2bebf7SJérôme Gardou * added #include "vbfill.h"
34*5f2bebf7SJérôme Gardou *
35*5f2bebf7SJérôme Gardou * Revision 1.2 1997/04/21 01:22:08 brianp
36*5f2bebf7SJérôme Gardou * added a comment
37*5f2bebf7SJérôme Gardou *
38*5f2bebf7SJérôme Gardou * Revision 1.1 1997/04/12 16:00:35 brianp
39*5f2bebf7SJérôme Gardou * Initial revision
40*5f2bebf7SJérôme Gardou *
41*5f2bebf7SJérôme Gardou */
42*5f2bebf7SJérôme Gardou
43*5f2bebf7SJérôme Gardou
44*5f2bebf7SJérôme Gardou #ifdef PC_HEADER
45*5f2bebf7SJérôme Gardou #include "all.h"
46*5f2bebf7SJérôme Gardou #else
47*5f2bebf7SJérôme Gardou #include "context.h"
48*5f2bebf7SJérôme Gardou #include "macros.h"
49*5f2bebf7SJérôme Gardou #include "rect.h"
50*5f2bebf7SJérôme Gardou #include "vbfill.h"
51*5f2bebf7SJérôme Gardou #endif
52*5f2bebf7SJérôme Gardou
53*5f2bebf7SJérôme Gardou
54*5f2bebf7SJérôme Gardou
55*5f2bebf7SJérôme Gardou /*
56*5f2bebf7SJérôme Gardou * Execute a glRect*() function.
57*5f2bebf7SJérôme Gardou */
gl_Rectf(GLcontext * ctx,GLfloat x1,GLfloat y1,GLfloat x2,GLfloat y2)58*5f2bebf7SJérôme Gardou void gl_Rectf( GLcontext *ctx, GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2 )
59*5f2bebf7SJérôme Gardou {
60*5f2bebf7SJérôme Gardou /*
61*5f2bebf7SJérôme Gardou * TODO: we could examine a bunch of state variables and ultimately
62*5f2bebf7SJérôme Gardou * call the Driver->RectFunc() function to draw a screen-aligned
63*5f2bebf7SJérôme Gardou * filled rectangle. Someday...
64*5f2bebf7SJérôme Gardou */
65*5f2bebf7SJérôme Gardou
66*5f2bebf7SJérôme Gardou if (INSIDE_BEGIN_END(ctx)) {
67*5f2bebf7SJérôme Gardou gl_error( ctx, GL_INVALID_OPERATION, "glRect" );
68*5f2bebf7SJérôme Gardou return;
69*5f2bebf7SJérôme Gardou }
70*5f2bebf7SJérôme Gardou gl_Begin( ctx, GL_QUADS );
71*5f2bebf7SJérôme Gardou (*ctx->Exec.Vertex2f)( ctx, x1, y1 );
72*5f2bebf7SJérôme Gardou (*ctx->Exec.Vertex2f)( ctx, x2, y1 );
73*5f2bebf7SJérôme Gardou (*ctx->Exec.Vertex2f)( ctx, x2, y2 );
74*5f2bebf7SJérôme Gardou (*ctx->Exec.Vertex2f)( ctx, x1, y2 );
75*5f2bebf7SJérôme Gardou gl_End( ctx );
76*5f2bebf7SJérôme Gardou }
77