1 /* $Id: glu.h,v 1.1.1.1 2002/02/01 06:30:43 tacyas Exp $ */
4 * Mesa 3-D graphics library
6 * Copyright (C) 1995-1997 Brian Paul
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.
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.
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.
26 * Revision 1.1.1.1 2002/02/01 06:30:43 tacyas
27 * Initail Import Into CVS
29 * Revision 1.9 1998/01/16 02:29:26 brianp
30 * minor changes for Windows compilation (Theodore Jump)
32 * Revision 1.8 1997/10/29 02:03:20 brianp
33 * added WINGDIAPI, APIENTRY stuff (David Bucciarelli, v20 3dfx driver)
35 * Revision 1.7 1997/08/19 02:35:07 brianp
36 * added some Macintosh-only pragmas (Miklos Fazekas)
38 * Revision 1.6 1997/07/13 22:59:34 brianp
39 * added const to viewport parameter of gluPickMatrix()
41 * Revision 1.5 1997/05/28 02:31:01 brianp
42 * added a comment about typedefs
44 * Revision 1.4 1997/02/19 10:13:54 brianp
45 * now test for __QUICKDRAW__ like for __BEOS__ (Randy Frank)
47 * Revision 1.3 1997/02/03 20:05:33 brianp
50 * Revision 1.2 1997/02/03 19:15:15 brianp
51 * conditionally include glu_mangle.h
53 * Revision 1.1 1996/09/13 01:26:41 brianp
63 #if defined(USE_MGL_NAMESPACE)
64 #include "glu_mangle.h"
77 #pragma enumsalwaysint on
78 #if PRAGMA_IMPORT_SUPPORTED
84 #define GLU_VERSION_1_1 1
87 #define GLU_TRUE GL_TRUE
88 #define GLU_FALSE GL_FALSE
97 /* Quadric draw styles */
101 GLU_SILHOUETTE = 100013,
103 /* Quadric orientation */
104 GLU_OUTSIDE = 100020,
112 GLU_EDGE_FLAG = 100104,
117 GLU_INTERIOR = 100122,
118 GLU_EXTERIOR = 100123,
119 GLU_UNKNOWN = 100124,
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 */
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,
142 GLU_PATH_LENGTH = 100215,
143 GLU_PARAMETRIC_ERROR = 100216,
144 GLU_DOMAIN_DISTANCE = 100217,
146 GLU_MAP1_TRIM_2 = 100210,
147 GLU_MAP1_TRIM_3 = 100211,
149 GLU_OUTLINE_POLYGON = 100240,
150 GLU_OUTLINE_PATCH = 100241,
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 */
191 GLU_INVALID_ENUM = 100900,
192 GLU_INVALID_VALUE = 100901,
193 GLU_OUT_OF_MEMORY = 100902,
194 GLU_INCOMPATIBLE_GL_VERSION = 100903,
197 GLU_VERSION = 100800,
198 GLU_EXTENSIONS = 100801
203 * These are the GLU 1.1 typedefs. GLU 1.2 has different ones!
205 typedef struct GLUquadricObj GLUquadricObj;
207 typedef struct GLUtriangulatorObj GLUtriangulatorObj;
209 typedef struct GLUnurbsObj GLUnurbsObj;
213 #if defined(__BEOS__) || defined(__QUICKDRAW__)
220 * Miscellaneous functions
224 extern void APIENTRY gluLookAt( GLdouble eyex, GLdouble eyey, GLdouble eyez,
225 GLdouble centerx, GLdouble centery,
227 GLdouble upx, GLdouble upy, GLdouble upz );
230 extern void APIENTRY gluOrtho2D( GLdouble left, GLdouble right,
231 GLdouble bottom, GLdouble top );
234 extern void APIENTRY gluPerspective( GLdouble fovy, GLdouble aspect,
235 GLdouble zNear, GLdouble zFar );
238 extern void APIENTRY gluPickMatrix( GLdouble x, GLdouble y,
239 GLdouble width, GLdouble height,
240 const GLint viewport[4] );
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,
249 extern GLint APIENTRY gluUnProject( GLdouble winx, GLdouble winy,
251 const GLdouble modelMatrix[16],
252 const GLdouble projMatrix[16],
253 const GLint viewport[4],
254 GLdouble *objx, GLdouble *objy,
257 extern const GLubyte* APIENTRY gluErrorString( GLenum errorCode );
263 * Mipmapping and image scaling
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 );
273 extern GLint APIENTRY gluBuild1DMipmaps( GLenum target, GLint components,
274 GLint width, GLenum format,
275 GLenum type, const void *data );
277 extern GLint APIENTRY gluBuild2DMipmaps( GLenum target, GLint components,
278 GLint width, GLint height,
280 GLenum type, const void *data );
290 extern GLUquadricObj* APIENTRY gluNewQuadric( void );
292 extern void APIENTRY gluDeleteQuadric( GLUquadricObj *state );
294 extern void APIENTRY gluQuadricDrawStyle( GLUquadricObj *quadObject,
297 extern void APIENTRY gluQuadricOrientation( GLUquadricObj *quadObject,
298 GLenum orientation );
300 extern void APIENTRY gluQuadricNormals( GLUquadricObj *quadObject,
303 extern void APIENTRY gluQuadricTexture( GLUquadricObj *quadObject,
304 GLboolean textureCoords );
306 extern void APIENTRY gluQuadricCallback( GLUquadricObj *qobj,
307 GLenum which, void (CALLBACK *fn)() );
309 extern void APIENTRY gluCylinder( GLUquadricObj *qobj,
313 GLint slices, GLint stacks );
315 extern void APIENTRY gluSphere( GLUquadricObj *qobj,
316 GLdouble radius, GLint slices, GLint stacks );
318 extern void APIENTRY gluDisk( GLUquadricObj *qobj,
319 GLdouble innerRadius, GLdouble outerRadius,
320 GLint slices, GLint loops );
322 extern void APIENTRY gluPartialDisk( GLUquadricObj *qobj, GLdouble innerRadius,
323 GLdouble outerRadius, GLint slices,
324 GLint loops, GLdouble startAngle,
325 GLdouble sweepAngle );
335 extern GLUnurbsObj* APIENTRY gluNewNurbsRenderer( void );
337 extern void APIENTRY gluDeleteNurbsRenderer( GLUnurbsObj *nobj );
339 extern void APIENTRY gluLoadSamplingMatrices( GLUnurbsObj *nobj,
340 const GLfloat modelMatrix[16],
341 const GLfloat projMatrix[16],
342 const GLint viewport[4] );
344 extern void APIENTRY gluNurbsProperty( GLUnurbsObj *nobj, GLenum property,
347 extern void APIENTRY gluGetNurbsProperty( GLUnurbsObj *nobj, GLenum property,
350 extern void APIENTRY gluBeginCurve( GLUnurbsObj *nobj );
352 extern void APIENTRY gluEndCurve( GLUnurbsObj * nobj );
354 extern void APIENTRY gluNurbsCurve( GLUnurbsObj *nobj, GLint nknots,
355 GLfloat *knot, GLint stride,
356 GLfloat *ctlarray, GLint order,
359 extern void APIENTRY gluBeginSurface( GLUnurbsObj *nobj );
361 extern void APIENTRY gluEndSurface( GLUnurbsObj * nobj );
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,
368 GLint sorder, GLint torder,
371 extern void APIENTRY gluBeginTrim( GLUnurbsObj *nobj );
373 extern void APIENTRY gluEndTrim( GLUnurbsObj *nobj );
375 extern void APIENTRY gluPwlCurve( GLUnurbsObj *nobj, GLint count,
376 GLfloat *array, GLint stride, GLenum type );
378 extern void APIENTRY gluNurbsCallback( GLUnurbsObj *nobj, GLenum which,
379 void (CALLBACK *fn)() );
385 * Polygon tesselation
389 extern GLUtriangulatorObj* APIENTRY gluNewTess( void );
391 extern void APIENTRY gluTessCallback( GLUtriangulatorObj *tobj, GLenum which,
392 void (CALLBACK *fn)() );
394 extern void APIENTRY gluDeleteTess( GLUtriangulatorObj *tobj );
396 extern void APIENTRY gluBeginPolygon( GLUtriangulatorObj *tobj );
398 extern void APIENTRY gluEndPolygon( GLUtriangulatorObj *tobj );
400 extern void APIENTRY gluNextContour( GLUtriangulatorObj *tobj, GLenum type );
402 extern void APIENTRY gluTessVertex( GLUtriangulatorObj *tobj, GLdouble v[3],
409 * New functions in GLU 1.1
413 extern const GLubyte* APIENTRY gluGetString( GLenum name );
416 #if defined(__BEOS__) || defined(__QUICKDRAW__)
422 #pragma enumsalwaysint reset
423 #if PRAGMA_IMPORT_SUPPORTED