OSDN Git Service

FIRST REPOSITORY
[eos/hostdependOTHERS.git] / SGI / util / SGI / include / GL / glu.h
1 /* $Id: glu.h,v 1.1.1.1 2002/02/01 06:30:43 tacyas Exp $ */
2
3 /*
4  * Mesa 3-D graphics library
5  * Version:  2.6
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: glu.h,v $
26  * Revision 1.1.1.1  2002/02/01 06:30:43  tacyas
27  * Initail Import Into CVS
28  *
29  * Revision 1.9  1998/01/16 02:29:26  brianp
30  * minor changes for Windows compilation (Theodore Jump)
31  *
32  * Revision 1.8  1997/10/29 02:03:20  brianp
33  * added WINGDIAPI, APIENTRY stuff (David Bucciarelli, v20 3dfx driver)
34  *
35  * Revision 1.7  1997/08/19 02:35:07  brianp
36  * added some Macintosh-only pragmas (Miklos Fazekas)
37  *
38  * Revision 1.6  1997/07/13 22:59:34  brianp
39  * added const to viewport parameter of gluPickMatrix()
40  *
41  * Revision 1.5  1997/05/28 02:31:01  brianp
42  * added a comment about typedefs
43  *
44  * Revision 1.4  1997/02/19 10:13:54  brianp
45  * now test for __QUICKDRAW__ like for __BEOS__ (Randy Frank)
46  *
47  * Revision 1.3  1997/02/03 20:05:33  brianp
48  * patches for BeOS
49  *
50  * Revision 1.2  1997/02/03 19:15:15  brianp
51  * conditionally include glu_mangle.h
52  *
53  * Revision 1.1  1996/09/13 01:26:41  brianp
54  * Initial revision
55  *
56  */
57
58
59 #ifndef GLU_H
60 #define GLU_H
61
62
63 #if defined(USE_MGL_NAMESPACE)
64 #include "glu_mangle.h"
65 #endif
66
67
68 #ifdef __cplusplus
69 extern "C" {
70 #endif
71
72
73 #include "GL/gl.h"
74
75
76 #ifdef macintosh
77         #pragma enumsalwaysint on
78         #if PRAGMA_IMPORT_SUPPORTED
79         #pragma import on
80         #endif
81 #endif
82
83
84 #define GLU_VERSION_1_1         1
85
86
87 #define GLU_TRUE   GL_TRUE
88 #define GLU_FALSE  GL_FALSE
89
90
91 enum {
92         /* Normal vectors */
93         GLU_SMOOTH      = 100000,
94         GLU_FLAT        = 100001,
95         GLU_NONE        = 100002,
96
97         /* Quadric draw styles */
98         GLU_POINT       = 100010,
99         GLU_LINE        = 100011,
100         GLU_FILL        = 100012,
101         GLU_SILHOUETTE  = 100013,
102
103         /* Quadric orientation */
104         GLU_OUTSIDE     = 100020,
105         GLU_INSIDE      = 100021,
106
107         /* Tesselator */
108         GLU_BEGIN       = 100100,
109         GLU_VERTEX      = 100101,
110         GLU_END         = 100102,
111         GLU_ERROR       = 100103,
112         GLU_EDGE_FLAG   = 100104,
113
114         /* Contour types */
115         GLU_CW          = 100120,
116         GLU_CCW         = 100121,
117         GLU_INTERIOR    = 100122,
118         GLU_EXTERIOR    = 100123,
119         GLU_UNKNOWN     = 100124,
120
121         /* Tesselation errors */
122         GLU_TESS_ERROR1 = 100151,  /* missing gluEndPolygon */
123         GLU_TESS_ERROR2 = 100152,  /* missing gluBeginPolygon */
124         GLU_TESS_ERROR3 = 100153,  /* misoriented contour */
125         GLU_TESS_ERROR4 = 100154,  /* vertex/edge intersection */
126         GLU_TESS_ERROR5 = 100155,  /* misoriented or self-intersecting loops */
127         GLU_TESS_ERROR6 = 100156,  /* coincident vertices */
128         GLU_TESS_ERROR7 = 100157,  /* all vertices collinear */
129         GLU_TESS_ERROR8 = 100158,  /* intersecting edges */
130         GLU_TESS_ERROR9 = 100159,  /* not coplanar contours */
131
132         /* NURBS */
133         GLU_AUTO_LOAD_MATRIX    = 100200,
134         GLU_CULLING             = 100201,
135         GLU_PARAMETRIC_TOLERANCE= 100202,
136         GLU_SAMPLING_TOLERANCE  = 100203,
137         GLU_DISPLAY_MODE        = 100204,
138         GLU_SAMPLING_METHOD     = 100205,
139         GLU_U_STEP              = 100206,
140         GLU_V_STEP              = 100207,
141
142         GLU_PATH_LENGTH         = 100215,
143         GLU_PARAMETRIC_ERROR    = 100216,
144         GLU_DOMAIN_DISTANCE     = 100217,
145
146         GLU_MAP1_TRIM_2         = 100210,
147         GLU_MAP1_TRIM_3         = 100211,
148
149         GLU_OUTLINE_POLYGON     = 100240,
150         GLU_OUTLINE_PATCH       = 100241,
151
152         GLU_NURBS_ERROR1  = 100251,   /* spline order un-supported */
153         GLU_NURBS_ERROR2  = 100252,   /* too few knots */
154         GLU_NURBS_ERROR3  = 100253,   /* valid knot range is empty */
155         GLU_NURBS_ERROR4  = 100254,   /* decreasing knot sequence */
156         GLU_NURBS_ERROR5  = 100255,   /* knot multiplicity > spline order */
157         GLU_NURBS_ERROR6  = 100256,   /* endcurve() must follow bgncurve() */
158         GLU_NURBS_ERROR7  = 100257,   /* bgncurve() must precede endcurve() */
159         GLU_NURBS_ERROR8  = 100258,   /* ctrlarray or knot vector is NULL */
160         GLU_NURBS_ERROR9  = 100259,   /* can't draw pwlcurves */
161         GLU_NURBS_ERROR10 = 100260,   /* missing gluNurbsCurve() */
162         GLU_NURBS_ERROR11 = 100261,   /* missing gluNurbsSurface() */
163         GLU_NURBS_ERROR12 = 100262,   /* endtrim() must precede endsurface() */
164         GLU_NURBS_ERROR13 = 100263,   /* bgnsurface() must precede endsurface() */
165         GLU_NURBS_ERROR14 = 100264,   /* curve of improper type passed as trim curve */
166         GLU_NURBS_ERROR15 = 100265,   /* bgnsurface() must precede bgntrim() */
167         GLU_NURBS_ERROR16 = 100266,   /* endtrim() must follow bgntrim() */
168         GLU_NURBS_ERROR17 = 100267,   /* bgntrim() must precede endtrim()*/
169         GLU_NURBS_ERROR18 = 100268,   /* invalid or missing trim curve*/
170         GLU_NURBS_ERROR19 = 100269,   /* bgntrim() must precede pwlcurve() */
171         GLU_NURBS_ERROR20 = 100270,   /* pwlcurve referenced twice*/
172         GLU_NURBS_ERROR21 = 100271,   /* pwlcurve and nurbscurve mixed */
173         GLU_NURBS_ERROR22 = 100272,   /* improper usage of trim data type */
174         GLU_NURBS_ERROR23 = 100273,   /* nurbscurve referenced twice */
175         GLU_NURBS_ERROR24 = 100274,   /* nurbscurve and pwlcurve mixed */
176         GLU_NURBS_ERROR25 = 100275,   /* nurbssurface referenced twice */
177         GLU_NURBS_ERROR26 = 100276,   /* invalid property */
178         GLU_NURBS_ERROR27 = 100277,   /* endsurface() must follow bgnsurface() */
179         GLU_NURBS_ERROR28 = 100278,   /* intersecting or misoriented trim curves */
180         GLU_NURBS_ERROR29 = 100279,   /* intersecting trim curves */
181         GLU_NURBS_ERROR30 = 100280,   /* UNUSED */
182         GLU_NURBS_ERROR31 = 100281,   /* unconnected trim curves */
183         GLU_NURBS_ERROR32 = 100282,   /* unknown knot error */
184         GLU_NURBS_ERROR33 = 100283,   /* negative vertex count encountered */
185         GLU_NURBS_ERROR34 = 100284,   /* negative byte-stride */
186         GLU_NURBS_ERROR35 = 100285,   /* unknown type descriptor */
187         GLU_NURBS_ERROR36 = 100286,   /* null control point reference */
188         GLU_NURBS_ERROR37 = 100287,   /* duplicate point on pwlcurve */
189
190         /* Errors */
191         GLU_INVALID_ENUM                = 100900,
192         GLU_INVALID_VALUE               = 100901,
193         GLU_OUT_OF_MEMORY               = 100902,
194         GLU_INCOMPATIBLE_GL_VERSION     = 100903,
195
196         /* New in GLU 1.1 */
197         GLU_VERSION     = 100800,
198         GLU_EXTENSIONS  = 100801
199 };
200
201
202 /*
203  * These are the GLU 1.1 typedefs.  GLU 1.2 has different ones!
204  */
205 typedef struct GLUquadricObj GLUquadricObj;
206
207 typedef struct GLUtriangulatorObj GLUtriangulatorObj;
208
209 typedef struct GLUnurbsObj GLUnurbsObj;
210
211
212
213 #if defined(__BEOS__) || defined(__QUICKDRAW__)
214 #pragma export on
215 #endif
216
217
218 /*
219  *
220  * Miscellaneous functions
221  *
222  */
223
224 extern void APIENTRY gluLookAt( GLdouble eyex, GLdouble eyey, GLdouble eyez,
225                                 GLdouble centerx, GLdouble centery,
226                                 GLdouble centerz,
227                                 GLdouble upx, GLdouble upy, GLdouble upz );
228
229
230 extern void APIENTRY gluOrtho2D( GLdouble left, GLdouble right,
231                                  GLdouble bottom, GLdouble top );
232
233
234 extern void APIENTRY gluPerspective( GLdouble fovy, GLdouble aspect,
235                                      GLdouble zNear, GLdouble zFar );
236
237
238 extern void APIENTRY gluPickMatrix( GLdouble x, GLdouble y,
239                                     GLdouble width, GLdouble height,
240                                     const GLint viewport[4] );
241
242 extern GLint APIENTRY gluProject( GLdouble objx, GLdouble objy, GLdouble objz,
243                                   const GLdouble modelMatrix[16],
244                                   const GLdouble projMatrix[16],
245                                   const GLint viewport[4],
246                                   GLdouble *winx, GLdouble *winy,
247                                   GLdouble *winz );
248
249 extern GLint APIENTRY gluUnProject( GLdouble winx, GLdouble winy,
250                                     GLdouble winz,
251                                     const GLdouble modelMatrix[16],
252                                     const GLdouble projMatrix[16],
253                                     const GLint viewport[4],
254                                     GLdouble *objx, GLdouble *objy,
255                                     GLdouble *objz );
256
257 extern const GLubyte* APIENTRY gluErrorString( GLenum errorCode );
258
259
260
261 /*
262  *
263  * Mipmapping and image scaling
264  *
265  */
266
267 extern GLint APIENTRY gluScaleImage( GLenum format,
268                                      GLint widthin, GLint heightin,
269                                      GLenum typein, const void *datain,
270                                      GLint widthout, GLint heightout,
271                                      GLenum typeout, void *dataout );
272
273 extern GLint APIENTRY gluBuild1DMipmaps( GLenum target, GLint components,
274                                          GLint width, GLenum format,
275                                          GLenum type, const void *data );
276
277 extern GLint APIENTRY gluBuild2DMipmaps( GLenum target, GLint components,
278                                          GLint width, GLint height,
279                                          GLenum format,
280                                          GLenum type, const void *data );
281
282
283
284 /*
285  *
286  * Quadrics
287  *
288  */
289
290 extern GLUquadricObj* APIENTRY gluNewQuadric( void );
291
292 extern void APIENTRY gluDeleteQuadric( GLUquadricObj *state );
293
294 extern void APIENTRY gluQuadricDrawStyle( GLUquadricObj *quadObject,
295                                           GLenum drawStyle );
296
297 extern void APIENTRY gluQuadricOrientation( GLUquadricObj *quadObject,
298                                             GLenum orientation );
299
300 extern void APIENTRY gluQuadricNormals( GLUquadricObj *quadObject,
301                                         GLenum normals );
302
303 extern void APIENTRY gluQuadricTexture( GLUquadricObj *quadObject,
304                                         GLboolean textureCoords );
305
306 extern void APIENTRY gluQuadricCallback( GLUquadricObj *qobj,
307                                          GLenum which, void (CALLBACK *fn)() );
308
309 extern void APIENTRY gluCylinder( GLUquadricObj *qobj,
310                                   GLdouble baseRadius,
311                                   GLdouble topRadius,
312                                   GLdouble height,
313                                   GLint slices, GLint stacks );
314
315 extern void APIENTRY gluSphere( GLUquadricObj *qobj,
316                                 GLdouble radius, GLint slices, GLint stacks );
317
318 extern void APIENTRY gluDisk( GLUquadricObj *qobj,
319                               GLdouble innerRadius, GLdouble outerRadius,
320                               GLint slices, GLint loops );
321
322 extern void APIENTRY gluPartialDisk( GLUquadricObj *qobj, GLdouble innerRadius,
323                                      GLdouble outerRadius, GLint slices,
324                                      GLint loops, GLdouble startAngle,
325                                      GLdouble sweepAngle );
326
327
328
329 /*
330  *
331  * Nurbs
332  *
333  */
334
335 extern GLUnurbsObj* APIENTRY gluNewNurbsRenderer( void );
336
337 extern void APIENTRY gluDeleteNurbsRenderer( GLUnurbsObj *nobj );
338
339 extern void APIENTRY gluLoadSamplingMatrices( GLUnurbsObj *nobj,
340                                               const GLfloat modelMatrix[16],
341                                               const GLfloat projMatrix[16],
342                                               const GLint viewport[4] );
343
344 extern void APIENTRY gluNurbsProperty( GLUnurbsObj *nobj, GLenum property,
345                                        GLfloat value );
346
347 extern void APIENTRY gluGetNurbsProperty( GLUnurbsObj *nobj, GLenum property,
348                                           GLfloat *value );
349
350 extern void APIENTRY gluBeginCurve( GLUnurbsObj *nobj );
351
352 extern void APIENTRY gluEndCurve( GLUnurbsObj * nobj );
353
354 extern void APIENTRY gluNurbsCurve( GLUnurbsObj *nobj, GLint nknots,
355                                     GLfloat *knot, GLint stride,
356                                     GLfloat *ctlarray, GLint order,
357                                     GLenum type );
358
359 extern void APIENTRY gluBeginSurface( GLUnurbsObj *nobj );
360
361 extern void APIENTRY gluEndSurface( GLUnurbsObj * nobj );
362
363 extern void APIENTRY gluNurbsSurface( GLUnurbsObj *nobj,
364                                       GLint sknot_count, GLfloat *sknot,
365                                       GLint tknot_count, GLfloat *tknot,
366                                       GLint s_stride, GLint t_stride,
367                                       GLfloat *ctlarray,
368                                       GLint sorder, GLint torder,
369                                       GLenum type );
370
371 extern void APIENTRY gluBeginTrim( GLUnurbsObj *nobj );
372
373 extern void APIENTRY gluEndTrim( GLUnurbsObj *nobj );
374
375 extern void APIENTRY gluPwlCurve( GLUnurbsObj *nobj, GLint count,
376                                   GLfloat *array, GLint stride, GLenum type );
377
378 extern void APIENTRY gluNurbsCallback( GLUnurbsObj *nobj, GLenum which,
379                                        void (CALLBACK *fn)() );
380
381
382
383 /*
384  *
385  * Polygon tesselation
386  *
387  */
388
389 extern GLUtriangulatorObj* APIENTRY gluNewTess( void );
390
391 extern void APIENTRY gluTessCallback( GLUtriangulatorObj *tobj, GLenum which,
392                                       void (CALLBACK *fn)() );
393
394 extern void APIENTRY gluDeleteTess( GLUtriangulatorObj *tobj );
395
396 extern void APIENTRY gluBeginPolygon( GLUtriangulatorObj *tobj );
397
398 extern void APIENTRY gluEndPolygon( GLUtriangulatorObj *tobj );
399
400 extern void APIENTRY gluNextContour( GLUtriangulatorObj *tobj, GLenum type );
401
402 extern void APIENTRY gluTessVertex( GLUtriangulatorObj *tobj, GLdouble v[3],
403                                     void *data );
404
405
406
407 /*
408  *
409  * New functions in GLU 1.1
410  *
411  */
412
413 extern const GLubyte* APIENTRY gluGetString( GLenum name );
414
415
416 #if defined(__BEOS__) || defined(__QUICKDRAW__)
417 #pragma export off
418 #endif
419
420
421 #ifdef macintosh
422         #pragma enumsalwaysint reset
423         #if PRAGMA_IMPORT_SUPPORTED
424         #pragma import off
425         #endif
426 #endif
427
428
429 #ifdef __cplusplus
430 }
431 #endif
432
433
434 #endif