glu.pp 21 KB

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