Clone of mesa.
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528
  1. /* $Id: glu.h,v 1.5 1999/09/14 03:23:08 gareth Exp $ */
  2. /*
  3. * Mesa 3-D graphics library
  4. * Version: 3.1
  5. * Copyright (C) 1995-1999 Brian Paul
  6. *
  7. * This library is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU Library General Public
  9. * License as published by the Free Software Foundation; either
  10. * version 2 of the License, or (at your option) any later version.
  11. *
  12. * This library is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * Library General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Library General Public
  18. * License along with this library; if not, write to the Free
  19. * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  20. */
  21. /*
  22. * $Log: glu.h,v $
  23. * Revision 1.5 1999/09/14 03:23:08 gareth
  24. * Fixed GLUtriangulatorObj again (spelling).
  25. *
  26. * Revision 1.4 1999/09/14 01:32:58 gareth
  27. * Fixed definition of GLUtriangluatorObj for 1.3 tessellator.
  28. *
  29. * Revision 1.3 1999/09/11 11:34:21 brianp
  30. * added GLU_EXT_get_proc_address
  31. *
  32. * Revision 1.2 1999/09/10 02:08:18 gareth
  33. * Added GLU 1.3 tessellation (except winding rule code).
  34. *
  35. * Revision 1.1.1.1 1999/08/19 00:55:40 jtg
  36. * Imported sources
  37. *
  38. * Revision 3.6 1999/02/14 03:39:45 brianp
  39. * updated for BeOS R4
  40. *
  41. * Revision 3.5 1999/01/03 03:02:55 brianp
  42. * now using GLAPI and GLAPIENTRY keywords, misc Windows changes (Ted Jump)
  43. *
  44. * Revision 3.4 1998/12/01 02:34:27 brianp
  45. * applied Mark Kilgard's patches from November 30, 1998
  46. *
  47. * Revision 3.3 1998/11/17 01:14:02 brianp
  48. * minor changes for OpenStep compilation (pete@ohm.york.ac.uk)
  49. *
  50. * Revision 3.2 1998/07/26 01:36:27 brianp
  51. * changes for Windows compilation per Ted Jump
  52. *
  53. * Revision 3.1 1998/06/23 00:33:08 brianp
  54. * added some WIN32 APIENTRY, CALLBACK stuff (Eric Lassauge)
  55. *
  56. * Revision 3.0 1998/02/20 05:06:01 brianp
  57. * initial rev
  58. *
  59. */
  60. #ifndef GLU_H
  61. #define GLU_H
  62. #if defined(USE_MGL_NAMESPACE)
  63. #include "glu_mangle.h"
  64. #endif
  65. #ifdef __cplusplus
  66. extern "C" {
  67. #endif
  68. #include "GL/gl.h"
  69. /* to facilitate clean DLL building ... */
  70. #if !defined(OPENSTEP) && (defined(__WIN32__) || defined(__CYGWIN32__))
  71. # if defined(_MSC_VER) && defined(BUILD_GLU32) /* tag specify we're building mesa as a DLL */
  72. # define GLUAPI __declspec(dllexport)
  73. # elif defined(_MSC_VER) && defined(_DLL) /* tag specifying we're building for DLL runtime support */
  74. # define GLUAPI __declspec(dllimport)
  75. # else /* for use with static link lib build of Win32 edition only */
  76. # define GLUAPI extern
  77. # endif /* _STATIC_MESA support */
  78. #else
  79. # define GLUAPI extern
  80. #endif /* WIN32 / CYGWIN32 bracket */
  81. #ifdef macintosh
  82. #pragma enumsalwaysint on
  83. #if PRAGMA_IMPORT_SUPPORTED
  84. #pragma import on
  85. #endif
  86. #endif
  87. #define GLU_VERSION_1_1 1
  88. #define GLU_VERSION_1_2 1
  89. #define GLU_TRUE GL_TRUE
  90. #define GLU_FALSE GL_FALSE
  91. enum {
  92. /* Normal vectors */
  93. GLU_SMOOTH = 100000,
  94. GLU_FLAT = 100001,
  95. GLU_NONE = 100002,
  96. /* Quadric draw styles */
  97. GLU_POINT = 100010,
  98. GLU_LINE = 100011,
  99. GLU_FILL = 100012,
  100. GLU_SILHOUETTE = 100013,
  101. /* Quadric orientation */
  102. GLU_OUTSIDE = 100020,
  103. GLU_INSIDE = 100021,
  104. /* Tessellator */
  105. GLU_TESS_BEGIN = 100100,
  106. GLU_TESS_VERTEX = 100101,
  107. GLU_TESS_END = 100102,
  108. GLU_TESS_ERROR = 100103,
  109. GLU_TESS_EDGE_FLAG = 100104,
  110. GLU_TESS_COMBINE = 100105,
  111. GLU_TESS_BEGIN_DATA = 100106,
  112. GLU_TESS_VERTEX_DATA = 100107,
  113. GLU_TESS_END_DATA = 100108,
  114. GLU_TESS_ERROR_DATA = 100109,
  115. GLU_TESS_EDGE_FLAG_DATA = 100110,
  116. GLU_TESS_COMBINE_DATA = 100111,
  117. /* Winding rules */
  118. GLU_TESS_WINDING_ODD = 100130,
  119. GLU_TESS_WINDING_NONZERO = 100131,
  120. GLU_TESS_WINDING_POSITIVE = 100132,
  121. GLU_TESS_WINDING_NEGATIVE = 100133,
  122. GLU_TESS_WINDING_ABS_GEQ_TWO = 100134,
  123. /* Tessellation properties */
  124. GLU_TESS_WINDING_RULE = 100140,
  125. GLU_TESS_BOUNDARY_ONLY = 100141,
  126. GLU_TESS_TOLERANCE = 100142,
  127. /* Tessellation errors */
  128. GLU_TESS_ERROR1 = 100151, /* Missing gluBeginPolygon */
  129. GLU_TESS_ERROR2 = 100152, /* Missing gluBeginContour */
  130. GLU_TESS_ERROR3 = 100153, /* Missing gluEndPolygon */
  131. GLU_TESS_ERROR4 = 100154, /* Missing gluEndContour */
  132. GLU_TESS_ERROR5 = 100155, /* */
  133. GLU_TESS_ERROR6 = 100156, /* */
  134. GLU_TESS_ERROR7 = 100157, /* */
  135. GLU_TESS_ERROR8 = 100158, /* */
  136. /* NURBS */
  137. GLU_AUTO_LOAD_MATRIX = 100200,
  138. GLU_CULLING = 100201,
  139. GLU_PARAMETRIC_TOLERANCE= 100202,
  140. GLU_SAMPLING_TOLERANCE = 100203,
  141. GLU_DISPLAY_MODE = 100204,
  142. GLU_SAMPLING_METHOD = 100205,
  143. GLU_U_STEP = 100206,
  144. GLU_V_STEP = 100207,
  145. GLU_PATH_LENGTH = 100215,
  146. GLU_PARAMETRIC_ERROR = 100216,
  147. GLU_DOMAIN_DISTANCE = 100217,
  148. GLU_MAP1_TRIM_2 = 100210,
  149. GLU_MAP1_TRIM_3 = 100211,
  150. GLU_OUTLINE_POLYGON = 100240,
  151. GLU_OUTLINE_PATCH = 100241,
  152. GLU_NURBS_ERROR1 = 100251, /* spline order un-supported */
  153. GLU_NURBS_ERROR2 = 100252, /* too few knots */
  154. GLU_NURBS_ERROR3 = 100253, /* valid knot range is empty */
  155. GLU_NURBS_ERROR4 = 100254, /* decreasing knot sequence */
  156. GLU_NURBS_ERROR5 = 100255, /* knot multiplicity > spline order */
  157. GLU_NURBS_ERROR6 = 100256, /* endcurve() must follow bgncurve() */
  158. GLU_NURBS_ERROR7 = 100257, /* bgncurve() must precede endcurve() */
  159. GLU_NURBS_ERROR8 = 100258, /* ctrlarray or knot vector is NULL */
  160. GLU_NURBS_ERROR9 = 100259, /* can't draw pwlcurves */
  161. GLU_NURBS_ERROR10 = 100260, /* missing gluNurbsCurve() */
  162. GLU_NURBS_ERROR11 = 100261, /* missing gluNurbsSurface() */
  163. GLU_NURBS_ERROR12 = 100262, /* endtrim() must precede endsurface() */
  164. GLU_NURBS_ERROR13 = 100263, /* bgnsurface() must precede endsurface() */
  165. GLU_NURBS_ERROR14 = 100264, /* curve of improper type passed as trim curve */
  166. GLU_NURBS_ERROR15 = 100265, /* bgnsurface() must precede bgntrim() */
  167. GLU_NURBS_ERROR16 = 100266, /* endtrim() must follow bgntrim() */
  168. GLU_NURBS_ERROR17 = 100267, /* bgntrim() must precede endtrim()*/
  169. GLU_NURBS_ERROR18 = 100268, /* invalid or missing trim curve*/
  170. GLU_NURBS_ERROR19 = 100269, /* bgntrim() must precede pwlcurve() */
  171. GLU_NURBS_ERROR20 = 100270, /* pwlcurve referenced twice*/
  172. GLU_NURBS_ERROR21 = 100271, /* pwlcurve and nurbscurve mixed */
  173. GLU_NURBS_ERROR22 = 100272, /* improper usage of trim data type */
  174. GLU_NURBS_ERROR23 = 100273, /* nurbscurve referenced twice */
  175. GLU_NURBS_ERROR24 = 100274, /* nurbscurve and pwlcurve mixed */
  176. GLU_NURBS_ERROR25 = 100275, /* nurbssurface referenced twice */
  177. GLU_NURBS_ERROR26 = 100276, /* invalid property */
  178. GLU_NURBS_ERROR27 = 100277, /* endsurface() must follow bgnsurface() */
  179. GLU_NURBS_ERROR28 = 100278, /* intersecting or misoriented trim curves */
  180. GLU_NURBS_ERROR29 = 100279, /* intersecting trim curves */
  181. GLU_NURBS_ERROR30 = 100280, /* UNUSED */
  182. GLU_NURBS_ERROR31 = 100281, /* unconnected trim curves */
  183. GLU_NURBS_ERROR32 = 100282, /* unknown knot error */
  184. GLU_NURBS_ERROR33 = 100283, /* negative vertex count encountered */
  185. GLU_NURBS_ERROR34 = 100284, /* negative byte-stride */
  186. GLU_NURBS_ERROR35 = 100285, /* unknown type descriptor */
  187. GLU_NURBS_ERROR36 = 100286, /* null control point reference */
  188. GLU_NURBS_ERROR37 = 100287, /* duplicate point on pwlcurve */
  189. /* Errors */
  190. GLU_INVALID_ENUM = 100900,
  191. GLU_INVALID_VALUE = 100901,
  192. GLU_OUT_OF_MEMORY = 100902,
  193. GLU_INCOMPATIBLE_GL_VERSION = 100903,
  194. /* New in GLU 1.1 */
  195. GLU_VERSION = 100800,
  196. GLU_EXTENSIONS = 100801,
  197. /*** GLU 1.0 tessellation - obsolete! ***/
  198. /* Contour types */
  199. GLU_CW = 100120,
  200. GLU_CCW = 100121,
  201. GLU_INTERIOR = 100122,
  202. GLU_EXTERIOR = 100123,
  203. GLU_UNKNOWN = 100124,
  204. /* Tessellator */
  205. GLU_BEGIN = GLU_TESS_BEGIN,
  206. GLU_VERTEX = GLU_TESS_VERTEX,
  207. GLU_END = GLU_TESS_END,
  208. GLU_ERROR = GLU_TESS_ERROR,
  209. GLU_EDGE_FLAG = GLU_TESS_EDGE_FLAG
  210. };
  211. /*
  212. * These are the GLU 1.1 typedefs. GLU 1.3 has different ones!
  213. */
  214. #if defined(__BEOS__)
  215. /* The BeOS does something funky and makes these typedefs in one
  216. * of its system headers.
  217. */
  218. #else
  219. typedef struct GLUquadric GLUquadricObj;
  220. typedef struct GLUnurbs GLUnurbsObj;
  221. /* FIXME: We need to implement the other 1.3 typedefs - GH */
  222. typedef struct GLUtesselator GLUtesselator;
  223. typedef GLUtesselator GLUtriangulatorObj;
  224. #endif
  225. #if defined(__BEOS__) || defined(__QUICKDRAW__)
  226. #pragma export on
  227. #endif
  228. /*
  229. *
  230. * Miscellaneous functions
  231. *
  232. */
  233. GLUAPI void GLAPIENTRY gluLookAt( GLdouble eyex, GLdouble eyey, GLdouble eyez,
  234. GLdouble centerx, GLdouble centery,
  235. GLdouble centerz,
  236. GLdouble upx, GLdouble upy, GLdouble upz );
  237. GLUAPI void GLAPIENTRY gluOrtho2D( GLdouble left, GLdouble right,
  238. GLdouble bottom, GLdouble top );
  239. GLUAPI void GLAPIENTRY gluPerspective( GLdouble fovy, GLdouble aspect,
  240. GLdouble zNear, GLdouble zFar );
  241. GLUAPI void GLAPIENTRY gluPickMatrix( GLdouble x, GLdouble y,
  242. GLdouble width, GLdouble height,
  243. const GLint viewport[4] );
  244. GLUAPI GLint GLAPIENTRY gluProject( GLdouble objx, GLdouble objy, GLdouble objz,
  245. const GLdouble modelMatrix[16],
  246. const GLdouble projMatrix[16],
  247. const GLint viewport[4],
  248. GLdouble *winx, GLdouble *winy,
  249. GLdouble *winz );
  250. GLUAPI GLint GLAPIENTRY gluUnProject( GLdouble winx, GLdouble winy,
  251. GLdouble winz,
  252. const GLdouble modelMatrix[16],
  253. const GLdouble projMatrix[16],
  254. const GLint viewport[4],
  255. GLdouble *objx, GLdouble *objy,
  256. GLdouble *objz );
  257. GLUAPI const GLubyte* GLAPIENTRY gluErrorString( GLenum errorCode );
  258. /*
  259. *
  260. * Mipmapping and image scaling
  261. *
  262. */
  263. GLUAPI GLint GLAPIENTRY gluScaleImage( GLenum format,
  264. GLint widthin, GLint heightin,
  265. GLenum typein, const void *datain,
  266. GLint widthout, GLint heightout,
  267. GLenum typeout, void *dataout );
  268. GLUAPI GLint GLAPIENTRY gluBuild1DMipmaps( GLenum target, GLint components,
  269. GLint width, GLenum format,
  270. GLenum type, const void *data );
  271. GLUAPI GLint GLAPIENTRY gluBuild2DMipmaps( GLenum target, GLint components,
  272. GLint width, GLint height,
  273. GLenum format,
  274. GLenum type, const void *data );
  275. /*
  276. *
  277. * Quadrics
  278. *
  279. */
  280. GLUAPI GLUquadricObj* GLAPIENTRY gluNewQuadric( void );
  281. GLUAPI void GLAPIENTRY gluDeleteQuadric( GLUquadricObj *state );
  282. GLUAPI void GLAPIENTRY gluQuadricDrawStyle( GLUquadricObj *quadObject,
  283. GLenum drawStyle );
  284. GLUAPI void GLAPIENTRY gluQuadricOrientation( GLUquadricObj *quadObject,
  285. GLenum orientation );
  286. GLUAPI void GLAPIENTRY gluQuadricNormals( GLUquadricObj *quadObject,
  287. GLenum normals );
  288. GLUAPI void GLAPIENTRY gluQuadricTexture( GLUquadricObj *quadObject,
  289. GLboolean textureCoords );
  290. GLUAPI void GLAPIENTRY gluQuadricCallback( GLUquadricObj *qobj,
  291. GLenum which, void (GLCALLBACK *fn)() );
  292. GLUAPI void GLAPIENTRY gluCylinder( GLUquadricObj *qobj,
  293. GLdouble baseRadius,
  294. GLdouble topRadius,
  295. GLdouble height,
  296. GLint slices, GLint stacks );
  297. GLUAPI void GLAPIENTRY gluSphere( GLUquadricObj *qobj,
  298. GLdouble radius, GLint slices, GLint stacks );
  299. GLUAPI void GLAPIENTRY gluDisk( GLUquadricObj *qobj,
  300. GLdouble innerRadius, GLdouble outerRadius,
  301. GLint slices, GLint loops );
  302. GLUAPI void GLAPIENTRY gluPartialDisk( GLUquadricObj *qobj, GLdouble innerRadius,
  303. GLdouble outerRadius, GLint slices,
  304. GLint loops, GLdouble startAngle,
  305. GLdouble sweepAngle );
  306. /*
  307. *
  308. * Nurbs
  309. *
  310. */
  311. GLUAPI GLUnurbsObj* GLAPIENTRY gluNewNurbsRenderer( void );
  312. GLUAPI void GLAPIENTRY gluDeleteNurbsRenderer( GLUnurbsObj *nobj );
  313. GLUAPI void GLAPIENTRY gluLoadSamplingMatrices( GLUnurbsObj *nobj,
  314. const GLfloat modelMatrix[16],
  315. const GLfloat projMatrix[16],
  316. const GLint viewport[4] );
  317. GLUAPI void GLAPIENTRY gluNurbsProperty( GLUnurbsObj *nobj, GLenum property,
  318. GLfloat value );
  319. GLUAPI void GLAPIENTRY gluGetNurbsProperty( GLUnurbsObj *nobj, GLenum property,
  320. GLfloat *value );
  321. GLUAPI void GLAPIENTRY gluBeginCurve( GLUnurbsObj *nobj );
  322. GLUAPI void GLAPIENTRY gluEndCurve( GLUnurbsObj * nobj );
  323. GLUAPI void GLAPIENTRY gluNurbsCurve( GLUnurbsObj *nobj, GLint nknots,
  324. GLfloat *knot, GLint stride,
  325. GLfloat *ctlarray, GLint order,
  326. GLenum type );
  327. GLUAPI void GLAPIENTRY gluBeginSurface( GLUnurbsObj *nobj );
  328. GLUAPI void GLAPIENTRY gluEndSurface( GLUnurbsObj * nobj );
  329. GLUAPI void GLAPIENTRY gluNurbsSurface( GLUnurbsObj *nobj,
  330. GLint sknot_count, GLfloat *sknot,
  331. GLint tknot_count, GLfloat *tknot,
  332. GLint s_stride, GLint t_stride,
  333. GLfloat *ctlarray,
  334. GLint sorder, GLint torder,
  335. GLenum type );
  336. GLUAPI void GLAPIENTRY gluBeginTrim( GLUnurbsObj *nobj );
  337. GLUAPI void GLAPIENTRY gluEndTrim( GLUnurbsObj *nobj );
  338. GLUAPI void GLAPIENTRY gluPwlCurve( GLUnurbsObj *nobj, GLint count,
  339. GLfloat *array, GLint stride, GLenum type );
  340. GLUAPI void GLAPIENTRY gluNurbsCallback( GLUnurbsObj *nobj, GLenum which,
  341. void (GLCALLBACK *fn)() );
  342. /*
  343. *
  344. * Polygon tessellation
  345. *
  346. */
  347. GLUAPI GLUtesselator* GLAPIENTRY gluNewTess( void );
  348. GLUAPI void GLAPIENTRY gluDeleteTess( GLUtesselator *tobj );
  349. GLUAPI void GLAPIENTRY gluTessBeginPolygon( GLUtesselator *tobj,
  350. void *polygon_data );
  351. GLUAPI void GLAPIENTRY gluTessBeginContour( GLUtesselator *tobj );
  352. GLUAPI void GLAPIENTRY gluTessVertex( GLUtesselator *tobj, GLdouble coords[3],
  353. void *vertex_data );
  354. GLUAPI void GLAPIENTRY gluTessEndContour( GLUtesselator *tobj );
  355. GLUAPI void GLAPIENTRY gluTessEndPolygon( GLUtesselator *tobj );
  356. GLUAPI void GLAPIENTRY gluTessProperty( GLUtesselator *tobj, GLenum which,
  357. GLdouble value );
  358. GLUAPI void GLAPIENTRY gluTessNormal( GLUtesselator *tobj, GLdouble x,
  359. GLdouble y, GLdouble z );
  360. GLUAPI void GLAPIENTRY gluTessCallback( GLUtesselator *tobj, GLenum which,
  361. void (GLCALLBACK *fn)() );
  362. GLUAPI void GLAPIENTRY gluGetTessProperty( GLUtesselator *tobj, GLenum which,
  363. GLdouble *value );
  364. /*
  365. *
  366. * Obsolete 1.0 tessellation functions
  367. *
  368. */
  369. GLUAPI void GLAPIENTRY gluBeginPolygon( GLUtesselator *tobj );
  370. GLUAPI void GLAPIENTRY gluNextContour( GLUtesselator *tobj, GLenum type );
  371. GLUAPI void GLAPIENTRY gluEndPolygon( GLUtesselator *tobj );
  372. /*
  373. *
  374. * New functions in GLU 1.1
  375. *
  376. */
  377. GLUAPI const GLubyte* GLAPIENTRY gluGetString( GLenum name );
  378. /*
  379. * GLU_EXT_get_proc_address extensions
  380. */
  381. #ifdef GL_EXT_get_proc_address
  382. /* This extension requires GL_EXT_get_proc_address */
  383. GLUAPI GLfunction GLAPIENTRY gluGetProcAddressEXT( const GLubyte *procName );
  384. #define GLU_EXT_get_proc_address 1
  385. #endif /* GL_EXT_get_proc_address */
  386. #if defined(__BEOS__) || defined(__QUICKDRAW__)
  387. #pragma export off
  388. #endif
  389. #ifdef macintosh
  390. #pragma enumsalwaysint reset
  391. #if PRAGMA_IMPORT_SUPPORTED
  392. #pragma import off
  393. #endif
  394. #endif
  395. #ifdef __cplusplus
  396. }
  397. #endif
  398. #endif