Clone of mesa.
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

glu.h 15KB

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