anchor.diff:          (gl:uniformi (gl:get-uniform-location *current-shader* "base-texture") 0)))
   
       texture))
  -  ;|#())
  +                                        ;|#())
   
   
   (defmacro defdrawmethod (class &rest args)
                                           ;produces a (defmethod draw ((class class)) ...)
                                           ;it executes a body and afterwards (unless :no-texture is provided) binds the appropriate texture and shader.
  - `(defmethod draw ((,class ,class))
  -    (declare (special %texture-chosen%)) ; see corresponding :around method below.
  -    ,@args       ;body. (don't bother removing a possible :no-texture)
  -    (let* ((shader-name (shader ,class))
  -           (shader (or (and shader-name
  -                            (getf *shaders* (shader ,class)))
  -                       0)))
  -      ,(when (or (not args)
  -                 (not (eq (first args) :no-texture)))
  -             `(when (and (not %texture-chosen%) ;if a more specific texture has been found, don't overwrite it
  -                     (drawable ,class)
  -                     (bind-texture ,class ',class shader-name))
  -               (setf %texture-chosen% t)))
  -      (unless *disable-shaders*
  -        (when (not (= *current-shader* (or shader 0)))
  -          (gl:use-program shader)
  -          (setf *current-shader* shader)))
  -      (when (drawable ,class)
  -        (call-next-method)))))
  +  `(defmethod draw ((,class ,class))
  +     (declare (special %texture-chosen%)) ; see corresponding :around method below.
  +     ,@args       ;body. (don't bother removing a possible :no-texture)
  +     (let* ((shader-name (shader ,class))
  +            (shader (or (and shader-name
  +                             (getf *shaders* (shader ,class)))
  +                        0)))
  +       ,(when (or (not args)
  +                  (not (eq (first args) :no-texture)))
  +              `(when (and (not %texture-chosen%) ;if a more specific texture has been found, don't overwrite it
  +                          (drawable ,class)
  +                          (bind-texture ,class ',class shader-name))
  +                 (setf %texture-chosen% t)))
  +       (unless *disable-shaders*
  +         (when (not (= *current-shader* (or shader 0)))
  +           (gl:use-program shader)
  +           (setf *current-shader* shader)))
  +       (when (drawable ,class)
  +         (call-next-method)))))
   
   (defun set-blend-mode (mode)
     (unless (eq mode *current-blend-mode*)
  
positive.code: (defun draw-all-entities ()
    (gl:load-identity)
    (dolist (entity *independent-entities*)
        (draw entity)))
  
  (defun draw-gui ()
    (gl:load-identity)
    (gl:use-program 0)
  
    ;(gl:blend-func :src-alpha :one-minus-src-alpha)
    (dolist (thing *gui-things*)
        (draw thing))
  
    ;(gl:blend-func :src-alpha :one)
    (when *selection-rectangle*
      (draw  *selection-rectangle*)))
  
  
negative.code:     (gl:scale (size-x rectangle) (size-y rectangle) 1)
      (destructuring-bind (r g b a) (color rectangle)
        (gl:color r g b (* a (alpha rectangle) (base-alpha rectangle)))
        (draw-quad))))
  
  (defmacro make-defdrawmethods (drawable-things)
    (let ((definitions (loop for item in drawable-things
                          collecting `(defdrawmethod ,item))))
      `(eval-when (:compile-toplevel :load-toplevel)
         ,@definitions)))
  
  (make-defdrawmethods (weapon air-unit ground-unit explosion bullet laser-beam rocket cupes-polygon selection-indicator factory))
  
  