GLU.h
上传用户:dzyhzl
上传日期:2019-04-29
资源大小:56270k
文件大小:18k
源码类别:

模拟服务器

开发平台:

C/C++

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