Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

584 lines
18 KiB

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