home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / newopg.zip / GLU.H < prev    next >
Text File  |  1995-03-04  |  13KB  |  270 lines

  1. /* @(#)68    1.3  src/gos/3d/OPENGL/include/GL/glu.h, glxlib, gos410 4/2/93 07:01:03 */
  2. /*
  3.  *   COMPONENT_NAME: GLXLIB
  4.  *
  5.  *   FUNCTIONS: 
  6.  *
  7.  *   ORIGINS: 21,27
  8.  *
  9.  *
  10.  *   (C) COPYRIGHT International Business Machines Corp. 1992
  11.  *   All Rights Reserved
  12.  *   Licensed Materials - Property of IBM
  13.  *   US Government Users Restricted Rights - Use, duplication or
  14.  *   disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  15.  */
  16.  
  17. #ifndef __glu_h__
  18. #define __glu_h__
  19.  
  20. #include <gl.h>
  21.  
  22. #ifdef __cplusplus
  23. extern "C" {
  24. #endif
  25.  
  26. /*
  27. ** Return the error string associated with a particular error code.
  28. ** This will return 0 for an invalid error code.
  29. */
  30. #ifndef OS2
  31. extern const GLubyte* APIENTRY gluErrorString (GLenum errorCode);
  32.  
  33. extern void APIENTRY gluOrtho2D (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top);
  34. extern void APIENTRY gluPerspective (GLdouble fovy, GLdouble aspect, GLdouble zNear, GLdouble zFar);
  35. extern void APIENTRY gluPickMatrix (GLdouble x, GLdouble y, GLdouble width, GLdouble height, GLint viewport[4]);
  36. extern void APIENTRY gluLookAt (GLdouble eyex, GLdouble eyey, GLdouble eyez, GLdouble centerx, GLdouble centery, GLdouble centerz, GLdouble upx, GLdouble upy, GLdouble upz);
  37. extern int APIENTRY gluProject (GLdouble objx, GLdouble objy, GLdouble objz, const GLdouble modelMatrix[16], const GLdouble projMatrix[16], const GLint viewport[4], GLdouble *winx, GLdouble *winy, GLdouble *winz);
  38. extern int APIENTRY gluUnProject (GLdouble winx, GLdouble winy, GLdouble winz, const GLdouble modelMatrix[16], const GLdouble projMatrix[16], const GLint viewport[4], GLdouble *objx, GLdouble *objy, GLdouble *objz);
  39.  
  40. extern int APIENTRY gluScaleImage (GLenum format, GLint widthin, GLint heightin, GLenum typein, const void *datain, GLint widthout, GLint heightout, GLenum typeout, void *dataout);
  41.  
  42. extern int APIENTRY gluBuild1DMipmaps (GLenum target, GLint components, GLint width, GLenum format, GLenum type, const void *data);
  43. extern int APIENTRY gluBuild2DMipmaps (GLenum target, GLint components, GLint width, GLint height, GLenum format, GLenum type, const void *data);
  44.  
  45. typedef struct GLUquadricObj GLUquadricObj;
  46. extern GLUquadricObj* APIENTRY gluNewQuadric (void);
  47. extern void APIENTRY gluDeleteQuadric (GLUquadricObj *state);
  48. extern void APIENTRY gluQuadricNormals (GLUquadricObj *qobj, GLenum normals);
  49. extern void APIENTRY gluQuadricTexture (GLUquadricObj *qobj, GLboolean textureCoords);
  50. extern void APIENTRY gluQuadricOrientation (GLUquadricObj *qobj, GLenum orientation);
  51. extern void APIENTRY gluQuadricDrawStyle (GLUquadricObj *qobj, GLenum drawStyle);
  52. extern void APIENTRY gluCylinder (GLUquadricObj *qobj, GLdouble baseRadius, GLdouble topRadius, GLdouble height, GLint slices, GLint stacks);
  53. extern void APIENTRY gluDisk (GLUquadricObj *qobj, GLdouble innerRadius, GLdouble outerRadius, GLint slices, GLint loops);
  54. extern void APIENTRY gluPartialDisk (GLUquadricObj *qobj, GLdouble innerRadius, GLdouble outerRadius, GLint slices, GLint loops, GLdouble startAngle, GLdouble sweepAngle);
  55. extern void APIENTRY gluSphere (GLUquadricObj *qobj, GLdouble radius, GLint slices, GLint stacks);
  56. extern void APIENTRY gluQuadricCallback (GLUquadricObj *qobj, GLenum which, void (*fn)());
  57.  
  58. typedef struct GLUtriangulatorObj GLUtriangulatorObj;
  59. extern GLUtriangulatorObj* APIENTRY gluNewTess (void);
  60. extern void APIENTRY gluTessCallback (GLUtriangulatorObj *tobj, GLenum which, void (*fn)());
  61. extern void APIENTRY gluDeleteTess (GLUtriangulatorObj *tobj);
  62. extern void APIENTRY gluBeginPolygon (GLUtriangulatorObj *tobj);
  63. extern void APIENTRY gluEndPolygon (GLUtriangulatorObj *tobj);
  64. extern void APIENTRY gluNextContour (GLUtriangulatorObj *tobj, GLenum type);
  65. extern void APIENTRY gluTessVertex (GLUtriangulatorObj *tobj, GLdouble v[3], void *data);
  66.  
  67. #ifdef __cplusplus
  68.     class GLUnurbsObj;
  69. #else 
  70.     typedef struct GLUnurbsObj GLUnurbsObj;
  71. #endif
  72. extern GLUnurbsObj* APIENTRY gluNewNurbsRenderer (void);
  73. extern void APIENTRY gluDeleteNurbsRenderer (GLUnurbsObj *nobj);
  74. extern void APIENTRY gluBeginSurface (GLUnurbsObj *nobj);
  75. extern void APIENTRY gluBeginCurve (GLUnurbsObj *nobj);
  76. extern void APIENTRY gluEndCurve (GLUnurbsObj *nobj);
  77. extern void APIENTRY gluEndSurface (GLUnurbsObj *nobj);
  78. extern void APIENTRY gluBeginTrim (GLUnurbsObj *nobj);
  79. extern void APIENTRY gluEndTrim (GLUnurbsObj *nobj);
  80. extern void APIENTRY gluPwlCurve (GLUnurbsObj *nobj, GLint count, GLfloat *array, GLint stride, GLenum type);
  81. extern void APIENTRY gluNurbsCurve (GLUnurbsObj *nobj, GLint nknots, GLfloat *knot, GLint stride, GLfloat *ctlarray, GLint order, GLenum type);
  82. extern void APIENTRY gluNurbsSurface (GLUnurbsObj *nobj, GLint uknot_count, GLfloat *uknot, GLint vknot_count, GLfloat *vknot, GLint u_stride, GLint v_stride, GLfloat *ctlarray, GLint uorder, GLint vorder, GLenum type);
  83. extern void APIENTRY gluLoadSamplingMatrices (GLUnurbsObj *nobj, const GLfloat modelMatrix[16], const GLfloat projMatrix[16], const GLint viewport[4]);        
  84. extern void APIENTRY gluNurbsProperty (GLUnurbsObj *nobj, GLenum property, GLfloat value);
  85. extern void APIENTRY gluGetNurbsProperty (GLUnurbsObj *nobj, GLenum property, GLfloat *value);
  86. extern void APIENTRY gluNurbsCallback (GLUnurbsObj *nobj, GLenum which, void (*fn)());
  87.  
  88. #else
  89. extern const GLubyte*    APIENTRY gluErrorString (GLenum errorCode);
  90.  
  91. extern void    APIENTRY gluOrtho2D (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top);
  92. extern void    APIENTRY gluPerspective (GLdouble fovy, GLdouble aspect, GLdouble zNear, GLdouble zFar);
  93. extern void    APIENTRY gluPickMatrix (GLdouble x, GLdouble y, GLdouble width, GLdouble height, GLint viewport[4]);
  94. extern void    APIENTRY gluLookAt (GLdouble eyex, GLdouble eyey, GLdouble eyez, GLdouble centerx, GLdouble centery, GLdouble centerz, GLdouble upx, GLdouble upy, GLdouble upz);
  95. extern int    APIENTRY gluProject (GLdouble objx, GLdouble objy, GLdouble objz, const GLdouble modelMatrix[16], const GLdouble projMatrix[16], const GLint viewport[4], GLdouble *winx, GLdouble *winy, GLdouble *winz);
  96. extern int    APIENTRY gluUnProject (GLdouble winx, GLdouble winy, GLdouble winz, const GLdouble modelMatrix[16], const GLdouble projMatrix[16], const GLint viewport[4], GLdouble *objx, GLdouble *objy, GLdouble *objz);
  97.  
  98. extern int    APIENTRY gluScaleImage (GLenum format, GLint widthin, GLint heightin, GLenum typein, const void *datain, GLint widthout, GLint heightout, GLenum typeout, void *dataout);
  99.  
  100. extern int    APIENTRY gluBuild1DMipmaps (GLenum target, GLint components, GLint width, GLenum format, GLenum type, const void *data);
  101. extern int    APIENTRY gluBuild2DMipmaps (GLenum target, GLint components, GLint width, GLint height, GLenum format, GLenum type, const void *data);
  102.  
  103. typedef struct GLUquadricObj GLUquadricObj;
  104. extern GLUquadricObj*    APIENTRY gluNewQuadric (void);
  105. extern void    APIENTRY gluDeleteQuadric (GLUquadricObj *state);
  106. extern void    APIENTRY gluQuadricNormals (GLUquadricObj *qobj, GLenum normals);
  107. extern void    APIENTRY gluQuadricTexture (GLUquadricObj *qobj, GLboolean textureCoords);
  108. extern void    APIENTRY gluQuadricOrientation (GLUquadricObj *qobj, GLenum orientation);
  109. extern void    APIENTRY gluQuadricDrawStyle (GLUquadricObj *qobj, GLenum drawStyle);
  110. extern void    APIENTRY gluCylinder (GLUquadricObj *qobj, GLdouble baseRadius, GLdouble topRadius, GLdouble height, GLint slices, GLint stacks);
  111. extern void    APIENTRY gluDisk (GLUquadricObj *qobj, GLdouble innerRadius, GLdouble outerRadius, GLint slices, GLint loops);
  112. extern void    APIENTRY gluPartialDisk (GLUquadricObj *qobj, GLdouble innerRadius, GLdouble outerRadius, GLint slices, GLint loops, GLdouble startAngle, GLdouble sweepAngle);
  113. extern void    APIENTRY gluSphere (GLUquadricObj *qobj, GLdouble radius, GLint slices, GLint stacks);
  114. extern void    APIENTRY gluQuadricCallback (GLUquadricObj *qobj, GLenum which, void (*fn)());
  115.  
  116. typedef struct GLUtriangulatorObj GLUtriangulatorObj;
  117. extern GLUtriangulatorObj*    APIENTRY gluNewTess (void);
  118. extern void    APIENTRY gluTessCallback (GLUtriangulatorObj *tobj, GLenum which, void (*fn)());
  119. extern void    APIENTRY gluDeleteTess (GLUtriangulatorObj *tobj);
  120. extern void    APIENTRY gluBeginPolygon (GLUtriangulatorObj *tobj);
  121. extern void    APIENTRY gluEndPolygon (GLUtriangulatorObj *tobj);
  122. extern void    APIENTRY gluNextContour (GLUtriangulatorObj *tobj, GLenum type);
  123. extern void    APIENTRY gluTessVertex (GLUtriangulatorObj *tobj, GLdouble v[3], void *data);
  124.  
  125. #ifdef __cplusplus
  126.     class GLUnurbsObj;
  127. #else 
  128.     typedef struct GLUnurbsObj GLUnurbsObj;
  129. #endif
  130. extern GLUnurbsObj*    APIENTRY gluNewNurbsRenderer (void);
  131. extern void    APIENTRY gluDeleteNurbsRenderer (GLUnurbsObj *nobj);
  132. extern void    APIENTRY gluBeginSurface (GLUnurbsObj *nobj);
  133. extern void    APIENTRY gluBeginCurve (GLUnurbsObj *nobj);
  134. extern void    APIENTRY gluEndCurve (GLUnurbsObj *nobj);
  135. extern void    APIENTRY gluEndSurface (GLUnurbsObj *nobj);
  136. extern void    APIENTRY gluBeginTrim (GLUnurbsObj *nobj);
  137. extern void    APIENTRY gluEndTrim (GLUnurbsObj *nobj);
  138. extern void    APIENTRY gluPwlCurve (GLUnurbsObj *nobj, GLint count, GLfloat *array, GLint stride, GLenum type);
  139. extern void    APIENTRY gluNurbsCurve (GLUnurbsObj *nobj, GLint nknots, GLfloat *knot, GLint stride, GLfloat *ctlarray, GLint order, GLenum type);
  140. extern void    APIENTRY gluNurbsSurface (GLUnurbsObj *nobj, GLint uknot_count, GLfloat *uknot, GLint vknot_count, GLfloat *vknot, GLint u_stride, GLint v_stride, GLfloat *ctlarray, GLint uorder, GLint vorder, GLenum type);
  141. extern void    APIENTRY gluLoadSamplingMatrices (GLUnurbsObj *nobj, const GLfloat modelMatrix[16], const GLfloat projMatrix[16], const GLint viewport[4]);        
  142. extern void    APIENTRY gluNurbsProperty (GLUnurbsObj *nobj, GLenum property, GLfloat value);
  143. extern void    APIENTRY gluGetNurbsProperty (GLUnurbsObj *nobj, GLenum property, GLfloat *value);
  144. extern void    APIENTRY gluNurbsCallback (GLUnurbsObj *nobj, GLenum which, void (*fn)());
  145. #endif
  146.  
  147. /****        Generic constants         ****/
  148.  
  149. /* Errors: (return value 0 = no error) */
  150. #define GLU_INVALID_ENUM    100900
  151. #define GLU_INVALID_VALUE    100901
  152. #define GLU_OUT_OF_MEMORY    100902
  153.  
  154. /* For laughs: */
  155. #define GLU_TRUE        GL_TRUE
  156. #define GLU_FALSE        GL_FALSE
  157.  
  158.  
  159. /****         Quadric constants         ****/
  160.  
  161. /* Types of normals: */
  162. #define GLU_SMOOTH        100000
  163. #define GLU_FLAT        100001
  164. #define GLU_NONE        100002
  165.  
  166. /* DrawStyle types: */
  167. #define GLU_POINT        100010
  168. #define GLU_LINE        100011
  169. #define GLU_FILL        100012
  170. #define GLU_SILHOUETTE        100013
  171.  
  172. /* Orientation types: */
  173. #define GLU_OUTSIDE        100020
  174. #define GLU_INSIDE        100021
  175.  
  176. /* Callback types: */
  177. /*      GLU_ERROR        100103 */
  178.  
  179.  
  180. /****         Tesselation constants         ****/
  181.  
  182. /* Callback types: */
  183. #define GLU_BEGIN         100100        /* void (*)(GLenum)    */
  184. #define GLU_VERTEX        100101        /* void (*)(void *)    */
  185. #define GLU_END            100102        /* void (*)(void)    */
  186. #define GLU_ERROR        100103        /* void (*)(GLint)    */
  187. #define GLU_EDGE_FLAG        100104        /* void (*)(GLboolean)    */
  188.  
  189. /* Contours types: */
  190. #define GLU_CW            100120
  191. #define GLU_CCW            100121
  192. #define GLU_INTERIOR        100122
  193. #define GLU_EXTERIOR        100123
  194. #define GLU_UNKNOWN        100124
  195.  
  196. #define GLU_TESS_ERROR1        100151
  197. #define GLU_TESS_ERROR2        100152
  198. #define GLU_TESS_ERROR3        100153
  199. #define GLU_TESS_ERROR4        100154
  200. #define GLU_TESS_ERROR5        100155
  201. #define GLU_TESS_ERROR6        100156
  202. #define GLU_TESS_ERROR7        100157
  203. #define GLU_TESS_ERROR8        100158
  204.  
  205.  
  206. /****        NURBS constants            ****/
  207.  
  208. /* Properties: */
  209. #define GLU_AUTO_LOAD_MATRIX    100200
  210. #define GLU_CULLING        100201
  211. #define GLU_SAMPLING_TOLERANCE    100203
  212. #define GLU_DISPLAY_MODE    100204
  213.  
  214. /* Trimming curve types */
  215. #define GLU_MAP1_TRIM_2        100210
  216. #define GLU_MAP1_TRIM_3        100211
  217.  
  218. /* Display modes: */
  219. /*      GLU_FILL         100012 */
  220. #define GLU_OUTLINE_POLYGON    100240
  221. #define GLU_OUTLINE_PATCH    100241
  222.  
  223. /* Callbacks: */
  224. /*      GLU_ERROR        100103 */
  225.  
  226. /* Errors: */
  227. #define GLU_NURBS_ERROR1    100251
  228. #define GLU_NURBS_ERROR2    100252
  229. #define GLU_NURBS_ERROR3    100253
  230. #define GLU_NURBS_ERROR4    100254
  231. #define GLU_NURBS_ERROR5    100255
  232. #define GLU_NURBS_ERROR6    100256
  233. #define GLU_NURBS_ERROR7    100257
  234. #define GLU_NURBS_ERROR8    100258
  235. #define GLU_NURBS_ERROR9    100259
  236. #define GLU_NURBS_ERROR10    100260
  237. #define GLU_NURBS_ERROR11    100261
  238. #define GLU_NURBS_ERROR12    100262
  239. #define GLU_NURBS_ERROR13    100263
  240. #define GLU_NURBS_ERROR14    100264
  241. #define GLU_NURBS_ERROR15    100265
  242. #define GLU_NURBS_ERROR16    100266
  243. #define GLU_NURBS_ERROR17    100267
  244. #define GLU_NURBS_ERROR18    100268
  245. #define GLU_NURBS_ERROR19    100269
  246. #define GLU_NURBS_ERROR20    100270
  247. #define GLU_NURBS_ERROR21    100271
  248. #define GLU_NURBS_ERROR22    100272
  249. #define GLU_NURBS_ERROR23    100273
  250. #define GLU_NURBS_ERROR24    100274
  251. #define GLU_NURBS_ERROR25    100275
  252. #define GLU_NURBS_ERROR26    100276
  253. #define GLU_NURBS_ERROR27    100277
  254. #define GLU_NURBS_ERROR28    100278
  255. #define GLU_NURBS_ERROR29    100279
  256. #define GLU_NURBS_ERROR30    100280
  257. #define GLU_NURBS_ERROR31    100281
  258. #define GLU_NURBS_ERROR32    100282
  259. #define GLU_NURBS_ERROR33    100283
  260. #define GLU_NURBS_ERROR34    100284
  261. #define GLU_NURBS_ERROR35    100285
  262. #define GLU_NURBS_ERROR36    100286
  263. #define GLU_NURBS_ERROR37    100287
  264.  
  265. #ifdef __cplusplus
  266. }
  267. #endif
  268.  
  269. #endif /* __glu_h__ */
  270.