anchor.diff:  (let ((max-draw-buffers -1))
     (defun get-gl-attachment-keyword (x)
       (unless (> max-draw-buffers 0)
  -      (setf max-draw-buffers (max-draw-buffers *gl-context*)))
  +      (when cepl.context:*gl-context*
  +	(setf max-draw-buffers (max-draw-buffers *gl-context*))))
       (case x
         (:c (color-attachment-enum 0))
         (:d #.(cffi:foreign-enum-value '%gl:enum :depth-attachment))
         (:s #.(cffi:foreign-enum-value '%gl:enum :stencil-attachment))
         (:ds #.(cffi:foreign-enum-value
  -              '%gl:enum :depth-stencil-attachment))
  +	      '%gl:enum :depth-stencil-attachment))
         (otherwise
          (if (<= x max-draw-buffers)
  -           (color-attachment-enum x)
  -           (error "Requested attachment ~s is outside the range of 0-~s supported by your current context"
  -                  x max-draw-buffers))))))
  +	   (color-attachment-enum x)
  +	   (if cepl.context:*gl-context*
  +	       (error "Requested attachment ~s is outside the range of 0-~s supported by your current context"
  +		      x max-draw-buffers)
  +	       (color-attachment-enum x)))))))
   
   (define-compiler-macro get-gl-attachment-keyword (&whole whole x)
  -  (case x
  -    (:c (color-attachment-enum 0))
  -    (:d #.(cffi:foreign-enum-value '%gl:enum :depth-attachment))
  -    (:s #.(cffi:foreign-enum-value '%gl:enum :stencil-attachment))
  -    (:ds #.(cffi:foreign-enum-value
  -            '%gl:enum :depth-stencil-attachment))
  -    (otherwise whole)))
  +  (if (numberp x)
  +      (color-attachment-enum x)
  +      (case x
  +	(:c (color-attachment-enum 0))
  +	(:d #.(cffi:foreign-enum-value '%gl:enum :depth-attachment))
  +	(:s #.(cffi:foreign-enum-value '%gl:enum :stencil-attachment))
  +	(:ds #.(cffi:foreign-enum-value
  +		'%gl:enum :depth-stencil-attachment))
  +	(otherwise whole))))
   
   (defun binding-shorthand (x)
     (when (symbolp x)
  
positive.code: (defun (setf attachment) (value fbo attachment-name)
    (when (%fbo-is-default fbo)
      (error "Cannot modify attachments of default-framebuffer"))
    (let ((current-value (%attachment fbo attachment-name)))
      ;; update the fbo
      (setf (%attachment fbo attachment-name) value)
      ;; update gl
      (when current-value
        (fbo-detach fbo attachment-name))
      (when value
        (fbo-attach fbo value attachment-name)))
    ;; update cached gl details
    (%update-fbo-state fbo)
    ;;
    value)
  
  
negative.code:               :image-format :gl-internal)))
      (let ((result
             (%update-fbo-state
  	    (post-gl-init
  	     (pre-gl-init
  	      (make-uninitialized-fbo)
  	      :is-default t
  	      :color-arrays
  	      (make-array (if double-buffering 2 1)
  			  :element-type 'gpu-array-t :initial-contents
  			  (cons (gen-array dimensions)
  				(when double-buffering
  				  (list (gen-array dimensions)))))
  	      :depth-array (when depth (gen-array dimensions)))
  	     :id 0))))
        (update-clear-mask result)
        (setf %default-framebuffer result
              %current-fbo result)
  