Added maybe-support for framework on MacOSX
[cl-glfw.git] / lib / glu.lisp
blobfbacafe7f7793cab2e700a6c8632680048e0022d
1 (defpackage #:openglu
2 (:use #:cffi #:cl)
3 (:nicknames #:glu)
4 (:export +ext-object-space-tess+ +ext-nurbs-tessellator+ +false+ +true+ +version-1-1+ +version-1-2+ +version-1-3+ +version+ +extensions+ +invalid-enum+ +invalid-value+ +out-of-memory+ +incompatible-gl-version+ +invalid-operation+ +outline-polygon+ +outline-patch+ +nurbs-error+ +error+ +nurbs-begin+ +nurbs-begin-ext+ +nurbs-vertex+ +nurbs-vertex-ext+ +nurbs-normal+ +nurbs-normal-ext+ +nurbs-color+ +nurbs-color-ext+ +nurbs-texture-coord+ +nurbs-tex-coord-ext+ +nurbs-end+ +nurbs-end-ext+ +nurbs-begin-data+ +nurbs-begin-data-ext+ +nurbs-vertex-data+ +nurbs-vertex-data-ext+ +nurbs-normal-data+ +nurbs-normal-data-ext+ +nurbs-color-data+ +nurbs-color-data-ext+ +nurbs-texture-coord-data+ +nurbs-tex-coord-data-ext+ +nurbs-end-data+ +nurbs-end-data-ext+ +nurbs-error-1+ +nurbs-error-2+ +nurbs-error-3+ +nurbs-error-4+ +nurbs-error-5+ +nurbs-error-6+ +nurbs-error-7+ +nurbs-error-8+ +nurbs-error-9+ +nurbs-error-10+ +nurbs-error-11+ +nurbs-error-12+ +nurbs-error-13+ +nurbs-error-14+ +nurbs-error-15+ +nurbs-error-16+ +nurbs-error-17+ +nurbs-error-18+ +nurbs-error-19+ +nurbs-error-20+ +nurbs-error-21+ +nurbs-error-22+ +nurbs-error-23+ +nurbs-error-24+ +nurbs-error-25+ +nurbs-error-26+ +nurbs-error-27+ +nurbs-error-28+ +nurbs-error-29+ +nurbs-error-30+ +nurbs-error-31+ +nurbs-error-32+ +nurbs-error-33+ +nurbs-error-34+ +nurbs-error-35+ +nurbs-error-36+ +nurbs-error-37+ +auto-load-matrix+ +culling+ +sampling-tolerance+ +display-mode+ +parametric-tolerance+ +sampling-method+ +u-step+ +v-step+ +nurbs-mode+ +nurbs-mode-ext+ +nurbs-tessellator+ +nurbs-tessellator-ext+ +nurbs-renderer+ +nurbs-renderer-ext+ +object-parametric-error+ +object-parametric-error-ext+ +object-path-length+ +object-path-length-ext+ +path-length+ +parametric-error+ +domain-distance+ +map-1-trim-2+ +map-1-trim-3+ +point+ +line+ +fill+ +silhouette+ +smooth+ +flat+ +none+ +outside+ +inside+ +tess-begin+ +begin+ +tess-vertex+ +vertex+ +tess-end+ +end+ +tess-error+ +tess-edge-flag+ +edge-flag+ +tess-combine+ +tess-begin-data+ +tess-vertex-data+ +tess-end-data+ +tess-error-data+ +tess-edge-flag-data+ +tess-combine-data+ +cw+ +ccw+ +interior+ +exterior+ +unknown+ +tess-winding-rule+ +tess-boundary-only+ +tess-tolerance+ +tess-error-1+ +tess-error-2+ +tess-error-3+ +tess-error-4+ +tess-error-5+ +tess-error-6+ +tess-error-7+ +tess-error-8+ +tess-missing-begin-polygon+ +tess-missing-begin-contour+ +tess-missing-end-polygon+ +tess-missing-end-contour+ +tess-coord-too-large+ +tess-need-combine-callback+ +tess-winding-odd+ +tess-winding-nonzero+ +tess-winding-positive+ +tess-winding-negative+ +tess-winding-abs-geq-two+ +tess-max-coord+ begin-curve begin-polygon begin-surface begin-trim build-1d-mipmap-levels build-1d-mipmaps build-2d-mipmap-levels build-2d-mipmaps build-3d-mipmap-levels build-3d-mipmaps check-extension cylinder delete-nurbs-renderer delete-quadric delete-tess disk end-curve end-polygon end-surface end-trim error-string get-nurbs-property get-string get-tess-property load-sampling-matrices look-at new-nurbs-renderer new-quadric new-tess next-contour nurbs-callback nurbs-callback-data nurbs-callback-dataext nurbs-curve nurbs-property nurbs-surface ortho-2d partial-disk perspective pick-matrix project pwl-curve quadric-callback quadric-draw-style quadric-normals quadric-orientation quadric-texture scale-image sphere tess-begin-contour tess-begin-polygon tess-callback tess-end-contour tess-end-polygon tess-normal tess-property tess-vertex un-project un-project-4))
6 (in-package :glu)
8 (ignore-errors
9 (load-foreign-library '(:or "openglu32.dll"
10 (:default "libGLU")
11 (:default "openglu")
12 (:default "openglu32")
13 (:default "GLU")
14 (:default "glu"))))
15 ;; Extensions
16 (defconstant +ext-object-space-tess+ 1)
17 (defconstant +ext-nurbs-tessellator+ 1)
18 ;; Boolean
19 (defconstant +false+ 0)
20 (defconstant +true+ 1)
21 ;; Version
22 (defconstant +version-1-1+ 1)
23 (defconstant +version-1-2+ 1)
24 (defconstant +version-1-3+ 1)
25 ;; StringName
26 (defconstant +version+ 100800)
27 (defconstant +extensions+ 100801)
28 ;; ErrorCode
29 (defconstant +invalid-enum+ 100900)
30 (defconstant +invalid-value+ 100901)
31 (defconstant +out-of-memory+ 100902)
32 (defconstant +incompatible-gl-version+ 100903)
33 (defconstant +invalid-operation+ 100904)
34 ;; NurbsDisplay
35 ;; GLU_FILL
36 (defconstant +outline-polygon+ 100240)
37 (defconstant +outline-patch+ 100241)
38 ;; NurbsCallback
39 (defconstant +nurbs-error+ 100103)
40 (defconstant +error+ 100103)
41 (defconstant +nurbs-begin+ 100164)
42 (defconstant +nurbs-begin-ext+ 100164)
43 (defconstant +nurbs-vertex+ 100165)
44 (defconstant +nurbs-vertex-ext+ 100165)
45 (defconstant +nurbs-normal+ 100166)
46 (defconstant +nurbs-normal-ext+ 100166)
47 (defconstant +nurbs-color+ 100167)
48 (defconstant +nurbs-color-ext+ 100167)
49 (defconstant +nurbs-texture-coord+ 100168)
50 (defconstant +nurbs-tex-coord-ext+ 100168)
51 (defconstant +nurbs-end+ 100169)
52 (defconstant +nurbs-end-ext+ 100169)
53 (defconstant +nurbs-begin-data+ 100170)
54 (defconstant +nurbs-begin-data-ext+ 100170)
55 (defconstant +nurbs-vertex-data+ 100171)
56 (defconstant +nurbs-vertex-data-ext+ 100171)
57 (defconstant +nurbs-normal-data+ 100172)
58 (defconstant +nurbs-normal-data-ext+ 100172)
59 (defconstant +nurbs-color-data+ 100173)
60 (defconstant +nurbs-color-data-ext+ 100173)
61 (defconstant +nurbs-texture-coord-data+ 100174)
62 (defconstant +nurbs-tex-coord-data-ext+ 100174)
63 (defconstant +nurbs-end-data+ 100175)
64 (defconstant +nurbs-end-data-ext+ 100175)
65 ;; NurbsError
66 (defconstant +nurbs-error-1+ 100251)
67 (defconstant +nurbs-error-2+ 100252)
68 (defconstant +nurbs-error-3+ 100253)
69 (defconstant +nurbs-error-4+ 100254)
70 (defconstant +nurbs-error-5+ 100255)
71 (defconstant +nurbs-error-6+ 100256)
72 (defconstant +nurbs-error-7+ 100257)
73 (defconstant +nurbs-error-8+ 100258)
74 (defconstant +nurbs-error-9+ 100259)
75 (defconstant +nurbs-error-10+ 100260)
76 (defconstant +nurbs-error-11+ 100261)
77 (defconstant +nurbs-error-12+ 100262)
78 (defconstant +nurbs-error-13+ 100263)
79 (defconstant +nurbs-error-14+ 100264)
80 (defconstant +nurbs-error-15+ 100265)
81 (defconstant +nurbs-error-16+ 100266)
82 (defconstant +nurbs-error-17+ 100267)
83 (defconstant +nurbs-error-18+ 100268)
84 (defconstant +nurbs-error-19+ 100269)
85 (defconstant +nurbs-error-20+ 100270)
86 (defconstant +nurbs-error-21+ 100271)
87 (defconstant +nurbs-error-22+ 100272)
88 (defconstant +nurbs-error-23+ 100273)
89 (defconstant +nurbs-error-24+ 100274)
90 (defconstant +nurbs-error-25+ 100275)
91 (defconstant +nurbs-error-26+ 100276)
92 (defconstant +nurbs-error-27+ 100277)
93 (defconstant +nurbs-error-28+ 100278)
94 (defconstant +nurbs-error-29+ 100279)
95 (defconstant +nurbs-error-30+ 100280)
96 (defconstant +nurbs-error-31+ 100281)
97 (defconstant +nurbs-error-32+ 100282)
98 (defconstant +nurbs-error-33+ 100283)
99 (defconstant +nurbs-error-34+ 100284)
100 (defconstant +nurbs-error-35+ 100285)
101 (defconstant +nurbs-error-36+ 100286)
102 (defconstant +nurbs-error-37+ 100287)
103 ;; NurbsProperty
104 (defconstant +auto-load-matrix+ 100200)
105 (defconstant +culling+ 100201)
106 (defconstant +sampling-tolerance+ 100203)
107 (defconstant +display-mode+ 100204)
108 (defconstant +parametric-tolerance+ 100202)
109 (defconstant +sampling-method+ 100205)
110 (defconstant +u-step+ 100206)
111 (defconstant +v-step+ 100207)
112 (defconstant +nurbs-mode+ 100160)
113 (defconstant +nurbs-mode-ext+ 100160)
114 (defconstant +nurbs-tessellator+ 100161)
115 (defconstant +nurbs-tessellator-ext+ 100161)
116 (defconstant +nurbs-renderer+ 100162)
117 (defconstant +nurbs-renderer-ext+ 100162)
118 ;; NurbsSampling
119 (defconstant +object-parametric-error+ 100208)
120 (defconstant +object-parametric-error-ext+ 100208)
121 (defconstant +object-path-length+ 100209)
122 (defconstant +object-path-length-ext+ 100209)
123 (defconstant +path-length+ 100215)
124 (defconstant +parametric-error+ 100216)
125 (defconstant +domain-distance+ 100217)
126 ;; NurbsTrim
127 (defconstant +map-1-trim-2+ 100210)
128 (defconstant +map-1-trim-3+ 100211)
129 ;; QuadricDrawStyle
130 (defconstant +point+ 100010)
131 (defconstant +line+ 100011)
132 (defconstant +fill+ 100012)
133 (defconstant +silhouette+ 100013)
134 ;; QuadricCallback
135 ;; GLU_ERROR
136 ;; QuadricNormal
137 (defconstant +smooth+ 100000)
138 (defconstant +flat+ 100001)
139 (defconstant +none+ 100002)
140 ;; QuadricOrientation
141 (defconstant +outside+ 100020)
142 (defconstant +inside+ 100021)
143 ;; TessCallback
144 (defconstant +tess-begin+ 100100)
145 (defconstant +begin+ 100100)
146 (defconstant +tess-vertex+ 100101)
147 (defconstant +vertex+ 100101)
148 (defconstant +tess-end+ 100102)
149 (defconstant +end+ 100102)
150 (defconstant +tess-error+ 100103)
151 (defconstant +tess-edge-flag+ 100104)
152 (defconstant +edge-flag+ 100104)
153 (defconstant +tess-combine+ 100105)
154 (defconstant +tess-begin-data+ 100106)
155 (defconstant +tess-vertex-data+ 100107)
156 (defconstant +tess-end-data+ 100108)
157 (defconstant +tess-error-data+ 100109)
158 (defconstant +tess-edge-flag-data+ 100110)
159 (defconstant +tess-combine-data+ 100111)
160 ;; TessContour
161 (defconstant +cw+ 100120)
162 (defconstant +ccw+ 100121)
163 (defconstant +interior+ 100122)
164 (defconstant +exterior+ 100123)
165 (defconstant +unknown+ 100124)
166 ;; TessProperty
167 (defconstant +tess-winding-rule+ 100140)
168 (defconstant +tess-boundary-only+ 100141)
169 (defconstant +tess-tolerance+ 100142)
170 ;; TessError
171 (defconstant +tess-error-1+ 100151)
172 (defconstant +tess-error-2+ 100152)
173 (defconstant +tess-error-3+ 100153)
174 (defconstant +tess-error-4+ 100154)
175 (defconstant +tess-error-5+ 100155)
176 (defconstant +tess-error-6+ 100156)
177 (defconstant +tess-error-7+ 100157)
178 (defconstant +tess-error-8+ 100158)
179 (defconstant +tess-missing-begin-polygon+ 100151)
180 (defconstant +tess-missing-begin-contour+ 100152)
181 (defconstant +tess-missing-end-polygon+ 100153)
182 (defconstant +tess-missing-end-contour+ 100154)
183 (defconstant +tess-coord-too-large+ 100155)
184 (defconstant +tess-need-combine-callback+ 100156)
185 ;; TessWinding
186 (defconstant +tess-winding-odd+ 100130)
187 (defconstant +tess-winding-nonzero+ 100131)
188 (defconstant +tess-winding-positive+ 100132)
189 (defconstant +tess-winding-negative+ 100133)
190 (defconstant +tess-winding-abs-geq-two+ 100134)
191 ;; ***********************************************************
192 (defconstant +tess-max-coord+ 1.0d150)
193 (defcfun ("gluBeginCurve" begin-curve) :void (nurb :pointer))
194 (defcfun ("gluBeginPolygon" begin-polygon) :void (tess :pointer))
195 (defcfun ("gluBeginSurface" begin-surface) :void (nurb :pointer))
196 (defcfun ("gluBeginTrim" begin-trim) :void (nurb :pointer))
197 (defcfun ("gluBuild1DMipmapLevels" build-1d-mipmap-levels) gl:int (target gl:enum) (internalFormat gl:int) (width gl:sizei) (format gl:enum) (type gl:enum) (level gl:int) (base gl:int) (max gl:int) (data :pointer))
198 (defcfun ("gluBuild1DMipmaps" build-1d-mipmaps) gl:int (target gl:enum) (internalFormat gl:int) (width gl:sizei) (format gl:enum) (type gl:enum) (data :pointer))
199 (defcfun ("gluBuild2DMipmapLevels" build-2d-mipmap-levels) gl:int (target gl:enum) (internalFormat gl:int) (width gl:sizei) (height gl:sizei) (format gl:enum) (type gl:enum) (level gl:int) (base gl:int) (max gl:int) (data :pointer))
200 (defcfun ("gluBuild2DMipmaps" build-2d-mipmaps) gl:int (target gl:enum) (internalFormat gl:int) (width gl:sizei) (height gl:sizei) (format gl:enum) (type gl:enum) (data :pointer))
201 (defcfun ("gluBuild3DMipmapLevels" build-3d-mipmap-levels) gl:int (target gl:enum) (internalFormat gl:int) (width gl:sizei) (height gl:sizei) (depth gl:sizei) (format gl:enum) (type gl:enum) (level gl:int) (base gl:int) (max gl:int) (data :pointer))
202 (defcfun ("gluBuild3DMipmaps" build-3d-mipmaps) gl:int (target gl:enum) (internalFormat gl:int) (width gl:sizei) (height gl:sizei) (depth gl:sizei) (format gl:enum) (type gl:enum) (data :pointer))
203 (defcfun ("gluCheckExtension" check-extension) gl:boolean (extName :pointer) (extString :pointer))
204 (defcfun ("gluCylinder" cylinder) :void (quad :pointer) (base gl:double) (top gl:double) (height gl:double) (slices gl:int) (stacks gl:int))
205 (defcfun ("gluDeleteNurbsRenderer" delete-nurbs-renderer) :void (nurb :pointer))
206 (defcfun ("gluDeleteQuadric" delete-quadric) :void (quad :pointer))
207 (defcfun ("gluDeleteTess" delete-tess) :void (tess :pointer))
208 (defcfun ("gluDisk" disk) :void (quad :pointer) (inner gl:double) (outer gl:double) (slices gl:int) (loops gl:int))
209 (defcfun ("gluEndCurve" end-curve) :void (nurb :pointer))
210 (defcfun ("gluEndPolygon" end-polygon) :void (tess :pointer))
211 (defcfun ("gluEndSurface" end-surface) :void (nurb :pointer))
212 (defcfun ("gluEndTrim" end-trim) :void (nurb :pointer))
213 (defcfun ("gluErrorString" error-string) :pointer (error gl:enum))
214 (defcfun ("gluGetNurbsProperty" get-nurbs-property) :void (nurb :pointer) (property gl:enum) (data :pointer))
215 (defcfun ("gluGetString" get-string) :pointer (name gl:enum))
216 (defcfun ("gluGetTessProperty" get-tess-property) :void (tess :pointer) (which gl:enum) (data :pointer))
217 (defcfun ("gluLoadSamplingMatrices" load-sampling-matrices) :void (nurb :pointer) (model :pointer) (perspective :pointer) (view :pointer))
218 (defcfun ("gluLookAt" look-at) :void (eyeX gl:double) (eyeY gl:double) (eyeZ gl:double) (centerX gl:double) (centerY gl:double) (centerZ gl:double) (upX gl:double) (upY gl:double) (upZ gl:double))
219 (defcfun ("gluNewNurbsRenderer" new-nurbs-renderer) :pointer )
220 (defcfun ("gluNewQuadric" new-quadric) :pointer )
221 (defcfun ("gluNewTess" new-tess) :pointer )
222 (defcfun ("gluNextContour" next-contour) :void (tess :pointer) (type gl:enum))
223 (defcfun ("gluNurbsCallback" nurbs-callback) :void (nurb :pointer) (which gl:enum) (CallBackFunc :pointer))
224 (defcfun ("gluNurbsCallbackData" nurbs-callback-data) :void (nurb :pointer) (userData :pointer))
225 (defcfun ("gluNurbsCallbackDataEXT" nurbs-callback-dataext) :void (nurb :pointer) (userData :pointer))
226 (defcfun ("gluNurbsCurve" nurbs-curve) :void (nurb :pointer) (knotCount gl:int) (knots :pointer) (stride gl:int) (control :pointer) (order gl:int) (type gl:enum))
227 (defcfun ("gluNurbsProperty" nurbs-property) :void (nurb :pointer) (property gl:enum) (value gl:float))
228 (defcfun ("gluNurbsSurface" nurbs-surface) :void (nurb :pointer) (sKnotCount gl:int) (sKnots :pointer) (tKnotCount gl:int) (tKnots :pointer) (sStride gl:int) (tStride gl:int) (control :pointer) (sOrder gl:int) (tOrder gl:int) (type gl:enum))
229 (defcfun ("gluOrtho2D" ortho-2d) :void (left gl:double) (right gl:double) (bottom gl:double) (top gl:double))
230 (defcfun ("gluPartialDisk" partial-disk) :void (quad :pointer) (inner gl:double) (outer gl:double) (slices gl:int) (loops gl:int) (start gl:double) (sweep gl:double))
231 (defcfun ("gluPerspective" perspective) :void (fovy gl:double) (aspect gl:double) (zNear gl:double) (zFar gl:double))
232 (defcfun ("gluPickMatrix" pick-matrix) :void (x gl:double) (y gl:double) (delX gl:double) (delY gl:double) (viewport :pointer))
233 (defcfun ("gluProject" project) gl:int (objX gl:double) (objY gl:double) (objZ gl:double) (model :pointer) (proj :pointer) (view :pointer) (winX :pointer) (winY :pointer) (winZ :pointer))
234 (defcfun ("gluPwlCurve" pwl-curve) :void (nurb :pointer) (count gl:int) (data :pointer) (stride gl:int) (type gl:enum))
235 (defcfun ("gluQuadricCallback" quadric-callback) :void (quad :pointer) (which gl:enum) (CallBackFunc :pointer))
236 (defcfun ("gluQuadricDrawStyle" quadric-draw-style) :void (quad :pointer) (draw gl:enum))
237 (defcfun ("gluQuadricNormals" quadric-normals) :void (quad :pointer) (normal gl:enum))
238 (defcfun ("gluQuadricOrientation" quadric-orientation) :void (quad :pointer) (orientation gl:enum))
239 (defcfun ("gluQuadricTexture" quadric-texture) :void (quad :pointer) (texture gl:boolean))
240 (defcfun ("gluScaleImage" scale-image) gl:int (format gl:enum) (wIn gl:sizei) (hIn gl:sizei) (typeIn gl:enum) (dataIn :pointer) (wOut gl:sizei) (hOut gl:sizei) (typeOut gl:enum) (dataOut :pointer))
241 (defcfun ("gluSphere" sphere) :void (quad :pointer) (radius gl:double) (slices gl:int) (stacks gl:int))
242 (defcfun ("gluTessBeginContour" tess-begin-contour) :void (tess :pointer))
243 (defcfun ("gluTessBeginPolygon" tess-begin-polygon) :void (tess :pointer) (data :pointer))
244 (defcfun ("gluTessCallback" tess-callback) :void (tess :pointer) (which gl:enum) (CallBackFunc :pointer))
245 (defcfun ("gluTessEndContour" tess-end-contour) :void (tess :pointer))
246 (defcfun ("gluTessEndPolygon" tess-end-polygon) :void (tess :pointer))
247 (defcfun ("gluTessNormal" tess-normal) :void (tess :pointer) (valueX gl:double) (valueY gl:double) (valueZ gl:double))
248 (defcfun ("gluTessProperty" tess-property) :void (tess :pointer) (which gl:enum) (data gl:double))
249 (defcfun ("gluTessVertex" tess-vertex) :void (tess :pointer) (location :pointer) (data :pointer))
250 (defcfun ("gluUnProject" un-project) gl:int (winX gl:double) (winY gl:double) (winZ gl:double) (model :pointer) (proj :pointer) (view :pointer) (objX :pointer) (objY :pointer) (objZ :pointer))
251 (defcfun ("gluUnProject4" un-project-4) gl:int (winX gl:double) (winY gl:double) (winZ gl:double) (clipW gl:double) (model :pointer) (proj :pointer) (view :pointer) (nearVal gl:double) (farVal gl:double) (objX :pointer) (objY :pointer) (objZ :pointer) (objW :pointer))