Stellarium 0.15.2
glues.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  * OpenGL ES 1.0 CM port of part of GLUES by Mike Gorchak <mike@malva.ua>
31  *
32  * Important: Fabien Chereau - September 2009
33  * Most of the content was ripped out for the use of Stellarium
34  *
35  */
36 
37 #ifndef __glues_h__
38 #define __glues_h__
39 
40 //just include Qt's OpenGL wrapper instead of our own selection logic
41 #include <qopengl.h>
42 
43 #ifdef __cplusplus
44  extern "C" {
45 #endif
46 
47 /*************************************************************/
48 
49 /* ErrorCode */
50 #define GLUES_INVALID_ENUM 100900
51 #define GLUES_INVALID_VALUE 100901
52 #define GLUES_OUT_OF_MEMORY 100902
53 #define GLUES_INCOMPATIBLE_GL_VERSION 100903
54 #define GLUES_INVALID_OPERATION 100904
55 
56 /*************************************************************/
57 
58 typedef struct GLUEStesselator GLUEStesselator;
61 
62 /* Internal convenience typedefs */
63 typedef void (* _GLUESfuncptr)();
64 
65 GLint gluesBuild2DMipmapLevels(GLenum target, GLint internalFormat,
66  GLsizei width, GLsizei height, GLenum format,
67  GLenum type, GLint userLevel, GLint baseLevel,
68  GLint maxLevel, const void *data);
69 GLint gluesBuild2DMipmaps(GLenum target, GLint internalFormat,
70  GLsizei width, GLsizei height, GLenum format,
71  GLenum type, const void* data);
72 
73 #ifndef GLUES_TESS_MAX_COORD
74 #define GLUES_TESS_MAX_COORD 1.0e37f
75 #endif
76 
77 /* TessCallback */
78 #define GLUES_TESS_BEGIN 100100
79 #define GLUES_BEGIN 100100
80 #define GLUES_TESS_VERTEX 100101
81 #define GLUES_VERTEX 100101
82 #define GLUES_TESS_END 100102
83 #define GLUES_END 100102
84 #define GLUES_TESS_ERROR 100103
85 #define GLUES_TESS_EDGE_FLAG 100104
86 #define GLUES_EDGE_FLAG 100104
87 #define GLUES_TESS_COMBINE 100105
88 #define GLUES_TESS_BEGIN_DATA 100106
89 #define GLUES_TESS_VERTEX_DATA 100107
90 #define GLUES_TESS_END_DATA 100108
91 #define GLUES_TESS_ERROR_DATA 100109
92 #define GLUES_TESS_EDGE_FLAG_DATA 100110
93 #define GLUES_TESS_COMBINE_DATA 100111
94 
95 /* TessContour */
96 #define GLUES_CW 100120
97 #define GLUES_CCW 100121
98 #define GLUES_INTERIOR 100122
99 #define GLUES_EXTERIOR 100123
100 #define GLUES_UNKNOWN 100124
101 
102 /* TessProperty */
103 #define GLUES_TESS_WINDING_RULE 100140
104 #define GLUES_TESS_BOUNDARY_ONLY 100141
105 #define GLUES_TESS_TOLERANCE 100142
106 
107 /* TessError */
108 #define GLUES_TESS_ERROR1 100151
109 #define GLUES_TESS_ERROR2 100152
110 #define GLUES_TESS_ERROR3 100153
111 #define GLUES_TESS_ERROR4 100154
112 #define GLUES_TESS_ERROR5 100155
113 #define GLUES_TESS_ERROR6 100156
114 #define GLUES_TESS_ERROR7 100157
115 #define GLUES_TESS_ERROR8 100158
116 #define GLUES_TESS_MISSING_BEGIN_POLYGON 100151
117 #define GLUES_TESS_MISSING_BEGIN_CONTOUR 100152
118 #define GLUES_TESS_MISSING_END_POLYGON 100153
119 #define GLUES_TESS_MISSING_END_CONTOUR 100154
120 #define GLUES_TESS_COORD_TOO_LARGE 100155
121 #define GLUES_TESS_NEED_COMBINE_CALLBACK 100156
122 
123 /* TessWinding */
124 #define GLUES_TESS_WINDING_ODD 100130
125 #define GLUES_TESS_WINDING_NONZERO 100131
126 #define GLUES_TESS_WINDING_POSITIVE 100132
127 #define GLUES_TESS_WINDING_NEGATIVE 100133
128 #define GLUES_TESS_WINDING_ABS_GEQ_TWO 100134
129 
130 void gluesBeginPolygon(GLUEStesselator* tess);
131 void gluesDeleteTess(GLUEStesselator* tess);
132 void gluesEndPolygon(GLUEStesselator* tess);
133 void gluesGetTessProperty(GLUEStesselator* tess, GLenum which, double* data);
134 GLUEStesselator* gluesNewTess(void);
135 void gluesNextContour(GLUEStesselator* tess, GLenum type);
136 void gluesTessBeginContour(GLUEStesselator* tess);
137 void gluesTessBeginPolygon(GLUEStesselator* tess, GLvoid* data);
138 void gluesTessCallback(GLUEStesselator* tess, GLenum which, _GLUESfuncptr CallBackFunc);
139 void gluesTessEndContour(GLUEStesselator* tess);
140 void gluesTessEndPolygon(GLUEStesselator* tess);
141 void gluesTessNormal(GLUEStesselator* tess, double valueX, double valueY, double valueZ);
142 void gluesTessProperty(GLUEStesselator* tess, GLenum which, double data);
143 void gluesTessVertex(GLUEStesselator* tess, double* location, GLvoid* data);
144 
145 const GLubyte* gluesErrorString(GLenum errorCode);
146 
147 #ifdef __cplusplus
148 }
149 #endif
150 
151 #endif /* __glues_h__ */