source: trunk/src/opengl/glu/glu.h@ 2803

Last change on this file since 2803 was 2689, checked in by jeroen, 26 years ago

* empty log message *

File size: 17.9 KB
Line 
1/* $Id: glu.h,v 1.1 2000-02-09 08:50:54 jeroen Exp $ */
2#ifndef __glu_h__
3#ifndef __GLU_H__
4
5#define __glu_h__
6#define __GLU_H__
7
8#include "gl.h"
9
10#ifdef __cplusplus
11extern "C" {
12#endif
13
14/*
15** Copyright 1991-1993, Silicon Graphics, Inc.
16** All Rights Reserved.
17**
18** This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
19** the contents of this file may not be disclosed to third parties, copied or
20** duplicated in any form, in whole or in part, without the prior written
21** permission of Silicon Graphics, Inc.
22**
23** RESTRICTED RIGHTS LEGEND:
24** Use, duplication or disclosure by the Government is subject to restrictions
25** as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
26** and Computer Software clause at DFARS 252.227-7013, and/or in similar or
27** successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
28** rights reserved under the Copyright Laws of the United States.
29*/
30
31/*
32** Return the error string associated with a particular error code.
33** This will return 0 for an invalid error code.
34**
35** The generic function prototype that can be compiled for ANSI or Unicode
36** is defined as follows:
37**
38** LPCTSTR APIENTRY gluErrorStringWIN (GLenum errCode);
39*/
40#ifdef UNICODE
41#define gluErrorStringWIN(errCode) ((LPCSTR) gluErrorUnicodeStringEXT(errCode))
42#else
43#define gluErrorStringWIN(errCode) ((LPCWSTR) gluErrorString(errCode))
44#endif
45
46const GLubyte* APIENTRY gluErrorString (
47 GLenum errCode);
48
49const wchar_t* APIENTRY gluErrorUnicodeStringEXT (
50 GLenum errCode);
51
52const GLubyte* APIENTRY gluGetString (
53 GLenum name);
54
55void APIENTRY gluOrtho2D (
56 GLdouble left,
57 GLdouble right,
58 GLdouble bottom,
59 GLdouble top);
60
61void APIENTRY gluPerspective (
62 GLdouble fovy,
63 GLdouble aspect,
64 GLdouble zNear,
65 GLdouble zFar);
66
67void APIENTRY gluPickMatrix (
68 GLdouble x,
69 GLdouble y,
70 GLdouble width,
71 GLdouble height,
72 GLint viewport[4]);
73
74void APIENTRY gluLookAt (
75 GLdouble eyex,
76 GLdouble eyey,
77 GLdouble eyez,
78 GLdouble centerx,
79 GLdouble centery,
80 GLdouble centerz,
81 GLdouble upx,
82 GLdouble upy,
83 GLdouble upz);
84
85long APIENTRY gluProject (
86 GLdouble objx,
87 GLdouble objy,
88 GLdouble objz,
89 const GLdouble modelMatrix[16],
90 const GLdouble projMatrix[16],
91 const GLint viewport[4],
92 GLdouble *winx,
93 GLdouble *winy,
94 GLdouble *winz);
95
96long APIENTRY gluUnProject (
97 GLdouble winx,
98 GLdouble winy,
99 GLdouble winz,
100 const GLdouble modelMatrix[16],
101 const GLdouble projMatrix[16],
102 const GLint viewport[4],
103 GLdouble *objx,
104 GLdouble *objy,
105 GLdouble *objz);
106
107
108long APIENTRY gluScaleImage (
109 GLenum format,
110 GLint widthin,
111 GLint heightin,
112 GLenum typein,
113 const void *datain,
114 GLint widthout,
115 GLint heightout,
116 GLenum typeout,
117 void *dataout);
118
119
120long APIENTRY gluBuild1DMipmaps (
121 GLenum target,
122 GLint components,
123 GLint width,
124 GLenum format,
125 GLenum type,
126 const void *data);
127
128long APIENTRY gluBuild2DMipmaps (
129 GLenum target,
130 GLint components,
131 GLint width,
132 GLint height,
133 GLenum format,
134 GLenum type,
135 const void *data);
136
137#ifdef __cplusplus
138
139class GLUnurbs;
140class GLUquadric;
141class GLUtesselator;
142
143/* backwards compatibility: */
144typedef class GLUnurbs GLUnurbsObj;
145typedef class GLUquadric GLUquadricObj;
146typedef class GLUtesselator GLUtesselatorObj;
147typedef class GLUtesselator GLUtriangulatorObj;
148
149#else
150
151typedef struct GLUnurbs GLUnurbs;
152typedef struct GLUquadric GLUquadric;
153typedef struct GLUtesselator GLUtesselator;
154
155/* backwards compatibility: */
156typedef struct GLUnurbs GLUnurbsObj;
157typedef struct GLUquadric GLUquadricObj;
158typedef struct GLUtesselator GLUtesselatorObj;
159typedef struct GLUtesselator GLUtriangulatorObj;
160
161#endif
162
163
164GLUquadric* APIENTRY gluNewQuadric (void);
165void APIENTRY gluDeleteQuadric (
166 GLUquadric *state);
167
168void APIENTRY gluQuadricNormals (
169 GLUquadric *quadObject,
170 GLenum normals);
171
172void APIENTRY gluQuadricTexture (
173 GLUquadric *quadObject,
174 GLboolean textureCoords);
175
176void APIENTRY gluQuadricOrientation (
177 GLUquadric *quadObject,
178 GLenum orientation);
179
180void APIENTRY gluQuadricDrawStyle (
181 GLUquadric *quadObject,
182 GLenum drawStyle);
183
184void APIENTRY gluCylinder (
185 GLUquadric *qobj,
186 GLdouble baseRadius,
187 GLdouble topRadius,
188 GLdouble height,
189 GLint slices,
190 GLint stacks);
191
192void APIENTRY gluDisk (
193 GLUquadric *qobj,
194 GLdouble innerRadius,
195 GLdouble outerRadius,
196 GLint slices,
197 GLint loops);
198
199void APIENTRY gluPartialDisk (
200 GLUquadric *qobj,
201 GLdouble innerRadius,
202 GLdouble outerRadius,
203 GLint slices,
204 GLint loops,
205 GLdouble startAngle,
206 GLdouble sweepAngle);
207
208void APIENTRY gluSphere (
209 GLUquadric *qobj,
210 GLdouble radius,
211 GLint slices,
212 GLint stacks);
213
214void APIENTRY gluQuadricCallback (
215 GLUquadric *qobj,
216 GLenum which,
217 void (WIN32API * fn)());
218
219GLUtesselator* APIENTRY gluNewTess(
220 void );
221
222void APIENTRY gluDeleteTess(
223 GLUtesselator *tess );
224
225void APIENTRY gluTessBeginPolygon(
226 GLUtesselator *tess,
227 void *polygon_data );
228
229void APIENTRY gluTessBeginContour(
230 GLUtesselator *tess );
231
232void APIENTRY gluTessVertex(
233 GLUtesselator *tess,
234 GLdouble coords[3],
235 void *data );
236
237void APIENTRY gluTessEndContour(
238 GLUtesselator *tess );
239
240void APIENTRY gluTessEndPolygon(
241 GLUtesselator *tess );
242
243void APIENTRY gluTessProperty(
244 GLUtesselator *tess,
245 GLenum which,
246 GLdouble value );
247
248void APIENTRY gluTessNormal(
249 GLUtesselator *tess,
250 GLdouble x,
251 GLdouble y,
252 GLdouble z );
253
254void APIENTRY gluTessCallback(
255 GLUtesselator *tess,
256 GLenum which,
257 void (WIN32API *fn)());
258
259void APIENTRY gluGetTessProperty(
260 GLUtesselator *tess,
261 GLenum which,
262 GLdouble *value );
263
264GLUnurbs* APIENTRY gluNewNurbsRenderer (void);
265
266void APIENTRY gluDeleteNurbsRenderer (
267 GLUnurbs *nobj);
268
269void APIENTRY gluBeginSurface (
270 GLUnurbs *nobj);
271
272void APIENTRY gluBeginCurve (
273 GLUnurbs *nobj);
274
275void APIENTRY gluEndCurve (
276 GLUnurbs *nobj);
277
278void APIENTRY gluEndSurface (
279 GLUnurbs *nobj);
280
281void APIENTRY gluBeginTrim (
282 GLUnurbs *nobj);
283
284void APIENTRY gluEndTrim (
285 GLUnurbs *nobj);
286
287void APIENTRY gluPwlCurve (
288 GLUnurbs *nobj,
289 GLint count,
290 GLfloat *array,
291 GLint stride,
292 GLenum type);
293
294void APIENTRY gluNurbsCurve (
295 GLUnurbs *nobj,
296 GLint nknots,
297 GLfloat *knot,
298 GLint stride,
299 GLfloat *ctlarray,
300 GLint order,
301 GLenum type);
302
303void APIENTRY
304gluNurbsSurface(
305 GLUnurbs *nobj,
306 GLint sknot_count,
307 float *sknot,
308 GLint tknot_count,
309 GLfloat *tknot,
310 GLint s_stride,
311 GLint t_stride,
312 GLfloat *ctlarray,
313 GLint sorder,
314 GLint torder,
315 GLenum type);
316
317void APIENTRY
318gluLoadSamplingMatrices (
319 GLUnurbs *nobj,
320 const GLfloat modelMatrix[16],
321 const GLfloat projMatrix[16],
322 const GLint viewport[4] );
323
324void APIENTRY
325gluNurbsProperty (
326 GLUnurbs *nobj,
327 GLenum property,
328 GLfloat value );
329
330void APIENTRY
331gluGetNurbsProperty (
332 GLUnurbs *nobj,
333 GLenum property,
334 GLfloat *value );
335
336void APIENTRY
337gluNurbsCallback (
338 GLUnurbs *nobj,
339 GLenum which,
340 void (WIN32API* fn)() );
341
342GLboolean APIENTRY gluCheckExtension(const GLubyte *extName,
343 const GLubyte *extString);
344
345/**** Callback function prototypes ****/
346
347/* gluQuadricCallback */
348typedef void (WIN32API* GLUquadricErrorProc) (GLenum);
349
350/* gluTessCallback */
351typedef void (WIN32API* GLUtessBeginProc) (GLenum);
352typedef void (WIN32API* GLUtessEdgeFlagProc) (GLboolean);
353typedef void (WIN32API* GLUtessVertexProc) (void *);
354typedef void (WIN32API* GLUtessEndProc) (void);
355typedef void (WIN32API* GLUtessErrorProc) (GLenum);
356typedef void (WIN32API* GLUtessCombineProc) (GLdouble[3],
357 void*[4],
358 GLfloat[4],
359 void** );
360typedef void (WIN32API* GLUtessBeginDataProc) (GLenum, void *);
361typedef void (WIN32API* GLUtessEdgeFlagDataProc) (GLboolean, void *);
362typedef void (WIN32API* GLUtessVertexDataProc) (void *, void *);
363typedef void (WIN32API* GLUtessEndDataProc) (void *);
364typedef void (WIN32API* GLUtessErrorDataProc) (GLenum, void *);
365typedef void (WIN32API* GLUtessCombineDataProc) (GLdouble[3],
366 void*[4],
367 GLfloat[4],
368 void**,
369 void* );
370
371/* gluNurbsCallback */
372typedef void (WIN32API* GLUnurbsErrorProc) (GLenum);
373
374
375/**** Generic constants ****/
376
377/* Version */
378#define GLU_VERSION_1_1 1
379#define GLU_VERSION_1_2 1
380
381/* Errors: (return value 0 = no error) */
382#define GLU_INVALID_ENUM 100900
383#define GLU_INVALID_VALUE 100901
384#define GLU_OUT_OF_MEMORY 100902
385#define GLU_INCOMPATIBLE_GL_VERSION 100903
386#define GLU_INVALID_OPERATION 100904
387
388/* StringName */
389#define GLU_VERSION 100800
390#define GLU_EXTENSIONS 100801
391
392/* Boolean */
393#define GLU_TRUE GL_TRUE
394#define GLU_FALSE GL_FALSE
395
396
397/**** Quadric constants ****/
398
399/* QuadricNormal */
400#define GLU_SMOOTH 100000
401#define GLU_FLAT 100001
402#define GLU_NONE 100002
403
404/* QuadricDrawStyle */
405#define GLU_POINT 100010
406#define GLU_LINE 100011
407#define GLU_FILL 100012
408#define GLU_SILHOUETTE 100013
409
410/* QuadricOrientation */
411#define GLU_OUTSIDE 100020
412#define GLU_INSIDE 100021
413
414/* Callback types: */
415/* GLU_ERROR 100103 */
416
417
418/**** Tesselation constants ****/
419
420#define GLU_TESS_MAX_COORD 1.0e150
421
422/* TessProperty */
423#define GLU_TESS_WINDING_RULE 100140
424#define GLU_TESS_BOUNDARY_ONLY 100141
425#define GLU_TESS_TOLERANCE 100142
426
427/* TessWinding */
428#define GLU_TESS_WINDING_ODD 100130
429#define GLU_TESS_WINDING_NONZERO 100131
430#define GLU_TESS_WINDING_POSITIVE 100132
431#define GLU_TESS_WINDING_NEGATIVE 100133
432#define GLU_TESS_WINDING_ABS_GEQ_TWO 100134
433
434/* TessCallback */
435#define GLU_TESS_BEGIN 100100 /* void (CALLBACK*)(GLenum type) */
436#define GLU_TESS_VERTEX 100101 /* void (CALLBACK*)(void *data) */
437#define GLU_TESS_END 100102 /* void (CALLBACK*)(void) */
438#define GLU_TESS_ERROR 100103 /* void (CALLBACK*)(GLenum errno) */
439#define GLU_TESS_EDGE_FLAG 100104 /* void (CALLBACK*)(GLboolean boundaryEdge) */
440#define GLU_TESS_COMBINE 100105 /* void (CALLBACK*)(GLdouble coords[3],
441 void *data[4],
442 GLfloat weight[4],
443 void **dataOut) */
444#define GLU_TESS_BEGIN_DATA 100106 /* void (CALLBACK*)(GLenum type,
445 void *polygon_data) */
446#define GLU_TESS_VERTEX_DATA 100107 /* void (CALLBACK*)(void *data,
447 void *polygon_data) */
448#define GLU_TESS_END_DATA 100108 /* void (CALLBACK*)(void *polygon_data) */
449#define GLU_TESS_ERROR_DATA 100109 /* void (CALLBACK*)(GLenum errno,
450 void *polygon_data) */
451#define GLU_TESS_EDGE_FLAG_DATA 100110 /* void (CALLBACK*)(GLboolean boundaryEdge,
452 void *polygon_data) */
453#define GLU_TESS_COMBINE_DATA 100111 /* void (CALLBACK*)(GLdouble coords[3],
454 void *data[4],
455 GLfloat weight[4],
456 void **dataOut,
457 void *polygon_data) */
458
459/* TessError */
460#define GLU_TESS_ERROR1 100151
461#define GLU_TESS_ERROR2 100152
462#define GLU_TESS_ERROR3 100153
463#define GLU_TESS_ERROR4 100154
464#define GLU_TESS_ERROR5 100155
465#define GLU_TESS_ERROR6 100156
466#define GLU_TESS_ERROR7 100157
467#define GLU_TESS_ERROR8 100158
468
469#define GLU_TESS_MISSING_BEGIN_POLYGON GLU_TESS_ERROR1
470#define GLU_TESS_MISSING_BEGIN_CONTOUR GLU_TESS_ERROR2
471#define GLU_TESS_MISSING_END_POLYGON GLU_TESS_ERROR3
472#define GLU_TESS_MISSING_END_CONTOUR GLU_TESS_ERROR4
473#define GLU_TESS_COORD_TOO_LARGE GLU_TESS_ERROR5
474#define GLU_TESS_NEED_COMBINE_CALLBACK GLU_TESS_ERROR6
475
476/**** NURBS constants ****/
477#define GLU_NURBS_MODE 100160
478#define GLU_NURBS_TESSELLATOR 100161
479#define GLU_NURBS_RENDERER 100162
480#define GLU_NURBS_BEGIN 100164
481#define GLU_NURBS_VERTEX 100165
482#define GLU_NURBS_NORMAL 100166
483#define GLU_NURBS_COLOR 100167
484#define GLU_NURBS_TEXTURE_COORD 100168
485#define GLU_NURBS_END 100169
486#define GLU_NURBS_BEGIN_DATA 100170
487#define GLU_NURBS_VERTEX_DATA 100171
488#define GLU_NURBS_NORMAL_DATA 100172
489#define GLU_NURBS_COLOR_DATA 100173
490#define GLU_NURBS_TEXTURE_COORD_DATA 100174
491#define GLU_NURBS_END_DATA 100175
492
493/* NurbsProperty */
494#define GLU_AUTO_LOAD_MATRIX 100200
495#define GLU_CULLING 100201
496#define GLU_SAMPLING_TOLERANCE 100203
497#define GLU_DISPLAY_MODE 100204
498#define GLU_PARAMETRIC_TOLERANCE 100202
499#define GLU_SAMPLING_METHOD 100205
500#define GLU_U_STEP 100206
501#define GLU_V_STEP 100207
502#define GLU_OBJECT_PARAMETRIC_ERROR 100208
503#define GLU_OBJECT_PATH_LENGTH 100209
504
505/* NurbsSampling */
506#define GLU_PATH_LENGTH 100215
507#define GLU_PARAMETRIC_ERROR 100216
508#define GLU_DOMAIN_DISTANCE 100217
509
510
511/* NurbsTrim */
512#define GLU_MAP1_TRIM_2 100210
513#define GLU_MAP1_TRIM_3 100211
514
515/* NurbsDisplay */
516/* GLU_FILL 100012 */
517#define GLU_OUTLINE_POLYGON 100240
518#define GLU_OUTLINE_PATCH 100241
519
520/* NurbsCallback */
521/* GLU_ERROR 100103 */
522
523/* NurbsErrors */
524#define GLU_NURBS_ERROR GLU_ERROR /* FIXME: is this correct?? */
525
526#define GLU_NURBS_ERROR1 100251
527#define GLU_NURBS_ERROR2 100252
528#define GLU_NURBS_ERROR3 100253
529#define GLU_NURBS_ERROR4 100254
530#define GLU_NURBS_ERROR5 100255
531#define GLU_NURBS_ERROR6 100256
532#define GLU_NURBS_ERROR7 100257
533#define GLU_NURBS_ERROR8 100258
534#define GLU_NURBS_ERROR9 100259
535#define GLU_NURBS_ERROR10 100260
536#define GLU_NURBS_ERROR11 100261
537#define GLU_NURBS_ERROR12 100262
538#define GLU_NURBS_ERROR13 100263
539#define GLU_NURBS_ERROR14 100264
540#define GLU_NURBS_ERROR15 100265
541#define GLU_NURBS_ERROR16 100266
542#define GLU_NURBS_ERROR17 100267
543#define GLU_NURBS_ERROR18 100268
544#define GLU_NURBS_ERROR19 100269
545#define GLU_NURBS_ERROR20 100270
546#define GLU_NURBS_ERROR21 100271
547#define GLU_NURBS_ERROR22 100272
548#define GLU_NURBS_ERROR23 100273
549#define GLU_NURBS_ERROR24 100274
550#define GLU_NURBS_ERROR25 100275
551#define GLU_NURBS_ERROR26 100276
552#define GLU_NURBS_ERROR27 100277
553#define GLU_NURBS_ERROR28 100278
554#define GLU_NURBS_ERROR29 100279
555#define GLU_NURBS_ERROR30 100280
556#define GLU_NURBS_ERROR31 100281
557#define GLU_NURBS_ERROR32 100282
558#define GLU_NURBS_ERROR33 100283
559#define GLU_NURBS_ERROR34 100284
560#define GLU_NURBS_ERROR35 100285
561#define GLU_NURBS_ERROR36 100286
562#define GLU_NURBS_ERROR37 100287
563
564/**** Backwards compatibility for old tesselator ****/
565
566void APIENTRY gluBeginPolygon( GLUtesselator *tess );
567
568void APIENTRY gluNextContour( GLUtesselator *tess,
569 GLenum type );
570
571void APIENTRY gluEndPolygon( GLUtesselator *tess );
572
573/* Contours types -- obsolete! */
574#define GLU_CW 100120
575#define GLU_CCW 100121
576#define GLU_INTERIOR 100122
577#define GLU_EXTERIOR 100123
578#define GLU_UNKNOWN 100124
579
580/* Names without "TESS_" prefix */
581#define GLU_BEGIN GLU_TESS_BEGIN
582#define GLU_VERTEX GLU_TESS_VERTEX
583#define GLU_END GLU_TESS_END
584#define GLU_ERROR GLU_TESS_ERROR
585#define GLU_EDGE_FLAG GLU_TESS_EDGE_FLAG
586
587#ifdef __cplusplus
588}
589#endif
590
591#endif /* __GLU_H__ */
592#endif /* __glu_h__ */
Note: See TracBrowser for help on using the repository browser.