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