Minor tweaks to Charlie's patch.
Sun Jul 6 12:49:08 PDT 2008 Luis Oliveira <loliveira@common-lisp.net>
* Minor tweaks to Charlie's patch.
Warning: CRC errors found. These are probably harmless but should be repaired.
See 'darcs gzcrcs --help' for more information.
diff -rN -u old-cl-opengl/glut/interface.lisp new-cl-opengl/glut/interface.lisp
--- old-cl-opengl/glut/interface.lisp 2014-04-17 00:07:43.000000000 -0700
+++ new-cl-opengl/glut/interface.lisp 2014-04-17 00:07:43.000000000 -0700
@@ -229,14 +229,14 @@
;; When this slot unbound, DISPLAY-WINDOW calls
;; FIND-APPLICABLE-EVENTS to populate it.
(events :accessor events :initarg :events))
- (:default-initargs :pos-x -1 :pos-y -1 :height 300 :width 300 :title +default-title+
- :tick-interval nil))
+ (:default-initargs :pos-x -1 :pos-y -1 :height 300 :width 300
+ :title +default-title+ :tick-interval nil))
-(defmethod initialize-instance :after ((win base-window) &key name &allow-other-keys)
+(defmethod initialize-instance :before
+ ((win base-window) &key name &allow-other-keys)
(declare (ignore win name))
(glut:init))
-
(defgeneric display-window (window)
(:documentation
"Creates the underlying GLUT window structures and displays
diff -rN -u old-cl-opengl/tools/generate-funcs.lisp new-cl-opengl/tools/generate-funcs.lisp
--- old-cl-opengl/tools/generate-funcs.lisp 2014-04-17 00:07:43.000000000 -0700
+++ new-cl-opengl/tools/generate-funcs.lisp 2014-04-17 00:07:43.000000000 -0700
@@ -271,27 +271,31 @@
("double" . ":double")
("void" . ":void")))
+(defun multi-replace (string regexes replacements)
+ (if (null regexes)
+ string
+ (multi-replace (regex-replace (first regexes) string (first replacements))
+ (rest regexes)
+ (rest replacements))))
(defun remap-base-types (type)
(cond
((assoc type *base-types* :test #'string=)
(cdr (assoc type *base-types* :test #'string=)))
((string= type "GL" :end1 2)
- (regex-replace "EXT" (regex-replace "NV" (regex-replace "ARB" (subseq type 2) "-arb") "-nv")
- "-ext"))
+ (multi-replace (subseq type 2) '("EXT" "NV" "ARB") '("-ext" "-nv" "-arb")))
(t type)))
(defun remap-base-and-pointer-types (type)
(cond
((find #\* type :test #'char=)
;; quick hack to extract types from "foo*", probably breaks
- ;; on foo**...just replace last '*' with ''
+ ;; on foo**...just replace last '*' with ''
(let* ((base (regex-replace "[*]$" type ""))
(remapped (remap-base-types base)))
(format nil "(:pointer ~a)" remapped)))
(t (remap-base-types type))))
-
(defun fix-arg (arg)
(cond ((string= arg "t") "tee")
(t arg)))