home *** CD-ROM | disk | FTP | other *** search
/ Chip 1997 April / Chip_1997-04_cd.bin / prezent / cb / data.z / GLU.H < prev    next >
C/C++ Source or Header  |  1997-01-16  |  11KB  |  255 lines

  1. /*++ BUILD Version: 0004    // Increment this if a change has global effects
  2.  
  3. Module Name:
  4.  
  5.     glu.h
  6.  
  7. Abstract:
  8.  
  9.     Procedure declarations, constant definitions and macros for the OpenGL
  10.     Utility Library.
  11.  
  12. --*/
  13.  
  14. /* $Copyright: 1994$ */
  15.  
  16. #ifndef __GLU_H__
  17. #define __GLU_H__
  18. #define __GLU_H
  19.  
  20. /*
  21. ** Copyright 1991-1993, Silicon Graphics, Inc.
  22. ** All Rights Reserved.
  23. ** 
  24. ** This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
  25. ** the contents of this file may not be disclosed to third parties, copied or
  26. ** duplicated in any form, in whole or in part, without the prior written
  27. ** permission of Silicon Graphics, Inc.
  28. ** 
  29. ** RESTRICTED RIGHTS LEGEND:
  30. ** Use, duplication or disclosure by the Government is subject to restrictions
  31. ** as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
  32. ** and Computer Software clause at DFARS 252.227-7013, and/or in similar or
  33. ** successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
  34. ** rights reserved under the Copyright Laws of the United States.
  35. */
  36.  
  37. #include <GL/gl.h>
  38.  
  39. #ifdef __cplusplus
  40. extern "C" {
  41. #endif
  42.  
  43. /*
  44. ** Return the error string associated with a particular error code.
  45. ** This will return 0 for an invalid error code.
  46. **
  47. ** The generic function prototype that can be compiled for ANSI or Unicode
  48. ** is defined as follows:
  49. **
  50. ** LPCTSTR APIENTRY gluErrorStringWIN (GLenum errCode);
  51. */
  52. #ifdef UNICODE
  53. #define gluErrorStringWIN(errCode) ((LPCSTR)  gluErrorUnicodeStringEXT(errCode))
  54. #else
  55. #define gluErrorStringWIN(errCode) ((LPCWSTR) gluErrorString(errCode))
  56. #endif
  57. const GLubyte* APIENTRY gluErrorString (GLenum errCode);
  58. const wchar_t* APIENTRY gluErrorUnicodeStringEXT (GLenum errCode);
  59.  
  60. void APIENTRY gluOrtho2D (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top);
  61. void APIENTRY gluPerspective (GLdouble fovy, GLdouble aspect, GLdouble zNear, GLdouble zFar);
  62. void APIENTRY gluPickMatrix (GLdouble x, GLdouble y, GLdouble width, GLdouble height, GLint viewport[4]);
  63. void APIENTRY gluLookAt (GLdouble eyex, GLdouble eyey, GLdouble eyez, GLdouble centerx, GLdouble centery, GLdouble centerz, GLdouble upx, GLdouble upy, GLdouble upz);
  64. 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);
  65. 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);
  66.  
  67. int APIENTRY gluScaleImage (GLenum format, GLint widthin, GLint heightin, GLenum typein, const void *datain, GLint widthout, GLint heightout, GLenum typeout, void *dataout);
  68.  
  69. int APIENTRY gluBuild1DMipmaps (GLenum target, GLint components, GLint width, GLenum format, GLenum type, const void *data);
  70. int APIENTRY gluBuild2DMipmaps (GLenum target, GLint components, GLint width, GLint height, GLenum format, GLenum type, const void *data);
  71.  
  72. typedef struct GLUquadricObj GLUquadricObj;
  73. GLUquadricObj* APIENTRY gluNewQuadric (void);
  74. void APIENTRY gluDeleteQuadric (GLUquadricObj *state);
  75. void APIENTRY gluQuadricNormals (GLUquadricObj *quadObject, GLenum normals);
  76. void APIENTRY gluQuadricTexture (GLUquadricObj *quadObject, GLboolean textureCoords);
  77. void APIENTRY gluQuadricOrientation (GLUquadricObj *quadObject, GLenum orientation);
  78. void APIENTRY gluQuadricDrawStyle (GLUquadricObj *quadObject, GLenum drawStyle);
  79. void APIENTRY gluCylinder (GLUquadricObj *qobj, GLdouble baseRadius, GLdouble topRadius, GLdouble height, GLint slices, GLint stacks);
  80. void APIENTRY gluDisk (GLUquadricObj *qobj, GLdouble innerRadius, GLdouble outerRadius, GLint slices, GLint loops);
  81. void APIENTRY gluPartialDisk (GLUquadricObj *qobj, GLdouble innerRadius, GLdouble outerRadius, GLint slices, GLint loops, GLdouble startAngle, GLdouble sweepAngle);
  82. void APIENTRY gluSphere (GLUquadricObj *qobj, GLdouble radius, GLint slices, GLint stacks);
  83. void APIENTRY gluQuadricCallback (GLUquadricObj *qobj, GLenum which, void (CALLBACK* fn)());
  84.  
  85. typedef struct GLUtriangulatorObj GLUtriangulatorObj;
  86. GLUtriangulatorObj* APIENTRY gluNewTess (void);
  87. void APIENTRY gluTessCallback (GLUtriangulatorObj *tobj, GLenum which, void (CALLBACK* fn)());
  88. void APIENTRY gluDeleteTess (GLUtriangulatorObj *tobj);
  89. void APIENTRY gluBeginPolygon (GLUtriangulatorObj *tobj);
  90. void APIENTRY gluEndPolygon (GLUtriangulatorObj *tobj);
  91. void APIENTRY gluNextContour (GLUtriangulatorObj *tobj, GLenum type);
  92. void APIENTRY gluTessVertex (GLUtriangulatorObj *tobj, GLdouble v[3], void *data);
  93.  
  94. #ifdef __cplusplus
  95.     class GLUnurbsObj;
  96. #else 
  97.     typedef struct GLUnurbsObj GLUnurbsObj;
  98. #endif
  99. GLUnurbsObj* APIENTRY gluNewNurbsRenderer (void);
  100. void APIENTRY gluDeleteNurbsRenderer (GLUnurbsObj *nobj);
  101. void APIENTRY gluBeginSurface (GLUnurbsObj *nobj);
  102. void APIENTRY gluBeginCurve (GLUnurbsObj *nobj);
  103. void APIENTRY gluEndCurve (GLUnurbsObj *nobj);
  104. void APIENTRY gluEndSurface (GLUnurbsObj *nobj);
  105. void APIENTRY gluBeginTrim (GLUnurbsObj *nobj);
  106. void APIENTRY gluEndTrim (GLUnurbsObj *nobj);
  107. void APIENTRY gluPwlCurve (GLUnurbsObj *nobj, GLint count, GLfloat *array, GLint stride, GLenum type);
  108. void APIENTRY gluNurbsCurve (GLUnurbsObj *nobj, GLint nknots, GLfloat *knot, GLint stride, GLfloat *ctlarray, GLint order, GLenum type);
  109. void APIENTRY gluNurbsSurface (GLUnurbsObj *nobj, GLint sknot_count, GLfloat *sknot, GLint tknot_count, GLfloat *tknot, GLint s_stride, GLint t_stride, GLfloat *ctlarray, GLint sorder, GLint torder, GLenum type);
  110. void APIENTRY gluLoadSamplingMatrices (GLUnurbsObj *nobj, const GLfloat modelMatrix[16], const GLfloat projMatrix[16], const GLint viewport[4]);
  111. void APIENTRY gluNurbsProperty (GLUnurbsObj *nobj, GLenum property, GLfloat value);
  112. void APIENTRY gluGetNurbsProperty (GLUnurbsObj *nobj, GLenum property, GLfloat *value);
  113. void APIENTRY gluNurbsCallback (GLUnurbsObj *nobj, GLenum which, void (CALLBACK* fn)());
  114.  
  115.  
  116. /****           Callback function prototypes    ****/
  117.  
  118. /* gluQuadricCallback */
  119. typedef void (CALLBACK* GLUquadricErrorProc) (GLenum);
  120.  
  121. /* gluTessCallback */
  122. typedef void (CALLBACK* GLUtessBeginProc)    (GLenum);
  123. typedef void (CALLBACK* GLUtessEdgeFlagProc) (GLboolean);
  124. typedef void (CALLBACK* GLUtessVertexProc)   (void *);
  125. typedef void (CALLBACK* GLUtessEndProc)      (void);
  126. typedef void (CALLBACK* GLUtessErrorProc)    (GLenum);
  127.  
  128. /* gluNurbsCallback */
  129. typedef void (CALLBACK* GLUnurbsErrorProc)   (GLenum);
  130.  
  131.  
  132. /****           Generic constants               ****/
  133.  
  134. /* Errors: (return value 0 = no error) */
  135. #define GLU_INVALID_ENUM        100900
  136. #define GLU_INVALID_VALUE       100901
  137. #define GLU_OUT_OF_MEMORY       100902
  138.  
  139. /* For laughs: */
  140. #define GLU_TRUE                GL_TRUE
  141. #define GLU_FALSE               GL_FALSE
  142.  
  143.  
  144. /****           Quadric constants               ****/
  145.  
  146. /* Types of normals: */
  147. #define GLU_SMOOTH              100000
  148. #define GLU_FLAT                100001
  149. #define GLU_NONE                100002
  150.  
  151. /* DrawStyle types: */
  152. #define GLU_POINT               100010
  153. #define GLU_LINE                100011
  154. #define GLU_FILL                100012
  155. #define GLU_SILHOUETTE          100013
  156.  
  157. /* Orientation types: */
  158. #define GLU_OUTSIDE             100020
  159. #define GLU_INSIDE              100021
  160.  
  161. /* Callback types: */
  162. /*      GLU_ERROR               100103 */
  163.  
  164.  
  165. /****           Tesselation constants           ****/
  166.  
  167. /* Callback types: */
  168. #define GLU_BEGIN               100100          /* void (*)(GLenum)     */
  169. #define GLU_VERTEX              100101          /* void (*)(void *)     */
  170. #define GLU_END                 100102          /* void (*)(void)       */
  171. #define GLU_ERROR               100103          /* void (*)(GLint)      */
  172. #define GLU_EDGE_FLAG           100104          /* void (*)(GLboolean)  */
  173.  
  174. /* Contours types: */
  175. #define GLU_CW                  100120
  176. #define GLU_CCW                 100121
  177. #define GLU_INTERIOR            100122
  178. #define GLU_EXTERIOR            100123
  179. #define GLU_UNKNOWN             100124
  180.  
  181. #define GLU_TESS_ERROR1         100151
  182. #define GLU_TESS_ERROR2         100152
  183. #define GLU_TESS_ERROR3         100153
  184. #define GLU_TESS_ERROR4         100154
  185. #define GLU_TESS_ERROR5         100155
  186. #define GLU_TESS_ERROR6         100156
  187. #define GLU_TESS_ERROR7         100157
  188. #define GLU_TESS_ERROR8         100158
  189.  
  190.  
  191. /****           NURBS constants                 ****/
  192.  
  193. /* Properties: */
  194. #define GLU_AUTO_LOAD_MATRIX    100200
  195. #define GLU_CULLING             100201
  196. #define GLU_SAMPLING_TOLERANCE  100203
  197. #define GLU_DISPLAY_MODE        100204
  198.  
  199. /* Trimming curve types */
  200. #define GLU_MAP1_TRIM_2         100210
  201. #define GLU_MAP1_TRIM_3         100211
  202.  
  203. /* Display modes: */
  204. /*      GLU_FILL                100012 */
  205. #define GLU_OUTLINE_POLYGON     100240
  206. #define GLU_OUTLINE_PATCH       100241
  207.  
  208. /* Callbacks: */
  209. /*      GLU_ERROR               100103 */
  210.  
  211. /* Errors: */
  212. #define GLU_NURBS_ERROR1        100251
  213. #define GLU_NURBS_ERROR2        100252
  214. #define GLU_NURBS_ERROR3        100253
  215. #define GLU_NURBS_ERROR4        100254
  216. #define GLU_NURBS_ERROR5        100255
  217. #define GLU_NURBS_ERROR6        100256
  218. #define GLU_NURBS_ERROR7        100257
  219. #define GLU_NURBS_ERROR8        100258
  220. #define GLU_NURBS_ERROR9        100259
  221. #define GLU_NURBS_ERROR10       100260
  222. #define GLU_NURBS_ERROR11       100261
  223. #define GLU_NURBS_ERROR12       100262
  224. #define GLU_NURBS_ERROR13       100263
  225. #define GLU_NURBS_ERROR14       100264
  226. #define GLU_NURBS_ERROR15       100265
  227. #define GLU_NURBS_ERROR16       100266
  228. #define GLU_NURBS_ERROR17       100267
  229. #define GLU_NURBS_ERROR18       100268
  230. #define GLU_NURBS_ERROR19       100269
  231. #define GLU_NURBS_ERROR20       100270
  232. #define GLU_NURBS_ERROR21       100271
  233. #define GLU_NURBS_ERROR22       100272
  234. #define GLU_NURBS_ERROR23       100273
  235. #define GLU_NURBS_ERROR24       100274
  236. #define GLU_NURBS_ERROR25       100275
  237. #define GLU_NURBS_ERROR26       100276
  238. #define GLU_NURBS_ERROR27       100277
  239. #define GLU_NURBS_ERROR28       100278
  240. #define GLU_NURBS_ERROR29       100279
  241. #define GLU_NURBS_ERROR30       100280
  242. #define GLU_NURBS_ERROR31       100281
  243. #define GLU_NURBS_ERROR32       100282
  244. #define GLU_NURBS_ERROR33       100283
  245. #define GLU_NURBS_ERROR34       100284
  246. #define GLU_NURBS_ERROR35       100285
  247. #define GLU_NURBS_ERROR36       100286
  248. #define GLU_NURBS_ERROR37       100287
  249.  
  250. #ifdef __cplusplus
  251. }
  252. #endif
  253.  
  254. #endif /* __GLU_H__ */
  255.