FreeWRL / FreeX3D 4.3.0
libtess2.h
1/*
2 * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008)
3 * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved.
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the "Software"),
7 * to deal in the Software without restriction, including without limitation
8 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 * and/or sell copies of the Software, and to permit persons to whom the
10 * Software is furnished to do so, subject to the following conditions:
11 *
12 * The above copyright notice including the dates of first publication and
13 * either this permission notice or a reference to
14 * http://oss.sgi.com/projects/FreeB/
15 * shall be included in all copies or substantial portions of the Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
21 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
22 * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23 * SOFTWARE.
24 *
25 * Except as contained in this notice, the name of Silicon Graphics, Inc.
26 * shall not be used in advertising or otherwise to promote the sale, use or
27 * other dealings in this Software without prior written authorization from
28 * Silicon Graphics, Inc.
29 */
30/* subset of mesa glu.h for tesselation only and using openGL ES 2 header */
31
32#ifndef __libtess2_h__
33#define __libtess2_h__
34
35#include <config.h>
36
37#if defined (_ANDROID) || defined(ANDROIDNDK) || defined (QNX) || defined (ANGLEPROJECT)
38 #include <GLES2/gl2.h>
39 #define GLdouble double
40#else
41#ifdef AQUA
42#include <OpenGL/gl.h>
43#else
44 #include <GL/gl.h>
45#endif
46#endif
47
48
49#ifndef GLAPIENTRY
50#if defined(_MSC_VER) || defined(__MINGW32__)
51#define GLAPIENTRY __stdcall
52#else
53#define GLAPIENTRY
54#endif
55#endif
56
57#ifndef GLAPIENTRYP
58#define GLAPIENTRYP GLAPIENTRY *
59#endif
60
61#define WANT_STATIC_LIBTESS 1
62#if defined(_MSC_VER) && defined(WANT_STATIC_LIBTESS)
63#undef _DLL //pesky thing shouldn't be defined for a static lib but is
64#endif
65
66#if (defined(_MSC_VER) || defined(__MINGW32__)) && defined(BUILD_GLU32)
67# undef GLAPI
68# define GLAPI __declspec(dllexport)
69#elif (defined(_MSC_VER) || defined(__MINGW32__)) && defined(_DLL)
70/* tag specifying we're building for DLL runtime support */
71# undef GLAPI
72# define GLAPI __declspec(dllimport)
73#elif !defined(GLAPI)
74/* for use with static link lib build of Win32 edition only */
75# define GLAPI extern
76#endif /* _STATIC_MESA support */
77
78#ifdef __cplusplus
79extern "C" {
80#endif
81
82/*************************************************************/
83
84/* Boolean */
85#define GLU_FALSE 0
86#define GLU_TRUE 1
87
88/* Version */
89#define GLU_VERSION_1_1 1
90#define GLU_VERSION_1_2 1
91#define GLU_VERSION_1_3 1
92
93/* StringName */
94#define GLU_VERSION 100800
95#define GLU_EXTENSIONS 100801
96
97/* ErrorCode */
98#define GLU_INVALID_ENUM 100900
99#define GLU_INVALID_VALUE 100901
100#define GLU_OUT_OF_MEMORY 100902
101#define GLU_INCOMPATIBLE_GL_VERSION 100903
102#define GLU_INVALID_OPERATION 100904
103
104#define GLU_ERROR 100103
105
106/* TessCallback */
107#define GLU_TESS_BEGIN 100100
108#define GLU_BEGIN 100100
109#define GLU_TESS_VERTEX 100101
110#define GLU_VERTEX 100101
111#define GLU_TESS_END 100102
112#define GLU_END 100102
113#define GLU_TESS_ERROR 100103
114#define GLU_TESS_EDGE_FLAG 100104
115#define GLU_EDGE_FLAG 100104
116#define GLU_TESS_COMBINE 100105
117#define GLU_TESS_BEGIN_DATA 100106
118#define GLU_TESS_VERTEX_DATA 100107
119#define GLU_TESS_END_DATA 100108
120#define GLU_TESS_ERROR_DATA 100109
121#define GLU_TESS_EDGE_FLAG_DATA 100110
122#define GLU_TESS_COMBINE_DATA 100111
123
124/* TessContour */
125#define GLU_CW 100120
126#define GLU_CCW 100121
127#define GLU_INTERIOR 100122
128#define GLU_EXTERIOR 100123
129#define GLU_UNKNOWN 100124
130
131/* TessProperty */
132#define GLU_TESS_WINDING_RULE 100140
133#define GLU_TESS_BOUNDARY_ONLY 100141
134#define GLU_TESS_TOLERANCE 100142
135
136/* TessError */
137#define GLU_TESS_ERROR1 100151
138#define GLU_TESS_ERROR2 100152
139#define GLU_TESS_ERROR3 100153
140#define GLU_TESS_ERROR4 100154
141#define GLU_TESS_ERROR5 100155
142#define GLU_TESS_ERROR6 100156
143#define GLU_TESS_ERROR7 100157
144#define GLU_TESS_ERROR8 100158
145#define GLU_TESS_MISSING_BEGIN_POLYGON 100151
146#define GLU_TESS_MISSING_BEGIN_CONTOUR 100152
147#define GLU_TESS_MISSING_END_POLYGON 100153
148#define GLU_TESS_MISSING_END_CONTOUR 100154
149#define GLU_TESS_COORD_TOO_LARGE 100155
150#define GLU_TESS_NEED_COMBINE_CALLBACK 100156
151
152/* TessWinding */
153#define GLU_TESS_WINDING_ODD 100130
154#define GLU_TESS_WINDING_NONZERO 100131
155#define GLU_TESS_WINDING_POSITIVE 100132
156#define GLU_TESS_WINDING_NEGATIVE 100133
157#define GLU_TESS_WINDING_ABS_GEQ_TWO 100134
158
159/*************************************************************/
160
161
162#ifdef __cplusplus
163class GLUtesselator;
164#else
165typedef struct GLUtesselator GLUtesselator;
166#endif
167
170
171#define GLU_TESS_MAX_COORD 1.0e150
172
173/* Internal convenience typedefs */
174typedef void (GLAPIENTRYP _GLUfuncptr)();
175
176GLAPI void GLAPIENTRY gluBeginPolygon (GLUtesselator* tess);
177GLAPI GLboolean GLAPIENTRY gluCheckExtension (const GLubyte *extName, const GLubyte *extString);
178GLAPI void GLAPIENTRY gluDeleteTess (GLUtesselator* tess);
179GLAPI void GLAPIENTRY gluEndPolygon (GLUtesselator* tess);
180GLAPI const GLubyte * GLAPIENTRY gluErrorString (GLenum error);
181GLAPI const GLubyte * GLAPIENTRY gluGetString (GLenum name);
182GLAPI void GLAPIENTRY gluGetTessProperty (GLUtesselator* tess, GLenum which, GLdouble* data);
183GLAPI GLUtesselator* GLAPIENTRY gluNewTess (void);
184GLAPI void GLAPIENTRY gluNextContour (GLUtesselator* tess, GLenum type);
185GLAPI void GLAPIENTRY gluTessBeginContour (GLUtesselator* tess);
186GLAPI void GLAPIENTRY gluTessBeginPolygon (GLUtesselator* tess, GLvoid* data);
187GLAPI void GLAPIENTRY gluTessCallback (GLUtesselator* tess, GLenum which, _GLUfuncptr CallBackFunc);
188GLAPI void GLAPIENTRY gluTessEndContour (GLUtesselator* tess);
189GLAPI void GLAPIENTRY gluTessEndPolygon (GLUtesselator* tess);
190GLAPI void GLAPIENTRY gluTessNormal (GLUtesselator* tess, GLdouble valueX, GLdouble valueY, GLdouble valueZ);
191GLAPI void GLAPIENTRY gluTessProperty (GLUtesselator* tess, GLenum which, GLdouble data);
192GLAPI void GLAPIENTRY gluTessVertex (GLUtesselator* tess, GLdouble *location, GLvoid* data);
193
194#ifdef __cplusplus
195}
196#endif
197
198#endif /* __libtess2_h__ */