anchor.diff:      (when (= sdl->lisp-time-offset 0)
         (set-sdl->lisp-time-offset))
       (cl:- lisp-time sdl->lisp-time-offset)))
  -
   
   (defmacro %case-events ((event &key (method :poll) (timeout nil))
                           &body event-handlers)
  
positive.code:                :finally (return (remove nil results)))))
       (sdl2:free-event ,event)))
  
  (defun collect-sdl-events (win &optional tpref)
    (declare (ignore win tpref))
    (%case-events (event)
      (:quit () (cepl.host:shutdown))))
  
  ;;----------------------------------------------------------------------
  ;; window size
  
  (defun sdl-win-size (win-handle)
    (multiple-value-list (sdl2:get-window-size win-handle)))
  
  ;;----------------------------------------------------------------------
  ;; tell cepl what to use
  
  (set-step-func #'collect-sdl-events)
  (set-swap-func #'sdl-swap)
  (set-window-size-func #'sdl-win-size)
  
negative.code: 
  (defvar *initd* nil)
  
  ;;======================================================================
  ;; api v1
  
  (defmethod sdl-init (&rest init-flags)
    (let ((flags (or init-flags :everything)))
      (unless (sdl2:was-init :everything)
        (init-sdl2-low-level flags)
        (setf *initd* t))))
  
  (defun init-sdl2-low-level (&rest sdl-init-flags)
    (let ((init-flags (autowrap:mask-apply 'sdl2::sdl-init-flags sdl-init-flags)))
      (sdl2::check-rc (sdl2::sdl-init init-flags))))
  
  ;;----------------------------------------------------------------------
  
  (defmethod sdl-shutdown ()
    (low-level-quit))
  
  (defun low-level-quit ()
    (sdl2::sdl-quit)
    (setf sdl2::*main-thread-channel* nil)
    (setf sdl2::*lisp-message-event* nil)
    (let ((init-flags (autowrap:mask-apply 'sdl2::sdl-init-flags :everything)))
      (sdl2::check-rc (sdl2::sdl-init init-flags))))
  
  ;;----------------------------------------------------------------------
  
  ;; {TODO} optimize
  (let ((sdl->lisp-time-offset 0))
  