ReactOS
0.4.16-dev-297-gc569aee
Toggle main menu visibility
Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
Functions
_
a
b
c
d
e
f
g
h
i
l
m
o
p
r
s
t
u
v
w
Variables
_
c
d
e
f
g
h
i
l
n
o
p
s
t
u
x
Typedefs
_
a
b
c
d
e
f
g
h
i
l
m
o
p
r
s
t
u
v
w
x
Enumerations
_
c
d
f
i
l
m
o
p
s
t
w
x
Enumerator
a
b
c
d
e
f
g
h
i
m
n
o
p
r
s
t
u
v
w
x
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
_
a
b
c
d
e
f
h
i
k
l
m
n
o
p
r
s
t
u
v
w
z
Enumerator
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Properties
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Related Functions
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
v
x
Files
File List
File Members
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerator
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Macros
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Examples
polygon.c
Go to the documentation of this file.
1
/* $Id: polygon.c,v 1.7 1997/07/24 01:23:44 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: polygon.c,v $
26
* Revision 1.7 1997/07/24 01:23:44 brianp
27
* changed precompiled header symbol from PCH to PC_HEADER
28
*
29
* Revision 1.6 1997/06/03 01:58:27 brianp
30
* fixed unpacking bug in gl_PolygonStipple()
31
*
32
* Revision 1.5 1997/05/28 03:26:02 brianp
33
* added precompiled header (PCH) support
34
*
35
* Revision 1.4 1997/04/12 16:54:05 brianp
36
* new NEW_POLYGON state flag
37
*
38
* Revision 1.3 1996/10/11 03:44:58 brianp
39
* removed Polygon.OffsetBias
40
*
41
* Revision 1.2 1996/09/26 22:48:40 brianp
42
* set NEW_RASTER_OPS flag in gl_PolygonStipple() if stippling enabled
43
*
44
* Revision 1.1 1996/09/13 01:38:16 brianp
45
* Initial revision
46
*
47
*/
48
49
50
#ifdef PC_HEADER
51
#include "
all.h
"
52
#else
53
#include <assert.h>
54
#include <stdlib.h>
55
#include <string.h>
56
#include "
context.h
"
57
#include "
macros.h
"
58
#include "
polygon.h
"
59
#include "
types.h
"
60
#endif
61
62
63
64
void
gl_CullFace
(
GLcontext
*
ctx
,
GLenum
mode
)
65
{
66
if
(
mode
!=
GL_FRONT
&&
mode
!=
GL_BACK
&&
mode
!=
GL_FRONT_AND_BACK
) {
67
gl_error
(
ctx
,
GL_INVALID_ENUM
,
"glCullFace"
);
68
return
;
69
}
70
if
(
INSIDE_BEGIN_END
(
ctx
)) {
71
gl_error
(
ctx
,
GL_INVALID_OPERATION
,
"glCullFace"
);
72
return
;
73
}
74
ctx
->Polygon.CullFaceMode =
mode
;
75
ctx
->NewState |=
NEW_POLYGON
;
76
}
77
78
79
80
void
gl_FrontFace
(
GLcontext
*
ctx
,
GLenum
mode
)
81
{
82
if
(
INSIDE_BEGIN_END
(
ctx
)) {
83
gl_error
(
ctx
,
GL_INVALID_OPERATION
,
"glFrontFace"
);
84
return
;
85
}
86
if
(
mode
!=
GL_CW
&&
mode
!=
GL_CCW
) {
87
gl_error
(
ctx
,
GL_INVALID_ENUM
,
"glFrontFace"
);
88
return
;
89
}
90
ctx
->Polygon.FrontFace =
mode
;
91
}
92
93
94
95
void
gl_PolygonMode
(
GLcontext
*
ctx
,
GLenum
face
,
GLenum
mode
)
96
{
97
if
(
INSIDE_BEGIN_END
(
ctx
)) {
98
gl_error
(
ctx
,
GL_INVALID_OPERATION
,
"glPolygonMode"
);
99
return
;
100
}
101
if
(
face
!=
GL_FRONT
&&
face
!=
GL_BACK
&&
face
!=
GL_FRONT_AND_BACK
) {
102
gl_error
(
ctx
,
GL_INVALID_ENUM
,
"glPolygonMode(face)"
);
103
return
;
104
}
105
else
if
(
mode
!=
GL_POINT
&&
mode
!=
GL_LINE
&&
mode
!=
GL_FILL
) {
106
gl_error
(
ctx
,
GL_INVALID_ENUM
,
"glPolygonMode(mode)"
);
107
return
;
108
}
109
110
if
(
face
==
GL_FRONT
||
face
==
GL_FRONT_AND_BACK
) {
111
ctx
->Polygon.FrontMode =
mode
;
112
}
113
if
(
face
==
GL_BACK
||
face
==
GL_FRONT_AND_BACK
) {
114
ctx
->Polygon.BackMode =
mode
;
115
}
116
117
/* Compute a handy "shortcut" value: */
118
if
(
ctx
->Polygon.FrontMode!=
GL_FILL
||
ctx
->Polygon.BackMode!=
GL_FILL
) {
119
ctx
->Polygon.Unfilled =
GL_TRUE
;
120
}
121
else
{
122
ctx
->Polygon.Unfilled =
GL_FALSE
;
123
}
124
125
ctx
->NewState |=
NEW_POLYGON
;
126
}
127
128
129
130
void
gl_PolygonStipple
(
GLcontext
*
ctx
,
const
GLubyte
*
mask
)
131
{
132
GLint
i
;
133
134
if
(
INSIDE_BEGIN_END
(
ctx
)) {
135
gl_error
(
ctx
,
GL_INVALID_OPERATION
,
"glPolygonStipple"
);
136
return
;
137
}
138
139
/* TODO: bit twiddling, unpacking */
140
for
(
i
=0;
i
<32;
i
++) {
141
ctx
->PolygonStipple[
i
] = (
mask
[
i
*4+0] << 24)
142
| (
mask
[
i
*4+1] << 16)
143
| (
mask
[
i
*4+2] << 8)
144
| (
mask
[
i
*4+3]);
145
}
146
147
if
(
ctx
->Polygon.StippleFlag) {
148
ctx
->NewState |=
NEW_RASTER_OPS
;
149
}
150
}
151
152
153
154
void
gl_GetPolygonStipple
(
GLcontext
*
ctx
,
GLubyte
*
mask
)
155
{
156
/* TODO */
157
}
158
159
160
161
void
gl_PolygonOffset
(
GLcontext
*
ctx
,
162
GLfloat
factor
,
GLfloat
units
)
163
{
164
if
(
INSIDE_BEGIN_END
(
ctx
)) {
165
gl_error
(
ctx
,
GL_INVALID_OPERATION
,
"glPolygonOffset"
);
166
return
;
167
}
168
ctx
->Polygon.OffsetFactor =
factor
;
169
ctx
->Polygon.OffsetUnits =
units
;
170
}
171
all.h
context.h
gl_error
void gl_error(GLcontext *ctx, GLenum error, const char *s)
Definition:
context.c:1421
NEW_RASTER_OPS
#define NEW_RASTER_OPS
Definition:
types.h:1233
NEW_POLYGON
#define NEW_POLYGON
Definition:
types.h:1235
GLubyte
unsigned char GLubyte
Definition:
gl.h:157
GL_TRUE
#define GL_TRUE
Definition:
gl.h:174
GL_POINT
#define GL_POINT
Definition:
gl.h:265
GLfloat
float GLfloat
Definition:
gl.h:161
GL_FRONT_AND_BACK
#define GL_FRONT_AND_BACK
Definition:
gl.h:336
GL_CW
#define GL_CW
Definition:
gl.h:268
GL_INVALID_OPERATION
#define GL_INVALID_OPERATION
Definition:
gl.h:696
GLenum
unsigned int GLenum
Definition:
gl.h:150
GL_BACK
#define GL_BACK
Definition:
gl.h:271
GL_CCW
#define GL_CCW
Definition:
gl.h:269
GL_FILL
#define GL_FILL
Definition:
gl.h:267
GL_LINE
#define GL_LINE
Definition:
gl.h:266
GL_FALSE
#define GL_FALSE
Definition:
gl.h:173
GLint
int GLint
Definition:
gl.h:156
GL_FRONT
#define GL_FRONT
Definition:
gl.h:270
GL_INVALID_ENUM
#define GL_INVALID_ENUM
Definition:
gl.h:694
mask
GLenum GLint GLuint mask
Definition:
glext.h:6028
face
GLenum GLuint GLint GLenum face
Definition:
glext.h:7025
mode
GLenum mode
Definition:
glext.h:6217
units
GLfloat units
Definition:
glext.h:11727
factor
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint factor
Definition:
glfuncs.h:178
i
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition:
glfuncs.h:248
macros.h
INSIDE_BEGIN_END
#define INSIDE_BEGIN_END(CTX)
Definition:
macros.h:135
gl_FrontFace
void gl_FrontFace(GLcontext *ctx, GLenum mode)
Definition:
polygon.c:80
gl_GetPolygonStipple
void gl_GetPolygonStipple(GLcontext *ctx, GLubyte *mask)
Definition:
polygon.c:154
gl_PolygonStipple
void gl_PolygonStipple(GLcontext *ctx, const GLubyte *mask)
Definition:
polygon.c:130
gl_CullFace
void gl_CullFace(GLcontext *ctx, GLenum mode)
Definition:
polygon.c:64
gl_PolygonOffset
void gl_PolygonOffset(GLcontext *ctx, GLfloat factor, GLfloat units)
Definition:
polygon.c:161
gl_PolygonMode
void gl_PolygonMode(GLcontext *ctx, GLenum face, GLenum mode)
Definition:
polygon.c:95
polygon.h
types.h
gl_context
Definition:
types.h:1263
ctx
Definition:
dbghelp_private.h:571
dll
opengl
mesa
polygon.c
Generated on Tue Nov 26 2024 06:03:23 for ReactOS by
1.9.6