1 | /* $Id: rect.c,v 1.1 2000-02-29 00:50:09 sandervl Exp $ */
|
---|
2 |
|
---|
3 | /*
|
---|
4 | * Mesa 3-D graphics library
|
---|
5 | * Version: 3.1
|
---|
6 | *
|
---|
7 | * Copyright (C) 1999 Brian Paul All Rights Reserved.
|
---|
8 | *
|
---|
9 | * Permission is hereby granted, free of charge, to any person obtaining a
|
---|
10 | * copy of this software and associated documentation files (the "Software"),
|
---|
11 | * to deal in the Software without restriction, including without limitation
|
---|
12 | * the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
---|
13 | * and/or sell copies of the Software, and to permit persons to whom the
|
---|
14 | * Software is furnished to do so, subject to the following conditions:
|
---|
15 | *
|
---|
16 | * The above copyright notice and this permission notice shall be included
|
---|
17 | * in all copies or substantial portions of the Software.
|
---|
18 | *
|
---|
19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
---|
20 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
---|
21 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
---|
22 | * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
---|
23 | * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
---|
24 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
---|
25 | */
|
---|
26 | /* $XFree86: xc/lib/GL/mesa/src/rect.c,v 1.2 1999/04/04 00:20:30 dawes Exp $ */
|
---|
27 |
|
---|
28 |
|
---|
29 |
|
---|
30 |
|
---|
31 |
|
---|
32 | #ifdef PC_HEADER
|
---|
33 | #include "all.h"
|
---|
34 | #else
|
---|
35 | #ifndef XFree86Server
|
---|
36 | #else
|
---|
37 | #include "GL/xf86glx.h"
|
---|
38 | #endif
|
---|
39 | #include "context.h"
|
---|
40 | #include "macros.h"
|
---|
41 | #include "rect.h"
|
---|
42 | #include "vbfill.h"
|
---|
43 | #endif
|
---|
44 |
|
---|
45 |
|
---|
46 |
|
---|
47 | /*
|
---|
48 | * Execute a glRect*() function.
|
---|
49 | */
|
---|
50 | void gl_Rectf( GLcontext *ctx, GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2 )
|
---|
51 | {
|
---|
52 | /*
|
---|
53 | * TODO: we could examine a bunch of state variables and ultimately
|
---|
54 | * call the Driver->RectFunc() function to draw a screen-aligned
|
---|
55 | * filled rectangle. Someday...
|
---|
56 | *
|
---|
57 | * KW: What happens to cull mode here?
|
---|
58 | */
|
---|
59 | ASSERT_OUTSIDE_BEGIN_END(ctx, "glRect");
|
---|
60 | RESET_IMMEDIATE(ctx);
|
---|
61 | gl_Begin( ctx, GL_QUADS );
|
---|
62 | gl_Vertex2f( ctx, x1, y1 );
|
---|
63 | gl_Vertex2f( ctx, x2, y1 );
|
---|
64 | gl_Vertex2f( ctx, x2, y2 );
|
---|
65 | gl_Vertex2f( ctx, x1, y2 );
|
---|
66 | gl_End( ctx );
|
---|
67 | }
|
---|