anchor.diff:                       (aref vertices (+ 2 (* i 3)))))))
   
   (defstruct display-list
  -  (index -1)
  -  primitive
  +  (index -1) ;; GL display list index
  +  (primitive :triangles)
     start end
     vb ib)
  +
  +(defun destroy-display-list (dl)
  +  (if (display-list-vb dl)
  +      (progn (destroy-vertex-buffer (display-list-vb dl))
  +             (destroy-index-buffer (display-list-ib dl)))
  +      (gl:delete-lists (display-list-index dl) 1)))
   
   (defun load-primitive (indices vertices &key (primitive :triangles)
                                                colors tex-coords normals
  
positive.code:                  (gl:enable-client-state :color-array)
                   (incf offset (* (vertex-buffer-nb-vertices vb) 4)))
                 (when (vertex-has-tex-coords (vertex-buffer-format vb))
                   (gl:active-texture 0)
                   (%gl:tex-coord-pointer 2 :float 0 (cffi:make-pointer (* offset elem-size)))
                   (gl:enable-client-state :texture-coord-array)
                   (incf offset (* (vertex-buffer-nb-vertices vb) 2)))
  
negative.code: 
  
  (defun destroy-index-buffer (ib)
    (gl:delete-buffers (list (index-buffer-index ib))))
  
  ;;; Primitive rendering
  (defun render-primitive (indices vertices &key (primitive :triangles)
                                                  colors tex-coords normals
                                                  (start 0) (end (length indices)))
    "Immediate mode rendering."
    (gl:with-primitive primitive
      (loop for index from start below end
         for i = (aref indices index)
         when colors
  