Fixed export declarations on cl-glfw-opengl package.
authorBill Robinson <airbaggins@gmail.com>
Sun, 19 Jun 2011 14:57:00 +0000 (19 15:57 +0100)
committerBill Robinson <airbaggins@gmail.com>
Sun, 19 Jun 2011 14:57:00 +0000 (19 15:57 +0100)
Fixed extension checking a bit.

generators/make-bindings-from-spec.lisp
lib/opengl-extensions.lisp
lib/opengl-package.lisp
lib/scaffolding.lisp

index d38b02e..db64686 100644 (file)
@@ -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)
 
index b1e5502..fb24255 100644 (file)
@@ -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))
index a963507..4d034fd 100644 (file)
            #: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+
index 3c7e3eb..1218fdd 100644 (file)
 
 (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