home *** CD-ROM | disk | FTP | other *** search
/ Magazyn Internet 2000 May / MICD_2000_05.iso / CBuilder5 / INSTALL / DATA1.CAB / Program_Built_Files / Include / Gl / glu.h < prev   
Encoding:
C/C++ Source or Header  |  2000-02-01  |  17.9 KB  |  587 lines

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