1 /* $Id: glu.h,v 1.1 1999/08/19 00:55:40 jtg Exp $ */
4 * Mesa 3-D graphics library
6 * Copyright (C) 1995-1999 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 1999/08/19 00:55:40 jtg
29 * Revision 3.6 1999/02/14 03:39:45 brianp
32 * Revision 3.5 1999/01/03 03:02:55 brianp
33 * now using GLAPI and GLAPIENTRY keywords, misc Windows changes (Ted Jump)
35 * Revision 3.4 1998/12/01 02:34:27 brianp
36 * applied Mark Kilgard's patches from November 30, 1998
38 * Revision 3.3 1998/11/17 01:14:02 brianp
39 * minor changes for OpenStep compilation (pete@ohm.york.ac.uk)
41 * Revision 3.2 1998/07/26 01:36:27 brianp
42 * changes for Windows compilation per Ted Jump
44 * Revision 3.1 1998/06/23 00:33:08 brianp
45 * added some WIN32 APIENTRY, CALLBACK stuff (Eric Lassauge)
47 * Revision 3.0 1998/02/20 05:06:01 brianp
57 #if defined(USE_MGL_NAMESPACE)
58 #include "glu_mangle.h"
69 /* to facilitate clean DLL building ... */
70 #if !defined(OPENSTEP) && (defined(__WIN32__) || defined(__CYGWIN32__))
71 # if defined(_MSC_VER) && defined(BUILD_GLU32) /* tag specify we're building mesa as a DLL */
72 # define GLUAPI __declspec(dllexport)
73 # elif defined(_MSC_VER) && defined(_DLL) /* tag specifying we're building for DLL runtime support */
74 # define GLUAPI __declspec(dllimport)
75 # else /* for use with static link lib build of Win32 edition only */
76 # define GLUAPI extern
77 # endif /* _STATIC_MESA support */
79 # define GLUAPI extern
80 #endif /* WIN32 / CYGWIN32 bracket */
83 #pragma enumsalwaysint on
84 #if PRAGMA_IMPORT_SUPPORTED
90 #define GLU_VERSION_1_1 1
93 #define GLU_TRUE GL_TRUE
94 #define GLU_FALSE GL_FALSE
103 /* Quadric draw styles */
107 GLU_SILHOUETTE
= 100013,
109 /* Quadric orientation */
110 GLU_OUTSIDE
= 100020,
118 GLU_EDGE_FLAG
= 100104,
123 GLU_INTERIOR
= 100122,
124 GLU_EXTERIOR
= 100123,
125 GLU_UNKNOWN
= 100124,
127 /* Tesselation errors */
128 GLU_TESS_ERROR1
= 100151, /* missing gluEndPolygon */
129 GLU_TESS_ERROR2
= 100152, /* missing gluBeginPolygon */
130 GLU_TESS_ERROR3
= 100153, /* misoriented contour */
131 GLU_TESS_ERROR4
= 100154, /* vertex/edge intersection */
132 GLU_TESS_ERROR5
= 100155, /* misoriented or self-intersecting loops */
133 GLU_TESS_ERROR6
= 100156, /* coincident vertices */
134 GLU_TESS_ERROR7
= 100157, /* all vertices collinear */
135 GLU_TESS_ERROR8
= 100158, /* intersecting edges */
136 GLU_TESS_ERROR9
= 100159, /* not coplanar contours */
139 GLU_AUTO_LOAD_MATRIX
= 100200,
140 GLU_CULLING
= 100201,
141 GLU_PARAMETRIC_TOLERANCE
= 100202,
142 GLU_SAMPLING_TOLERANCE
= 100203,
143 GLU_DISPLAY_MODE
= 100204,
144 GLU_SAMPLING_METHOD
= 100205,
148 GLU_PATH_LENGTH
= 100215,
149 GLU_PARAMETRIC_ERROR
= 100216,
150 GLU_DOMAIN_DISTANCE
= 100217,
152 GLU_MAP1_TRIM_2
= 100210,
153 GLU_MAP1_TRIM_3
= 100211,
155 GLU_OUTLINE_POLYGON
= 100240,
156 GLU_OUTLINE_PATCH
= 100241,
158 GLU_NURBS_ERROR1
= 100251, /* spline order un-supported */
159 GLU_NURBS_ERROR2
= 100252, /* too few knots */
160 GLU_NURBS_ERROR3
= 100253, /* valid knot range is empty */
161 GLU_NURBS_ERROR4
= 100254, /* decreasing knot sequence */
162 GLU_NURBS_ERROR5
= 100255, /* knot multiplicity > spline order */
163 GLU_NURBS_ERROR6
= 100256, /* endcurve() must follow bgncurve() */
164 GLU_NURBS_ERROR7
= 100257, /* bgncurve() must precede endcurve() */
165 GLU_NURBS_ERROR8
= 100258, /* ctrlarray or knot vector is NULL */
166 GLU_NURBS_ERROR9
= 100259, /* can't draw pwlcurves */
167 GLU_NURBS_ERROR10
= 100260, /* missing gluNurbsCurve() */
168 GLU_NURBS_ERROR11
= 100261, /* missing gluNurbsSurface() */
169 GLU_NURBS_ERROR12
= 100262, /* endtrim() must precede endsurface() */
170 GLU_NURBS_ERROR13
= 100263, /* bgnsurface() must precede endsurface() */
171 GLU_NURBS_ERROR14
= 100264, /* curve of improper type passed as trim curve */
172 GLU_NURBS_ERROR15
= 100265, /* bgnsurface() must precede bgntrim() */
173 GLU_NURBS_ERROR16
= 100266, /* endtrim() must follow bgntrim() */
174 GLU_NURBS_ERROR17
= 100267, /* bgntrim() must precede endtrim()*/
175 GLU_NURBS_ERROR18
= 100268, /* invalid or missing trim curve*/
176 GLU_NURBS_ERROR19
= 100269, /* bgntrim() must precede pwlcurve() */
177 GLU_NURBS_ERROR20
= 100270, /* pwlcurve referenced twice*/
178 GLU_NURBS_ERROR21
= 100271, /* pwlcurve and nurbscurve mixed */
179 GLU_NURBS_ERROR22
= 100272, /* improper usage of trim data type */
180 GLU_NURBS_ERROR23
= 100273, /* nurbscurve referenced twice */
181 GLU_NURBS_ERROR24
= 100274, /* nurbscurve and pwlcurve mixed */
182 GLU_NURBS_ERROR25
= 100275, /* nurbssurface referenced twice */
183 GLU_NURBS_ERROR26
= 100276, /* invalid property */
184 GLU_NURBS_ERROR27
= 100277, /* endsurface() must follow bgnsurface() */
185 GLU_NURBS_ERROR28
= 100278, /* intersecting or misoriented trim curves */
186 GLU_NURBS_ERROR29
= 100279, /* intersecting trim curves */
187 GLU_NURBS_ERROR30
= 100280, /* UNUSED */
188 GLU_NURBS_ERROR31
= 100281, /* unconnected trim curves */
189 GLU_NURBS_ERROR32
= 100282, /* unknown knot error */
190 GLU_NURBS_ERROR33
= 100283, /* negative vertex count encountered */
191 GLU_NURBS_ERROR34
= 100284, /* negative byte-stride */
192 GLU_NURBS_ERROR35
= 100285, /* unknown type descriptor */
193 GLU_NURBS_ERROR36
= 100286, /* null control point reference */
194 GLU_NURBS_ERROR37
= 100287, /* duplicate point on pwlcurve */
197 GLU_INVALID_ENUM
= 100900,
198 GLU_INVALID_VALUE
= 100901,
199 GLU_OUT_OF_MEMORY
= 100902,
200 GLU_INCOMPATIBLE_GL_VERSION
= 100903,
203 GLU_VERSION
= 100800,
204 GLU_EXTENSIONS
= 100801
209 * These are the GLU 1.1 typedefs. GLU 1.2 has different ones!
211 #if defined(__BEOS__)
212 /* The BeOS does something funky and makes these typedefs in one
213 * of its system headers.
216 typedef struct GLUquadric GLUquadricObj
;
217 typedef struct GLUtesselator GLUtriangulatorObj
;
218 typedef struct GLUnurbs GLUnurbsObj
;
223 #if defined(__BEOS__) || defined(__QUICKDRAW__)
230 * Miscellaneous functions
234 GLUAPI
void GLAPIENTRY
gluLookAt( GLdouble eyex
, GLdouble eyey
, GLdouble eyez
,
235 GLdouble centerx
, GLdouble centery
,
237 GLdouble upx
, GLdouble upy
, GLdouble upz
);
240 GLUAPI
void GLAPIENTRY
gluOrtho2D( GLdouble left
, GLdouble right
,
241 GLdouble bottom
, GLdouble top
);
244 GLUAPI
void GLAPIENTRY
gluPerspective( GLdouble fovy
, GLdouble aspect
,
245 GLdouble zNear
, GLdouble zFar
);
248 GLUAPI
void GLAPIENTRY
gluPickMatrix( GLdouble x
, GLdouble y
,
249 GLdouble width
, GLdouble height
,
250 const GLint viewport
[4] );
252 GLUAPI GLint GLAPIENTRY
gluProject( GLdouble objx
, GLdouble objy
, GLdouble objz
,
253 const GLdouble modelMatrix
[16],
254 const GLdouble projMatrix
[16],
255 const GLint viewport
[4],
256 GLdouble
*winx
, GLdouble
*winy
,
259 GLUAPI GLint GLAPIENTRY
gluUnProject( GLdouble winx
, GLdouble winy
,
261 const GLdouble modelMatrix
[16],
262 const GLdouble projMatrix
[16],
263 const GLint viewport
[4],
264 GLdouble
*objx
, GLdouble
*objy
,
267 GLUAPI
const GLubyte
* GLAPIENTRY
gluErrorString( GLenum errorCode
);
273 * Mipmapping and image scaling
277 GLUAPI GLint GLAPIENTRY
gluScaleImage( GLenum format
,
278 GLint widthin
, GLint heightin
,
279 GLenum typein
, const void *datain
,
280 GLint widthout
, GLint heightout
,
281 GLenum typeout
, void *dataout
);
283 GLUAPI GLint GLAPIENTRY
gluBuild1DMipmaps( GLenum target
, GLint components
,
284 GLint width
, GLenum format
,
285 GLenum type
, const void *data
);
287 GLUAPI GLint GLAPIENTRY
gluBuild2DMipmaps( GLenum target
, GLint components
,
288 GLint width
, GLint height
,
290 GLenum type
, const void *data
);
300 GLUAPI GLUquadricObj
* GLAPIENTRY
gluNewQuadric( void );
302 GLUAPI
void GLAPIENTRY
gluDeleteQuadric( GLUquadricObj
*state
);
304 GLUAPI
void GLAPIENTRY
gluQuadricDrawStyle( GLUquadricObj
*quadObject
,
307 GLUAPI
void GLAPIENTRY
gluQuadricOrientation( GLUquadricObj
*quadObject
,
308 GLenum orientation
);
310 GLUAPI
void GLAPIENTRY
gluQuadricNormals( GLUquadricObj
*quadObject
,
313 GLUAPI
void GLAPIENTRY
gluQuadricTexture( GLUquadricObj
*quadObject
,
314 GLboolean textureCoords
);
316 GLUAPI
void GLAPIENTRY
gluQuadricCallback( GLUquadricObj
*qobj
,
317 GLenum which
, void (GLCALLBACK
*fn
)() );
319 GLUAPI
void GLAPIENTRY
gluCylinder( GLUquadricObj
*qobj
,
323 GLint slices
, GLint stacks
);
325 GLUAPI
void GLAPIENTRY
gluSphere( GLUquadricObj
*qobj
,
326 GLdouble radius
, GLint slices
, GLint stacks
);
328 GLUAPI
void GLAPIENTRY
gluDisk( GLUquadricObj
*qobj
,
329 GLdouble innerRadius
, GLdouble outerRadius
,
330 GLint slices
, GLint loops
);
332 GLUAPI
void GLAPIENTRY
gluPartialDisk( GLUquadricObj
*qobj
, GLdouble innerRadius
,
333 GLdouble outerRadius
, GLint slices
,
334 GLint loops
, GLdouble startAngle
,
335 GLdouble sweepAngle
);
345 GLUAPI GLUnurbsObj
* GLAPIENTRY
gluNewNurbsRenderer( void );
347 GLUAPI
void GLAPIENTRY
gluDeleteNurbsRenderer( GLUnurbsObj
*nobj
);
349 GLUAPI
void GLAPIENTRY
gluLoadSamplingMatrices( GLUnurbsObj
*nobj
,
350 const GLfloat modelMatrix
[16],
351 const GLfloat projMatrix
[16],
352 const GLint viewport
[4] );
354 GLUAPI
void GLAPIENTRY
gluNurbsProperty( GLUnurbsObj
*nobj
, GLenum property
,
357 GLUAPI
void GLAPIENTRY
gluGetNurbsProperty( GLUnurbsObj
*nobj
, GLenum property
,
360 GLUAPI
void GLAPIENTRY
gluBeginCurve( GLUnurbsObj
*nobj
);
362 GLUAPI
void GLAPIENTRY
gluEndCurve( GLUnurbsObj
* nobj
);
364 GLUAPI
void GLAPIENTRY
gluNurbsCurve( GLUnurbsObj
*nobj
, GLint nknots
,
365 GLfloat
*knot
, GLint stride
,
366 GLfloat
*ctlarray
, GLint order
,
369 GLUAPI
void GLAPIENTRY
gluBeginSurface( GLUnurbsObj
*nobj
);
371 GLUAPI
void GLAPIENTRY
gluEndSurface( GLUnurbsObj
* nobj
);
373 GLUAPI
void GLAPIENTRY
gluNurbsSurface( GLUnurbsObj
*nobj
,
374 GLint sknot_count
, GLfloat
*sknot
,
375 GLint tknot_count
, GLfloat
*tknot
,
376 GLint s_stride
, GLint t_stride
,
378 GLint sorder
, GLint torder
,
381 GLUAPI
void GLAPIENTRY
gluBeginTrim( GLUnurbsObj
*nobj
);
383 GLUAPI
void GLAPIENTRY
gluEndTrim( GLUnurbsObj
*nobj
);
385 GLUAPI
void GLAPIENTRY
gluPwlCurve( GLUnurbsObj
*nobj
, GLint count
,
386 GLfloat
*array
, GLint stride
, GLenum type
);
388 GLUAPI
void GLAPIENTRY
gluNurbsCallback( GLUnurbsObj
*nobj
, GLenum which
,
389 void (GLCALLBACK
*fn
)() );
395 * Polygon tesselation
399 GLUAPI GLUtriangulatorObj
* GLAPIENTRY
gluNewTess( void );
401 GLUAPI
void GLAPIENTRY
gluTessCallback( GLUtriangulatorObj
*tobj
, GLenum which
,
402 void (GLCALLBACK
*fn
)() );
404 GLUAPI
void GLAPIENTRY
gluDeleteTess( GLUtriangulatorObj
*tobj
);
406 GLUAPI
void GLAPIENTRY
gluBeginPolygon( GLUtriangulatorObj
*tobj
);
408 GLUAPI
void GLAPIENTRY
gluEndPolygon( GLUtriangulatorObj
*tobj
);
410 GLUAPI
void GLAPIENTRY
gluNextContour( GLUtriangulatorObj
*tobj
, GLenum type
);
412 GLUAPI
void GLAPIENTRY
gluTessVertex( GLUtriangulatorObj
*tobj
, GLdouble v
[3],
419 * New functions in GLU 1.1
423 GLUAPI
const GLubyte
* GLAPIENTRY
gluGetString( GLenum name
);
426 #if defined(__BEOS__) || defined(__QUICKDRAW__)
432 #pragma enumsalwaysint reset
433 #if PRAGMA_IMPORT_SUPPORTED