jtg | afb833d | 1999-08-19 00:55:39 +0000 | [diff] [blame] | 1 | /* |
Brian Paul | 1bb327e | 2001-03-17 00:29:47 +0000 | [diff] [blame] | 2 | ** License Applicability. Except to the extent portions of this file are |
| 3 | ** made subject to an alternative license as permitted in the SGI Free |
| 4 | ** Software License B, Version 1.1 (the "License"), the contents of this |
| 5 | ** file are subject only to the provisions of the License. You may not use |
| 6 | ** this file except in compliance with the License. You may obtain a copy |
| 7 | ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 |
| 8 | ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: |
| 9 | ** |
| 10 | ** http://oss.sgi.com/projects/FreeB |
| 11 | ** |
| 12 | ** Note that, as provided in the License, the Software is distributed on an |
| 13 | ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS |
| 14 | ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND |
| 15 | ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A |
| 16 | ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. |
| 17 | ** |
| 18 | ** Original Code. The Original Code is: OpenGL Sample Implementation, |
| 19 | ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, |
| 20 | ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. |
| 21 | ** Copyright in any portions created by third parties is as indicated |
| 22 | ** elsewhere herein. All Rights Reserved. |
| 23 | ** |
| 24 | ** Additional Notice Provisions: This software was created using the |
| 25 | ** OpenGL(R) version 1.2.1 Sample Implementation published by SGI, but has |
| 26 | ** not been independently verified as being compliant with the OpenGL(R) |
| 27 | ** version 1.2.1 Specification. |
| 28 | */ |
jtg | afb833d | 1999-08-19 00:55:39 +0000 | [diff] [blame] | 29 | |
Brian Paul | 1bb327e | 2001-03-17 00:29:47 +0000 | [diff] [blame] | 30 | #ifndef __glu_h__ |
| 31 | #define __glu_h__ |
jtg | afb833d | 1999-08-19 00:55:39 +0000 | [diff] [blame] | 32 | |
Brian Paul | 1bb327e | 2001-03-17 00:29:47 +0000 | [diff] [blame] | 33 | #include <GL/gl.h> |
jtg | afb833d | 1999-08-19 00:55:39 +0000 | [diff] [blame] | 34 | |
| 35 | #ifdef __cplusplus |
| 36 | extern "C" { |
| 37 | #endif |
| 38 | |
Brian Paul | 1bb327e | 2001-03-17 00:29:47 +0000 | [diff] [blame] | 39 | /*************************************************************/ |
jtg | afb833d | 1999-08-19 00:55:39 +0000 | [diff] [blame] | 40 | |
Brian Paul | 1bb327e | 2001-03-17 00:29:47 +0000 | [diff] [blame] | 41 | /* Extensions */ |
| 42 | #define GLU_EXT_object_space_tess 1 |
| 43 | #define GLU_EXT_nurbs_tessellator 1 |
| 44 | |
| 45 | /* Boolean */ |
| 46 | #define GLU_FALSE 0 |
| 47 | #define GLU_TRUE 1 |
| 48 | |
| 49 | /* Version */ |
| 50 | #define GLU_VERSION_1_1 1 |
| 51 | #define GLU_VERSION_1_2 1 |
| 52 | #define GLU_VERSION_1_3 1 |
| 53 | |
| 54 | /* StringName */ |
| 55 | #define GLU_VERSION 100800 |
| 56 | #define GLU_EXTENSIONS 100801 |
| 57 | |
| 58 | /* ErrorCode */ |
| 59 | #define GLU_INVALID_ENUM 100900 |
| 60 | #define GLU_INVALID_VALUE 100901 |
| 61 | #define GLU_OUT_OF_MEMORY 100902 |
| 62 | #define GLU_INVALID_OPERATION 100904 |
| 63 | |
| 64 | /* NurbsDisplay */ |
| 65 | /* GLU_FILL */ |
| 66 | #define GLU_OUTLINE_POLYGON 100240 |
| 67 | #define GLU_OUTLINE_PATCH 100241 |
| 68 | |
| 69 | /* NurbsCallback */ |
| 70 | #define GLU_NURBS_ERROR 100103 |
| 71 | #define GLU_ERROR 100103 |
| 72 | #define GLU_NURBS_BEGIN 100164 |
| 73 | #define GLU_NURBS_BEGIN_EXT 100164 |
| 74 | #define GLU_NURBS_VERTEX 100165 |
| 75 | #define GLU_NURBS_VERTEX_EXT 100165 |
| 76 | #define GLU_NURBS_NORMAL 100166 |
| 77 | #define GLU_NURBS_NORMAL_EXT 100166 |
| 78 | #define GLU_NURBS_COLOR 100167 |
| 79 | #define GLU_NURBS_COLOR_EXT 100167 |
| 80 | #define GLU_NURBS_TEXTURE_COORD 100168 |
| 81 | #define GLU_NURBS_TEX_COORD_EXT 100168 |
| 82 | #define GLU_NURBS_END 100169 |
| 83 | #define GLU_NURBS_END_EXT 100169 |
| 84 | #define GLU_NURBS_BEGIN_DATA 100170 |
| 85 | #define GLU_NURBS_BEGIN_DATA_EXT 100170 |
| 86 | #define GLU_NURBS_VERTEX_DATA 100171 |
| 87 | #define GLU_NURBS_VERTEX_DATA_EXT 100171 |
| 88 | #define GLU_NURBS_NORMAL_DATA 100172 |
| 89 | #define GLU_NURBS_NORMAL_DATA_EXT 100172 |
| 90 | #define GLU_NURBS_COLOR_DATA 100173 |
| 91 | #define GLU_NURBS_COLOR_DATA_EXT 100173 |
| 92 | #define GLU_NURBS_TEXTURE_COORD_DATA 100174 |
| 93 | #define GLU_NURBS_TEX_COORD_DATA_EXT 100174 |
| 94 | #define GLU_NURBS_END_DATA 100175 |
| 95 | #define GLU_NURBS_END_DATA_EXT 100175 |
| 96 | |
| 97 | /* NurbsError */ |
| 98 | #define GLU_NURBS_ERROR1 100251 |
| 99 | #define GLU_NURBS_ERROR2 100252 |
| 100 | #define GLU_NURBS_ERROR3 100253 |
| 101 | #define GLU_NURBS_ERROR4 100254 |
| 102 | #define GLU_NURBS_ERROR5 100255 |
| 103 | #define GLU_NURBS_ERROR6 100256 |
| 104 | #define GLU_NURBS_ERROR7 100257 |
| 105 | #define GLU_NURBS_ERROR8 100258 |
| 106 | #define GLU_NURBS_ERROR9 100259 |
| 107 | #define GLU_NURBS_ERROR10 100260 |
| 108 | #define GLU_NURBS_ERROR11 100261 |
| 109 | #define GLU_NURBS_ERROR12 100262 |
| 110 | #define GLU_NURBS_ERROR13 100263 |
| 111 | #define GLU_NURBS_ERROR14 100264 |
| 112 | #define GLU_NURBS_ERROR15 100265 |
| 113 | #define GLU_NURBS_ERROR16 100266 |
| 114 | #define GLU_NURBS_ERROR17 100267 |
| 115 | #define GLU_NURBS_ERROR18 100268 |
| 116 | #define GLU_NURBS_ERROR19 100269 |
| 117 | #define GLU_NURBS_ERROR20 100270 |
| 118 | #define GLU_NURBS_ERROR21 100271 |
| 119 | #define GLU_NURBS_ERROR22 100272 |
| 120 | #define GLU_NURBS_ERROR23 100273 |
| 121 | #define GLU_NURBS_ERROR24 100274 |
| 122 | #define GLU_NURBS_ERROR25 100275 |
| 123 | #define GLU_NURBS_ERROR26 100276 |
| 124 | #define GLU_NURBS_ERROR27 100277 |
| 125 | #define GLU_NURBS_ERROR28 100278 |
| 126 | #define GLU_NURBS_ERROR29 100279 |
| 127 | #define GLU_NURBS_ERROR30 100280 |
| 128 | #define GLU_NURBS_ERROR31 100281 |
| 129 | #define GLU_NURBS_ERROR32 100282 |
| 130 | #define GLU_NURBS_ERROR33 100283 |
| 131 | #define GLU_NURBS_ERROR34 100284 |
| 132 | #define GLU_NURBS_ERROR35 100285 |
| 133 | #define GLU_NURBS_ERROR36 100286 |
| 134 | #define GLU_NURBS_ERROR37 100287 |
| 135 | |
| 136 | /* NurbsProperty */ |
| 137 | #define GLU_AUTO_LOAD_MATRIX 100200 |
| 138 | #define GLU_CULLING 100201 |
| 139 | #define GLU_SAMPLING_TOLERANCE 100203 |
| 140 | #define GLU_DISPLAY_MODE 100204 |
| 141 | #define GLU_PARAMETRIC_TOLERANCE 100202 |
| 142 | #define GLU_SAMPLING_METHOD 100205 |
| 143 | #define GLU_U_STEP 100206 |
| 144 | #define GLU_V_STEP 100207 |
| 145 | #define GLU_NURBS_MODE 100160 |
| 146 | #define GLU_NURBS_MODE_EXT 100160 |
| 147 | #define GLU_NURBS_TESSELLATOR 100161 |
| 148 | #define GLU_NURBS_TESSELLATOR_EXT 100161 |
| 149 | #define GLU_NURBS_RENDERER 100162 |
| 150 | #define GLU_NURBS_RENDERER_EXT 100162 |
| 151 | |
| 152 | /* NurbsSampling */ |
| 153 | #define GLU_OBJECT_PARAMETRIC_ERROR 100208 |
| 154 | #define GLU_OBJECT_PARAMETRIC_ERROR_EXT 100208 |
| 155 | #define GLU_OBJECT_PATH_LENGTH 100209 |
| 156 | #define GLU_OBJECT_PATH_LENGTH_EXT 100209 |
| 157 | #define GLU_PATH_LENGTH 100215 |
| 158 | #define GLU_PARAMETRIC_ERROR 100216 |
| 159 | #define GLU_DOMAIN_DISTANCE 100217 |
| 160 | |
| 161 | /* NurbsTrim */ |
| 162 | #define GLU_MAP1_TRIM_2 100210 |
| 163 | #define GLU_MAP1_TRIM_3 100211 |
| 164 | |
| 165 | /* QuadricDrawStyle */ |
| 166 | #define GLU_POINT 100010 |
| 167 | #define GLU_LINE 100011 |
| 168 | #define GLU_FILL 100012 |
| 169 | #define GLU_SILHOUETTE 100013 |
| 170 | |
| 171 | /* QuadricCallback */ |
| 172 | /* GLU_ERROR */ |
| 173 | |
| 174 | /* QuadricNormal */ |
| 175 | #define GLU_SMOOTH 100000 |
| 176 | #define GLU_FLAT 100001 |
| 177 | #define GLU_NONE 100002 |
| 178 | |
| 179 | /* QuadricOrientation */ |
| 180 | #define GLU_OUTSIDE 100020 |
| 181 | #define GLU_INSIDE 100021 |
| 182 | |
| 183 | /* TessCallback */ |
| 184 | #define GLU_TESS_BEGIN 100100 |
| 185 | #define GLU_BEGIN 100100 |
| 186 | #define GLU_TESS_VERTEX 100101 |
| 187 | #define GLU_VERTEX 100101 |
| 188 | #define GLU_TESS_END 100102 |
| 189 | #define GLU_END 100102 |
| 190 | #define GLU_TESS_ERROR 100103 |
| 191 | #define GLU_TESS_EDGE_FLAG 100104 |
| 192 | #define GLU_EDGE_FLAG 100104 |
| 193 | #define GLU_TESS_COMBINE 100105 |
| 194 | #define GLU_TESS_BEGIN_DATA 100106 |
| 195 | #define GLU_TESS_VERTEX_DATA 100107 |
| 196 | #define GLU_TESS_END_DATA 100108 |
| 197 | #define GLU_TESS_ERROR_DATA 100109 |
| 198 | #define GLU_TESS_EDGE_FLAG_DATA 100110 |
| 199 | #define GLU_TESS_COMBINE_DATA 100111 |
| 200 | |
| 201 | /* TessContour */ |
| 202 | #define GLU_CW 100120 |
| 203 | #define GLU_CCW 100121 |
| 204 | #define GLU_INTERIOR 100122 |
| 205 | #define GLU_EXTERIOR 100123 |
| 206 | #define GLU_UNKNOWN 100124 |
| 207 | |
| 208 | /* TessProperty */ |
| 209 | #define GLU_TESS_WINDING_RULE 100140 |
| 210 | #define GLU_TESS_BOUNDARY_ONLY 100141 |
| 211 | #define GLU_TESS_TOLERANCE 100142 |
| 212 | |
| 213 | /* TessError */ |
| 214 | #define GLU_TESS_ERROR1 100151 |
| 215 | #define GLU_TESS_ERROR2 100152 |
| 216 | #define GLU_TESS_ERROR3 100153 |
| 217 | #define GLU_TESS_ERROR4 100154 |
| 218 | #define GLU_TESS_ERROR5 100155 |
| 219 | #define GLU_TESS_ERROR6 100156 |
| 220 | #define GLU_TESS_ERROR7 100157 |
| 221 | #define GLU_TESS_ERROR8 100158 |
| 222 | #define GLU_TESS_MISSING_BEGIN_POLYGON 100151 |
| 223 | #define GLU_TESS_MISSING_BEGIN_CONTOUR 100152 |
| 224 | #define GLU_TESS_MISSING_END_POLYGON 100153 |
| 225 | #define GLU_TESS_MISSING_END_CONTOUR 100154 |
| 226 | #define GLU_TESS_COORD_TOO_LARGE 100155 |
| 227 | #define GLU_TESS_NEED_COMBINE_CALLBACK 100156 |
| 228 | |
| 229 | /* TessWinding */ |
| 230 | #define GLU_TESS_WINDING_ODD 100130 |
| 231 | #define GLU_TESS_WINDING_NONZERO 100131 |
| 232 | #define GLU_TESS_WINDING_POSITIVE 100132 |
| 233 | #define GLU_TESS_WINDING_NEGATIVE 100133 |
| 234 | #define GLU_TESS_WINDING_ABS_GEQ_TWO 100134 |
| 235 | |
| 236 | /*************************************************************/ |
Brian Paul | f886023 | 2000-07-11 14:11:04 +0000 | [diff] [blame] | 237 | |
| 238 | |
Brian Paul | 1bb327e | 2001-03-17 00:29:47 +0000 | [diff] [blame] | 239 | #ifdef __cplusplus |
| 240 | class GLUnurbs; |
| 241 | class GLUquadric; |
| 242 | class GLUtesselator; |
jtg | afb833d | 1999-08-19 00:55:39 +0000 | [diff] [blame] | 243 | #else |
Brian Paul | 1bb327e | 2001-03-17 00:29:47 +0000 | [diff] [blame] | 244 | typedef struct GLUnurbs GLUnurbs; |
| 245 | typedef struct GLUquadric GLUquadric; |
| 246 | typedef struct GLUtesselator GLUtesselator; |
Brian Paul | 08f0374 | 2000-05-22 16:21:27 +0000 | [diff] [blame] | 247 | #endif |
| 248 | |
Brian Paul | 1bb327e | 2001-03-17 00:29:47 +0000 | [diff] [blame] | 249 | typedef struct GLUnurbs GLUnurbsObj; |
| 250 | typedef struct GLUquadric GLUquadricObj; |
| 251 | typedef struct GLUtesselator GLUtesselatorObj; |
| 252 | typedef struct GLUtesselator GLUtriangulatorObj; |
Brian Paul | 08f0374 | 2000-05-22 16:21:27 +0000 | [diff] [blame] | 253 | |
Brian Paul | 1bb327e | 2001-03-17 00:29:47 +0000 | [diff] [blame] | 254 | #define GLU_TESS_MAX_COORD 1.0e150 |
jtg | afb833d | 1999-08-19 00:55:39 +0000 | [diff] [blame] | 255 | |
Brian Paul | 1bb327e | 2001-03-17 00:29:47 +0000 | [diff] [blame] | 256 | /* Internal convenience typedefs */ |
| 257 | typedef void (*_GLUfuncptr)(); |
Brian Paul | a6f09fa | 1999-10-22 10:47:01 +0000 | [diff] [blame] | 258 | |
Brian Paul | 1bb327e | 2001-03-17 00:29:47 +0000 | [diff] [blame] | 259 | extern void gluBeginCurve (GLUnurbs* nurb); |
| 260 | extern void gluBeginPolygon (GLUtesselator* tess); |
| 261 | extern void gluBeginSurface (GLUnurbs* nurb); |
| 262 | extern void gluBeginTrim (GLUnurbs* nurb); |
| 263 | extern GLint gluBuild1DMipmapLevels (GLenum target, GLint internalFormat, GLsizei width, GLenum format, GLenum type, GLint level, GLint base, GLint max, const void *data); |
| 264 | extern GLint gluBuild1DMipmaps (GLenum target, GLint internalFormat, GLsizei width, GLenum format, GLenum type, const void *data); |
| 265 | extern GLint gluBuild2DMipmapLevels (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint level, GLint base, GLint max, const void *data); |
| 266 | extern GLint gluBuild2DMipmaps (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *data); |
| 267 | extern GLint gluBuild3DMipmapLevels (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLint level, GLint base, GLint max, const void *data); |
| 268 | extern GLint gluBuild3DMipmaps (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *data); |
| 269 | extern GLboolean gluCheckExtension (const GLubyte *extName, const GLubyte *extString); |
| 270 | extern void gluCylinder (GLUquadric* quad, GLdouble base, GLdouble top, GLdouble height, GLint slices, GLint stacks); |
| 271 | extern void gluDeleteNurbsRenderer (GLUnurbs* nurb); |
| 272 | extern void gluDeleteQuadric (GLUquadric* quad); |
| 273 | extern void gluDeleteTess (GLUtesselator* tess); |
| 274 | extern void gluDisk (GLUquadric* quad, GLdouble inner, GLdouble outer, GLint slices, GLint loops); |
| 275 | extern void gluEndCurve (GLUnurbs* nurb); |
| 276 | extern void gluEndPolygon (GLUtesselator* tess); |
| 277 | extern void gluEndSurface (GLUnurbs* nurb); |
| 278 | extern void gluEndTrim (GLUnurbs* nurb); |
| 279 | extern const GLubyte * gluErrorString (GLenum error); |
| 280 | extern void gluGetNurbsProperty (GLUnurbs* nurb, GLenum property, GLfloat* data); |
| 281 | extern const GLubyte * gluGetString (GLenum name); |
| 282 | extern void gluGetTessProperty (GLUtesselator* tess, GLenum which, GLdouble* data); |
| 283 | extern void gluLoadSamplingMatrices (GLUnurbs* nurb, const GLfloat *model, const GLfloat *perspective, const GLint *view); |
| 284 | extern void gluLookAt (GLdouble eyeX, GLdouble eyeY, GLdouble eyeZ, GLdouble centerX, GLdouble centerY, GLdouble centerZ, GLdouble upX, GLdouble upY, GLdouble upZ); |
| 285 | extern GLUnurbs* gluNewNurbsRenderer (void); |
| 286 | extern GLUquadric* gluNewQuadric (void); |
| 287 | extern GLUtesselator* gluNewTess (void); |
| 288 | extern void gluNextContour (GLUtesselator* tess, GLenum type); |
| 289 | extern void gluNurbsCallback (GLUnurbs* nurb, GLenum which, _GLUfuncptr CallBackFunc); |
| 290 | extern void gluNurbsCallbackData (GLUnurbs* nurb, GLvoid* userData); |
| 291 | extern void gluNurbsCallbackDataEXT (GLUnurbs* nurb, GLvoid* userData); |
| 292 | extern void gluNurbsCurve (GLUnurbs* nurb, GLint knotCount, GLfloat *knots, GLint stride, GLfloat *control, GLint order, GLenum type); |
| 293 | extern void gluNurbsProperty (GLUnurbs* nurb, GLenum property, GLfloat value); |
| 294 | extern void gluNurbsSurface (GLUnurbs* nurb, GLint sKnotCount, GLfloat* sKnots, GLint tKnotCount, GLfloat* tKnots, GLint sStride, GLint tStride, GLfloat* control, GLint sOrder, GLint tOrder, GLenum type); |
| 295 | extern void gluOrtho2D (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top); |
| 296 | extern void gluPartialDisk (GLUquadric* quad, GLdouble inner, GLdouble outer, GLint slices, GLint loops, GLdouble start, GLdouble sweep); |
| 297 | extern void gluPerspective (GLdouble fovy, GLdouble aspect, GLdouble zNear, GLdouble zFar); |
| 298 | extern void gluPickMatrix (GLdouble x, GLdouble y, GLdouble delX, GLdouble delY, GLint *viewport); |
| 299 | extern GLint gluProject (GLdouble objX, GLdouble objY, GLdouble objZ, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble* winX, GLdouble* winY, GLdouble* winZ); |
| 300 | extern void gluPwlCurve (GLUnurbs* nurb, GLint count, GLfloat* data, GLint stride, GLenum type); |
| 301 | extern void gluQuadricCallback (GLUquadric* quad, GLenum which, _GLUfuncptr CallBackFunc); |
| 302 | extern void gluQuadricDrawStyle (GLUquadric* quad, GLenum draw); |
| 303 | extern void gluQuadricNormals (GLUquadric* quad, GLenum normal); |
| 304 | extern void gluQuadricOrientation (GLUquadric* quad, GLenum orientation); |
| 305 | extern void gluQuadricTexture (GLUquadric* quad, GLboolean texture); |
| 306 | extern GLint gluScaleImage (GLenum format, GLsizei wIn, GLsizei hIn, GLenum typeIn, const void *dataIn, GLsizei wOut, GLsizei hOut, GLenum typeOut, GLvoid* dataOut); |
| 307 | extern void gluSphere (GLUquadric* quad, GLdouble radius, GLint slices, GLint stacks); |
| 308 | extern void gluTessBeginContour (GLUtesselator* tess); |
| 309 | extern void gluTessBeginPolygon (GLUtesselator* tess, GLvoid* data); |
| 310 | extern void gluTessCallback (GLUtesselator* tess, GLenum which, _GLUfuncptr CallBackFunc); |
| 311 | extern void gluTessEndContour (GLUtesselator* tess); |
| 312 | extern void gluTessEndPolygon (GLUtesselator* tess); |
| 313 | extern void gluTessNormal (GLUtesselator* tess, GLdouble valueX, GLdouble valueY, GLdouble valueZ); |
| 314 | extern void gluTessProperty (GLUtesselator* tess, GLenum which, GLdouble data); |
| 315 | extern void gluTessVertex (GLUtesselator* tess, GLdouble *location, GLvoid* data); |
| 316 | extern GLint gluUnProject (GLdouble winX, GLdouble winY, GLdouble winZ, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble* objX, GLdouble* objY, GLdouble* objZ); |
| 317 | extern GLint gluUnProject4 (GLdouble winX, GLdouble winY, GLdouble winZ, GLdouble clipW, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble near, GLdouble far, GLdouble* objX, GLdouble* objY, GLdouble* objZ, GLdouble* objW); |
jtg | afb833d | 1999-08-19 00:55:39 +0000 | [diff] [blame] | 318 | |
| 319 | #ifdef __cplusplus |
| 320 | } |
| 321 | #endif |
| 322 | |
Brian Paul | 1bb327e | 2001-03-17 00:29:47 +0000 | [diff] [blame] | 323 | #endif /* __glu_h__ */ |