home *** CD-ROM | disk | FTP | other *** search
- (in-package :oou)
- (oou-provide :GWorld-u)
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;; GWorld-svm.lisp
- ;;
- ;; Copyright ⌐ 1992 Northwestern University Institute for the Learning Sciences
- ;; All Rights Reserved
- ;;
- ;; author: Michael S. Engber
- ;; Tamar Offer
- ;;
- ;; utilities for working with GWorlds
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
- (oou-dependencies :simple-view-ce
- )
-
- (export '(with-focused-GWorld with-locked-GWorld))
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
- (eval-when (:compile-toplevel :load-toplevel :execute)
-
-
- (defmacro with-locked-GWorld (gWorld &body body)
- (let ((pixMapHandle (gensym))
- (state (gensym)))
- `(with-macptrs ((,pixMapHandle (require-trap #_GetGWorldPixMap ,gWorld)))
- (let ((,state (require-trap #_GetPixelsState ,pixMapHandle)))
- (unwind-protect
- (if (require-trap #_LockPixels ,pixMapHandle)
- (progn ,@body)
- (error "unable to lock pixels - they've been purged!"))
- (require-trap #_SetPixelsState ,pixMapHandle ,state))))))
-
- #|
- (defmacro with-focused-GWorld ((gWorld &optional gDevice '(%null-ptr)) &body body)
- (let ((old-port (gensym))
- (old-gdh (gensym))
- (old-port_p (gensym))
- (old-gdh_p (gensym)))
- `(rlet ((,old-port_p :pointer)
- (,old-gdh_p :pointer))
- (require-trap #_GetGWorld ,old-port_p ,old-gdh_p)
- (with-macptrs ((,old-port (%get-ptr ,old-port_p))
- (,old-gdh (%get-ptr ,old-gdh_p)))
-
- (unwind-protect
- (with-locked-GWorld ,gWorld
- (without-interrupts
- (require-trap #_SetGWorld ,gWorld ,gDevice)
- ,@body))
- (require-trap #_SetGWorld ,old-port ,old-gdh))))))
-
- |#
-
- )
-
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-