From b003f4627b4b4600272f43ec19d4cc51f0130dff Mon Sep 17 00:00:00 2001 From: Bill Robinson Date: Sun, 19 Jun 2011 15:57:00 +0100 Subject: [PATCH] Fixed export declarations on cl-glfw-opengl package. Fixed extension checking a bit. --- generators/make-bindings-from-spec.lisp | 15 ++++++++++++++- lib/opengl-extensions.lisp | 21 ++++++++++++-------- lib/opengl-package.lisp | 34 +++++++++++++++++++++++++++++++++ lib/scaffolding.lisp | 4 ++-- 4 files changed, 63 insertions(+), 11 deletions(-) diff --git a/generators/make-bindings-from-spec.lisp b/generators/make-bindings-from-spec.lisp index d38b02e..db64686 100644 --- a/generators/make-bindings-from-spec.lisp +++ b/generators/make-bindings-from-spec.lisp @@ -38,7 +38,20 @@ Must be in the correct order.") (defparameter *enum-specs* nil) (defparameter *function-specs* nil) -(defparameter *exports* nil) +(defparameter *exports* (list '#:check-linked-program-arb '#:with-push-attrib '#:with-new-list + '#:check-linked-program '#:fallback-synchronizing-program + '#:check-compiled-shader '#:*fallback-synchronizing-program-arb* + '#:*fallback-synchronizing-program* '#:with-begin-query + '#:shader-source-from-stream-arb '#:with-setup-projection + '#:with-bind-buffer '#:with-use-program-arb '#:with-push-client-attrib + '#:fallback-synchronizing-program-arb '#:shader-source-from-stream + '#:with-use-program '#:synchronizing-program-arb '#:with-begin + '#:with-push-matrix '#:make-program '#:make-program-arb '#:make-shader + '#:synchronizing-shader-arb '#:with-projection-matrix + '#:clear-synchronizing-shaders '#:make-shader-arb + '#:check-compiled-shader-arb '#:with-map-buffer-arb + '#:with-bind-buffer-arb '#:with-push-name '#:with-map-buffer + '#:synchronizing-shader '#:synchronizing-program)) (defparameter *function-categories* nil) diff --git a/lib/opengl-extensions.lisp b/lib/opengl-extensions.lisp index b1e5502..fb24255 100644 --- a/lib/opengl-extensions.lisp +++ b/lib/opengl-extensions.lisp @@ -5,19 +5,24 @@ (in-package #:gl-ext) +(declaim (optimize (debug 3) (speed 0) (space 0))) + (defparameter *available* nil) (defun scan-available-extensions () - (let ((*readtable* (copy-readtable nil))) - (setf (readtable-case *readtable*) :preserve) - (setf *available* - (mapcar #'(lambda (ext-name) (subseq (symbol-name ext-name) 3)) - (read-from-string (format nil "(~a)" (gl:get-string gl:+extensions+))))))) + (setf *available* + (let ((extensions-string (gl:get-string gl:+extensions+))) + (when (and extensions-string + (stringp extensions-string) + (plusp (length extensions-string))) + (loop for i = 0 then (1+ j) + as j = (position #\Space extensions-string :start i) + while (< i (length extensions-string)) + collect (subseq extensions-string (+ i 3) j) + while j))))) (defun available-extensions () - (if (and *available* (not (equal *available* '(""))) (not (eql *available* '(nil)))) - *available* - (scan-available-extensions))) + (or *available* (scan-available-extensions))) (defun extension-available-p (extension) (declare (type string extension)) diff --git a/lib/opengl-package.lisp b/lib/opengl-package.lisp index a963507..4d034fd 100644 --- a/lib/opengl-package.lisp +++ b/lib/opengl-package.lisp @@ -33,6 +33,40 @@ #:char #:string #:half + #:synchronizing-program + #:synchronizing-shader + #:with-map-buffer + #:with-push-name + #:with-bind-buffer-arb + #:with-map-buffer-arb + #:check-compiled-shader-arb + #:make-shader-arb + #:clear-synchronizing-shaders + #:with-projection-matrix + #:synchronizing-shader-arb + #:make-shader + #:make-program-arb + #:make-program + #:with-push-matrix + #:with-begin + #:synchronizing-program-arb + #:with-use-program + #:shader-source-from-stream + #:fallback-synchronizing-program-arb + #:with-push-client-attrib + #:with-use-program-arb + #:with-bind-buffer + #:with-setup-projection + #:shader-source-from-stream-arb + #:with-begin-query + #:*fallback-synchronizing-program* + #:*fallback-synchronizing-program-arb* + #:check-compiled-shader + #:fallback-synchronizing-program + #:check-linked-program + #:with-new-list + #:with-push-attrib + #:check-linked-program-arb #:+current-bit+ #:+point-bit+ #:+line-bit+ diff --git a/lib/scaffolding.lisp b/lib/scaffolding.lisp index 3c7e3eb..1218fdd 100644 --- a/lib/scaffolding.lisp +++ b/lib/scaffolding.lisp @@ -140,8 +140,8 @@ (defmacro make-extension-loader (extension-name (&rest function-specs)) #-win32 (declare (ignore function-specs)) - `(defun ,(intern (format nil "LOAD-~A" extension-name)) () - (when (extension-available-p ,extension-name) + `(defun ,(intern (concatenate 'string "LOAD-" (string-upcase (string extension-name)))) () + (when (,(find-symbol "EXTENSION-AVAILABLE-P" (find-package '#:cl-glfw-opengl-extensions)) ,(string extension-name)) #+win32 (setf ;;Won't refer to gl:get-proc-address symbol directly here, as it's loaded after the scaffolding -- 2.11.4.GIT