anchor.diff:     (gl-draw-buffers :accessor gl-draw-buffers :initarg :gl-draw-buffers
                       :initform '(:color-attachment0))))
   
  -(defgeneric attach-framebuffer-texture (fb-target attachment-point texture &key level layer))
  +(defgeneric attach-framebuffer-texture (fb-target attachment-point texture &key))
   
   (defmethod attach-framebuffer-texture (fb-target attachment-point (texture texture-2d)
  -                                       &key (level 0) layer)
  -  (declare (ignore layer))
  +                                       &key (level 0))
     (gl:framebuffer-texture-2d fb-target attachment-point (target texture) (id texture) level))
  +
  +(defmethod attach-framebuffer-texture (fb-target attachment-point (buffer renderbuffer) &key)
  +  (gl:framebuffer-renderbuffer fb-target attachment-point :renderbuffer (id buffer)))
   
   (defmethod gl-finalize ((obj framebuffer-object) &optional errorp)
     (flet ((get-attachment (tex)
  
positive.code:     (when (depth-attachment obj)
        (gl-finalize (get-attachment (depth-attachment obj)) errorp))
      (when (depth-stencil-attachment obj)
        (gl-finalize (get-attachment (depth-stencil-attachment obj)) errorp)))
    (setf (id obj) (gl:gen-framebuffer))
    (gl:bind-framebuffer :framebuffer (id obj))
    (loop
       for tail on (color-attachments obj) by #'cddr
       for (attachment-point attachment) = tail
       do (attach :framebuffer attachment-point attachment))
    (when (depth-attachment obj)
      (attach-framebuffer-texture :framebuffer :depth-attachment  (depth-attachment obj)))
    (when (depth-stencil-attachment obj)
      (attach-framebuffer-texture
       :framebuffer :depth-stencil-attachment (depth-stencil-attachment obj)))
    (gl:draw-buffers (gl-draw-buffers obj))
    (gl:bind-framebuffer :framebuffer 0))
  
  
  ;;; Graphics modes are the state controlled by gl:enable and gl:disable. They are represented as
  
negative.code: (defmethod make-default-glstate-member ((name (eql 'glstate-framebuffers)))
    (make-instance 'gl-framebuffers))
  
  (define-gl-object framebuffer-object ()
    ((color-attachments :accessor color-attachments :initarg :color-attachments :initform nil
                        :documentation "plist of attachment names and attachment specs. An attachment
  