• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2010, Google Inc.
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are
7  * met:
8  *
9  *     * Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  *     * Redistributions in binary form must reproduce the above
12  * copyright notice, this list of conditions and the following disclaimer
13  * in the documentation and/or other materials provided with the
14  * distribution.
15  *     * Neither the name of Google Inc. nor the names of its
16  * contributors may be used to endorse or promote products derived from
17  * this software without specific prior written permission.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30  */
31 
32 // This header is a skeleton substitute for GL/glu.h which contains
33 // only the definitions, constants and function declarations necessary
34 // to compile the GLU tessellator.
35 
36 #ifndef SK_GLU_H_
37 #define SK_GLU_H_
38 
39 #include "gluos.h"
40 
41 /* Primitives */
42 #define GL_LINE_LOOP                            0x0002
43 #define GL_TRIANGLES                            0x0004
44 #define GL_TRIANGLE_STRIP                       0x0005
45 #define GL_TRIANGLE_FAN                         0x0006
46 
47 /* ErrorCode */
48 #define GLU_INVALID_ENUM                     100900
49 #define GLU_INVALID_VALUE                    100901
50 #define GLU_OUT_OF_MEMORY                    100902
51 
52 /* TessCallback */
53 #define GLU_TESS_BEGIN                       100100
54 #define GLU_BEGIN                            100100
55 #define GLU_TESS_VERTEX                      100101
56 #define GLU_VERTEX                           100101
57 #define GLU_TESS_END                         100102
58 #define GLU_END                              100102
59 #define GLU_TESS_ERROR                       100103
60 #define GLU_TESS_EDGE_FLAG                   100104
61 #define GLU_EDGE_FLAG                        100104
62 #define GLU_TESS_COMBINE                     100105
63 #define GLU_TESS_BEGIN_DATA                  100106
64 #define GLU_TESS_VERTEX_DATA                 100107
65 #define GLU_TESS_END_DATA                    100108
66 #define GLU_TESS_ERROR_DATA                  100109
67 #define GLU_TESS_EDGE_FLAG_DATA              100110
68 #define GLU_TESS_COMBINE_DATA                100111
69 
70 /* TessContour */
71 #define GLU_CW                               100120
72 #define GLU_CCW                              100121
73 #define GLU_INTERIOR                         100122
74 #define GLU_EXTERIOR                         100123
75 #define GLU_UNKNOWN                          100124
76 
77 /* TessProperty */
78 #define GLU_TESS_WINDING_RULE                100140
79 #define GLU_TESS_BOUNDARY_ONLY               100141
80 #define GLU_TESS_TOLERANCE                   100142
81 
82 /* TessError */
83 #define GLU_TESS_ERROR1                      100151
84 #define GLU_TESS_ERROR2                      100152
85 #define GLU_TESS_ERROR3                      100153
86 #define GLU_TESS_ERROR4                      100154
87 #define GLU_TESS_ERROR5                      100155
88 #define GLU_TESS_ERROR6                      100156
89 #define GLU_TESS_ERROR7                      100157
90 #define GLU_TESS_ERROR8                      100158
91 #define GLU_TESS_MISSING_BEGIN_POLYGON       100151
92 #define GLU_TESS_MISSING_BEGIN_CONTOUR       100152
93 #define GLU_TESS_MISSING_END_POLYGON         100153
94 #define GLU_TESS_MISSING_END_CONTOUR         100154
95 #define GLU_TESS_COORD_TOO_LARGE             100155
96 #define GLU_TESS_NEED_COMBINE_CALLBACK       100156
97 
98 /* TessWinding */
99 #define GLU_TESS_WINDING_ODD                 100130
100 #define GLU_TESS_WINDING_NONZERO             100131
101 #define GLU_TESS_WINDING_POSITIVE            100132
102 #define GLU_TESS_WINDING_NEGATIVE            100133
103 #define GLU_TESS_WINDING_ABS_GEQ_TWO         100134
104 
105 #define GLU_TESS_MAX_COORD 1.0e150
106 
107 typedef struct GLUtesselator GLUtesselator;
108 
109 #ifdef __cplusplus
110 extern "C" {
111 #endif
112 
113 extern GLUtesselator * GLAPIENTRY Sk_gluNewTess(void);
114 extern void GLAPIENTRY Sk_gluDeleteTess(GLUtesselator *tess);
115 extern void GLAPIENTRY Sk_gluTessProperty(GLUtesselator *tess,
116                                                 GLenum which,
117                                                 GLdouble value);
118 extern void GLAPIENTRY Sk_gluGetTessProperty(GLUtesselator *tess,
119                                                    GLenum which,
120                                                    GLdouble *value);
121 extern void GLAPIENTRY Sk_gluTessNormal(GLUtesselator *tess,
122                                               GLdouble x,
123                                               GLdouble y,
124                                               GLdouble z);
125 extern void GLAPIENTRY Sk_gluTessCallback(GLUtesselator *tess,
126                                                 GLenum which,
127                                                 void (GLAPIENTRY *fn)());
128 extern void GLAPIENTRY Sk_gluTessVertex(GLUtesselator *tess,
129                                               GLdouble coords[3],
130                                               void *data);
131 extern void GLAPIENTRY Sk_gluTessBeginPolygon(GLUtesselator *tess,
132                                                     void *data);
133 extern void GLAPIENTRY Sk_gluTessBeginContour(GLUtesselator *tess);
134 extern void GLAPIENTRY Sk_gluTessEndContour(GLUtesselator *tess);
135 extern void GLAPIENTRY Sk_gluTessEndPolygon(GLUtesselator *tess);
136 
137 #ifdef __cplusplus
138 }
139 #endif
140 
141 #endif  // SK_GLU_H_
142