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