more high-level gl bindings
authorAndy Wingo <wingo@pobox.com>
Tue, 12 Feb 2013 08:45:58 +0000 (09:45 +0100)
committerAndy Wingo <wingo@pobox.com>
Tue, 12 Feb 2013 11:05:33 +0000 (12:05 +0100)
* figl/gl.scm (set-gl-matrix-mode): Rename from gl-matrix-mode.
  (set-gl-shade-model): New export.
  (with-gl-push-attrib): New export.

figl/gl.scm

index 8fbb0b5..ba94f56 100644 (file)
@@ -47,7 +47,7 @@
 ;;; 2.6 Begin/End Paradigm
 ;;;
 
-;; emacs: (put! 'gl-begin 'scheme-indent-function 1)
+;; emacs: (put 'gl-begin 'scheme-indent-function 1)
 (define-syntax gl-begin
   (syntax-rules ()
     ((_ mode body1 body2 ...)
 (export gl-load-matrix
         gl-multiply-matrix)
 
-(re-export (%glMatrixMode . gl-matrix-mode)
+(re-export (%glMatrixMode . set-gl-matrix-mode)
            (%glLoadIdentity . gl-load-identity)
            (%glRotatef . gl-rotate)
            (%glTranslatef . gl-translate)
            (%glPushMatrix . gl-push-matrix)
            (%glPopMatrix . gl-pop-matrix))
 
+;; emacs: (put 'with-gl-push-matrix 'scheme-indent-function 0)
 (define-syntax with-gl-push-matrix
   (syntax-rules ()
     ((_ body ...)
 (re-export (%glEnable . gl-enable)
            (%glDisable . gl-disable))
 
+;;;
+;;; 2.14 Colors and Coloring
+;;;
+
+(re-export (%glShadeModel . set-gl-shade-model))
+
 \f
 ;;;
 ;;; 4.1 Per-Fragment Operations
 
 (re-export (%glReadBuffer . set-gl-read-buffer)
            (%glCopyPixels . gl-copy-pixels))
+
+;;;
+;;; 6.1 Querying GL State
+;;;
+
+;; emacs: (put 'with-gl-push-attrib 'scheme-indent-function 1)
+(define-syntax-rule (with-gl-push-attrib bits body ...)
+  (begin
+    (%glPushAttrib bits)
+    body
+    ...
+    (%glPopAttrib)))
+
+(export with-gl-push-attrib)