home *** CD-ROM | disk | FTP | other *** search
/ Magazyn Amiga 5 / MA_Cover_5.iso / ppc / mesa / include / gl / glu.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-01-31  |  13.1 KB  |  420 lines

  1. /* $Id: glu.h,v 1.8 1997/10/29 02:03:20 brianp Exp $ */
  2.  
  3. /*
  4.  * Mesa 3-D graphics library
  5.  * Version:  2.4
  6.  * Copyright (C) 1995-1997  Brian Paul
  7.  *
  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.
  12.  *
  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.
  17.  *
  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.
  21.  */
  22.  
  23.  
  24. /*
  25.  * $Log: glu.h,v $
  26.  * Revision 1.8  1997/10/29 02:03:20  brianp
  27.  * added WINGDIAPI, APIENTRY stuff (David Bucciarelli, v20 3dfx driver)
  28.  *
  29.  * Revision 1.7  1997/08/19 02:35:07  brianp
  30.  * added some Macintosh-only pragmas (Miklos Fazekas)
  31.  *
  32.  * Revision 1.6  1997/07/13 22:59:34  brianp
  33.  * added const to viewport parameter of gluPickMatrix()
  34.  *
  35.  * Revision 1.5  1997/05/28 02:31:01  brianp
  36.  * added a comment about typedefs
  37.  *
  38.  * Revision 1.4  1997/02/19 10:13:54  brianp
  39.  * now test for __QUICKDRAW__ like for __BEOS__ (Randy Frank)
  40.  *
  41.  * Revision 1.3  1997/02/03 20:05:33  brianp
  42.  * patches for BeOS
  43.  *
  44.  * Revision 1.2  1997/02/03 19:15:15  brianp
  45.  * conditionally include glu_mangle.h
  46.  *
  47.  * Revision 1.1  1996/09/13 01:26:41  brianp
  48.  * Initial revision
  49.  *
  50.  */
  51.  
  52.  
  53. #ifndef GLU_H
  54. #define GLU_H
  55.  
  56.  
  57. #if defined(USE_MGL_NAMESPACE)
  58. #include "glu_mangle.h"
  59. #endif
  60.  
  61.  
  62. #ifdef __cplusplus
  63. extern "C" {
  64. #endif
  65.  
  66.  
  67. #include "GL/gl.h"
  68.  
  69.  
  70. #ifdef macintosh
  71.     #pragma enumsalwaysint on
  72.     #if PRAGMA_IMPORT_SUPPORTED
  73.     #pragma import on
  74.     #endif
  75. #endif
  76.  
  77.  
  78. #define GLU_VERSION_1_1        1
  79.  
  80.  
  81. #define GLU_TRUE   GL_TRUE
  82. #define GLU_FALSE  GL_FALSE
  83.  
  84.  
  85. enum {
  86.     /* Normal vectors */
  87.     GLU_SMOOTH    = 100000,
  88.     GLU_FLAT    = 100001,
  89.     GLU_NONE    = 100002,
  90.  
  91.     /* Quadric draw styles */
  92.     GLU_POINT    = 100010,
  93.     GLU_LINE    = 100011,
  94.     GLU_FILL    = 100012,
  95.     GLU_SILHOUETTE    = 100013,
  96.  
  97.     /* Quadric orientation */
  98.     GLU_OUTSIDE    = 100020,
  99.     GLU_INSIDE    = 100021,
  100.  
  101.     /* Tesselator */
  102.     GLU_BEGIN    = 100100,
  103.     GLU_VERTEX    = 100101,
  104.     GLU_END        = 100102,
  105.     GLU_ERROR    = 100103,
  106.     GLU_EDGE_FLAG    = 100104,
  107.  
  108.     /* Contour types */
  109.     GLU_CW        = 100120,
  110.     GLU_CCW        = 100121,
  111.     GLU_INTERIOR    = 100122,
  112.     GLU_EXTERIOR    = 100123,
  113.     GLU_UNKNOWN    = 100124,
  114.  
  115.     /* Tesselation errors */
  116.     GLU_TESS_ERROR1    = 100151,  /* missing gluEndPolygon */
  117.     GLU_TESS_ERROR2 = 100152,  /* missing gluBeginPolygon */
  118.     GLU_TESS_ERROR3 = 100153,  /* misoriented contour */
  119.     GLU_TESS_ERROR4 = 100154,  /* vertex/edge intersection */
  120.     GLU_TESS_ERROR5 = 100155,  /* misoriented or self-intersecting loops */
  121.     GLU_TESS_ERROR6 = 100156,  /* coincident vertices */
  122.     GLU_TESS_ERROR7 = 100157,  /* all vertices collinear */
  123.     GLU_TESS_ERROR8 = 100158,  /* intersecting edges */
  124.     GLU_TESS_ERROR9 = 100159,  /* not coplanar contours */
  125.  
  126.     /* NURBS */
  127.     GLU_AUTO_LOAD_MATRIX    = 100200,
  128.     GLU_CULLING        = 100201,
  129.     GLU_PARAMETRIC_TOLERANCE= 100202,
  130.     GLU_SAMPLING_TOLERANCE    = 100203,
  131.     GLU_DISPLAY_MODE    = 100204,
  132.     GLU_SAMPLING_METHOD    = 100205,
  133.     GLU_U_STEP        = 100206,
  134.     GLU_V_STEP        = 100207,
  135.  
  136.     GLU_PATH_LENGTH        = 100215,
  137.     GLU_PARAMETRIC_ERROR    = 100216,
  138.     GLU_DOMAIN_DISTANCE    = 100217,
  139.  
  140.     GLU_MAP1_TRIM_2        = 100210,
  141.     GLU_MAP1_TRIM_3        = 100211,
  142.  
  143.     GLU_OUTLINE_POLYGON    = 100240,
  144.     GLU_OUTLINE_PATCH    = 100241,
  145.  
  146.     GLU_NURBS_ERROR1  = 100251,   /* spline order un-supported */
  147.     GLU_NURBS_ERROR2  = 100252,   /* too few knots */
  148.     GLU_NURBS_ERROR3  = 100253,   /* valid knot range is empty */
  149.     GLU_NURBS_ERROR4  = 100254,   /* decreasing knot sequence */
  150.     GLU_NURBS_ERROR5  = 100255,   /* knot multiplicity > spline order */
  151.     GLU_NURBS_ERROR6  = 100256,   /* endcurve() must follow bgncurve() */
  152.     GLU_NURBS_ERROR7  = 100257,   /* bgncurve() must precede endcurve() */
  153.     GLU_NURBS_ERROR8  = 100258,   /* ctrlarray or knot vector is NULL */
  154.     GLU_NURBS_ERROR9  = 100259,   /* can't draw pwlcurves */
  155.     GLU_NURBS_ERROR10 = 100260,   /* missing gluNurbsCurve() */
  156.     GLU_NURBS_ERROR11 = 100261,   /* missing gluNurbsSurface() */
  157.     GLU_NURBS_ERROR12 = 100262,   /* endtrim() must precede endsurface() */
  158.     GLU_NURBS_ERROR13 = 100263,   /* bgnsurface() must precede endsurface() */
  159.     GLU_NURBS_ERROR14 = 100264,   /* curve of improper type passed as trim curve */
  160.     GLU_NURBS_ERROR15 = 100265,   /* bgnsurface() must precede bgntrim() */
  161.     GLU_NURBS_ERROR16 = 100266,   /* endtrim() must follow bgntrim() */
  162.     GLU_NURBS_ERROR17 = 100267,   /* bgntrim() must precede endtrim()*/
  163.     GLU_NURBS_ERROR18 = 100268,   /* invalid or missing trim curve*/
  164.     GLU_NURBS_ERROR19 = 100269,   /* bgntrim() must precede pwlcurve() */
  165.     GLU_NURBS_ERROR20 = 100270,   /* pwlcurve referenced twice*/
  166.     GLU_NURBS_ERROR21 = 100271,   /* pwlcurve and nurbscurve mixed */
  167.     GLU_NURBS_ERROR22 = 100272,   /* improper usage of trim data type */
  168.     GLU_NURBS_ERROR23 = 100273,   /* nurbscurve referenced twice */
  169.     GLU_NURBS_ERROR24 = 100274,   /* nurbscurve and pwlcurve mixed */
  170.     GLU_NURBS_ERROR25 = 100275,   /* nurbssurface referenced twice */
  171.     GLU_NURBS_ERROR26 = 100276,   /* invalid property */
  172.     GLU_NURBS_ERROR27 = 100277,   /* endsurface() must follow bgnsurface() */
  173.     GLU_NURBS_ERROR28 = 100278,   /* intersecting or misoriented trim curves */
  174.     GLU_NURBS_ERROR29 = 100279,   /* intersecting trim curves */
  175.     GLU_NURBS_ERROR30 = 100280,   /* UNUSED */
  176.     GLU_NURBS_ERROR31 = 100281,   /* unconnected trim curves */
  177.     GLU_NURBS_ERROR32 = 100282,   /* unknown knot error */
  178.     GLU_NURBS_ERROR33 = 100283,   /* negative vertex count encountered */
  179.     GLU_NURBS_ERROR34 = 100284,   /* negative byte-stride */
  180.     GLU_NURBS_ERROR35 = 100285,   /* unknown type descriptor */
  181.     GLU_NURBS_ERROR36 = 100286,   /* null control point reference */
  182.     GLU_NURBS_ERROR37 = 100287,   /* duplicate point on pwlcurve */
  183.  
  184.     /* Errors */
  185.     GLU_INVALID_ENUM        = 100900,
  186.     GLU_INVALID_VALUE        = 100901,
  187.     GLU_OUT_OF_MEMORY        = 100902,
  188.     GLU_INCOMPATIBLE_GL_VERSION    = 100903,
  189.  
  190.     /* New in GLU 1.1 */
  191.     GLU_VERSION    = 100800,
  192.     GLU_EXTENSIONS    = 100801
  193. };
  194.  
  195.  
  196. /*
  197.  * These are the GLU 1.1 typedefs.  GLU 1.2 has different ones!
  198.  */
  199. typedef struct GLUquadricObj GLUquadricObj;
  200.  
  201. typedef struct GLUtriangulatorObj GLUtriangulatorObj;
  202.  
  203. typedef struct GLUnurbsObj GLUnurbsObj;
  204.  
  205.  
  206.  
  207. #if defined(__BEOS__) || defined(__QUICKDRAW__)
  208. #pragma export on
  209. #endif
  210.  
  211.  
  212. /*
  213.  *
  214.  * Miscellaneous functions
  215.  *
  216.  */
  217.  
  218. extern void APIENTRY gluLookAt( GLdouble eyex, GLdouble eyey, GLdouble eyez,
  219.                                 GLdouble centerx, GLdouble centery, GLdouble centerz,
  220.                                 GLdouble upx, GLdouble upy, GLdouble upz );
  221.  
  222.  
  223. extern void APIENTRY gluOrtho2D( GLdouble left, GLdouble right,
  224.                                  GLdouble bottom, GLdouble top );
  225.  
  226.  
  227. extern void APIENTRY gluPerspective( GLdouble fovy, GLdouble aspect,
  228.                                      GLdouble zNear, GLdouble zFar );
  229.  
  230.  
  231. extern void APIENTRY gluPickMatrix( GLdouble x, GLdouble y,
  232.                                     GLdouble width, GLdouble height,
  233.                                     const GLint viewport[4] );
  234.  
  235. extern GLint APIENTRY gluProject( GLdouble objx, GLdouble objy, GLdouble objz,
  236.                                   const GLdouble modelMatrix[16],
  237.                                   const GLdouble projMatrix[16],
  238.                                   const GLint viewport[4],
  239.                                   GLdouble *winx, GLdouble *winy, GLdouble *winz );
  240.  
  241. extern GLint APIENTRY gluUnProject( GLdouble winx, GLdouble winy, GLdouble winz,
  242.                                     const GLdouble modelMatrix[16],
  243.                                     const GLdouble projMatrix[16],
  244.                                     const GLint viewport[4],
  245.                                     GLdouble *objx, GLdouble *objy, GLdouble *objz );
  246.  
  247. extern const GLubyte* APIENTRY gluErrorString( GLenum errorCode );
  248.  
  249.  
  250.  
  251. /*
  252.  *
  253.  * Mipmapping and image scaling
  254.  *
  255.  */
  256.  
  257. extern GLint APIENTRY gluScaleImage( GLenum format,
  258.                                      GLint widthin, GLint heightin,
  259.                                      GLenum typein, const void *datain,
  260.                                      GLint widthout, GLint heightout,
  261.                                      GLenum typeout, void *dataout );
  262.  
  263. extern GLint APIENTRY gluBuild1DMipmaps( GLenum target, GLint components,
  264.                                          GLint width, GLenum format,
  265.                                          GLenum type, const void *data );
  266.  
  267. extern GLint APIENTRY gluBuild2DMipmaps( GLenum target, GLint components,
  268.                                          GLint width, GLint height, GLenum format,
  269.                                          GLenum type, const void *data );
  270.  
  271.  
  272.  
  273. /*
  274.  *
  275.  * Quadrics
  276.  *
  277.  */
  278.  
  279. extern GLUquadricObj* APIENTRY gluNewQuadric( void );
  280.  
  281. extern void APIENTRY gluDeleteQuadric( GLUquadricObj *state );
  282.  
  283. extern void APIENTRY gluQuadricDrawStyle( GLUquadricObj *quadObject,
  284.                                           GLenum drawStyle );
  285.  
  286. extern void APIENTRY gluQuadricOrientation( GLUquadricObj *quadObject,
  287.                                             GLenum orientation );
  288.  
  289. extern void APIENTRY gluQuadricNormals( GLUquadricObj *quadObject, GLenum normals );
  290.  
  291. extern void APIENTRY gluQuadricTexture( GLUquadricObj *quadObject,
  292.                                         GLboolean textureCoords );
  293.  
  294. extern void APIENTRY gluQuadricCallback( GLUquadricObj *qobj,
  295.                                          GLenum which, void (*fn)() );
  296.  
  297. extern void APIENTRY gluCylinder( GLUquadricObj *qobj,
  298.                                   GLdouble baseRadius,
  299.                                   GLdouble topRadius,
  300.                                   GLdouble height,
  301.                                   GLint slices, GLint stacks );
  302.  
  303. extern void APIENTRY gluSphere( GLUquadricObj *qobj,
  304.                                 GLdouble radius, GLint slices, GLint stacks );
  305.  
  306. extern void APIENTRY gluDisk( GLUquadricObj *qobj,
  307.                               GLdouble innerRadius, GLdouble outerRadius,
  308.                               GLint slices, GLint loops );
  309.  
  310. extern void APIENTRY gluPartialDisk( GLUquadricObj *qobj, GLdouble innerRadius,
  311.                                      GLdouble outerRadius, GLint slices, GLint loops,
  312.                                      GLdouble startAngle, GLdouble sweepAngle );
  313.  
  314.  
  315.  
  316. /*
  317.  *
  318.  * Nurbs
  319.  *
  320.  */
  321.  
  322. extern GLUnurbsObj* APIENTRY gluNewNurbsRenderer( void );
  323.  
  324. extern void APIENTRY gluDeleteNurbsRenderer( GLUnurbsObj *nobj );
  325.  
  326. extern void APIENTRY gluLoadSamplingMatrices( GLUnurbsObj *nobj,
  327.                                               const GLfloat modelMatrix[16],
  328.                                               const GLfloat projMatrix[16],
  329.                                               const GLint viewport[4] );
  330.  
  331. extern void APIENTRY gluNurbsProperty( GLUnurbsObj *nobj, GLenum property,
  332.                                        GLfloat value );
  333.  
  334. extern void APIENTRY gluGetNurbsProperty( GLUnurbsObj *nobj, GLenum property,
  335.                                           GLfloat *value );
  336.  
  337. extern void APIENTRY gluBeginCurve( GLUnurbsObj *nobj );
  338.  
  339. extern void APIENTRY gluEndCurve( GLUnurbsObj * nobj );
  340.  
  341. extern void APIENTRY gluNurbsCurve( GLUnurbsObj *nobj, GLint nknots, GLfloat *knot,
  342.                                     GLint stride, GLfloat *ctlarray, GLint order,
  343.                                     GLenum type );
  344.  
  345. extern void APIENTRY gluBeginSurface( GLUnurbsObj *nobj );
  346.  
  347. extern void APIENTRY gluEndSurface( GLUnurbsObj * nobj );
  348.  
  349. extern void APIENTRY gluNurbsSurface( GLUnurbsObj *nobj,
  350.                                       GLint sknot_count, GLfloat *sknot,
  351.                                       GLint tknot_count, GLfloat *tknot,
  352.                                       GLint s_stride, GLint t_stride,
  353.                                       GLfloat *ctlarray,
  354.                                       GLint sorder, GLint torder,
  355.                                       GLenum type );
  356.  
  357. extern void APIENTRY gluBeginTrim( GLUnurbsObj *nobj );
  358.  
  359. extern void APIENTRY gluEndTrim( GLUnurbsObj *nobj );
  360.  
  361. extern void APIENTRY gluPwlCurve( GLUnurbsObj *nobj, GLint count, GLfloat *array,
  362.                                   GLint stride, GLenum type );
  363.  
  364. extern void APIENTRY gluNurbsCallback( GLUnurbsObj *nobj, GLenum which, void (*fn)() );
  365.  
  366.  
  367.  
  368. /*
  369.  *
  370.  * Polygon tesselation
  371.  *
  372.  */
  373.  
  374. extern GLUtriangulatorObj* APIENTRY gluNewTess( void );
  375.  
  376. extern void APIENTRY gluTessCallback( GLUtriangulatorObj *tobj, GLenum which,
  377.                                       void (*fn)() );
  378.  
  379. extern void APIENTRY gluDeleteTess( GLUtriangulatorObj *tobj );
  380.  
  381. extern void APIENTRY gluBeginPolygon( GLUtriangulatorObj *tobj );
  382.  
  383. extern void APIENTRY gluEndPolygon( GLUtriangulatorObj *tobj );
  384.  
  385. extern void APIENTRY gluNextContour( GLUtriangulatorObj *tobj, GLenum type );
  386.  
  387. extern void APIENTRY gluTessVertex( GLUtriangulatorObj *tobj, GLdouble v[3],
  388.                                     void *data );
  389.  
  390.  
  391.  
  392. /*
  393.  *
  394.  * New functions in GLU 1.1
  395.  *
  396.  */
  397.  
  398. extern const GLubyte* APIENTRY gluGetString( GLenum name );
  399.  
  400.  
  401. #if defined(__BEOS__) || defined(__QUICKDRAW__)
  402. #pragma export off
  403. #endif
  404.  
  405.  
  406. #ifdef macintosh
  407.     #pragma enumsalwaysint reset
  408.     #if PRAGMA_IMPORT_SUPPORTED
  409.     #pragma import off
  410.     #endif
  411. #endif
  412.  
  413.  
  414. #ifdef __cplusplus
  415. }
  416. #endif
  417.  
  418.  
  419. #endif
  420.