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