anchor.diff:  ;;; Particle Renderer
   ;;;
   
  +(defun unlines (&rest string-list)
  +  "Concatenates a list of strings and puts newlines between the elements."
  +  (format nil "~{~A~%~}" string-list))
  +
  +(defparameter +vertex-shader+
  +  (unlines "void main()                                                            "
  +           "{                                                                      "
  +           "    float pointSize = 500.0 * gl_Point.size;                           "
  +           "    vec4 vert = gl_Vertex;                                             "
  +           "    vert.w = 1.0;                                                      "
  +           "    vec3 pos_eye = vec3 (gl_ModelViewMatrix * vert);                   "
  +           "    gl_PointSize = max(1.0, pointSize / (1.0 - pos_eye.z));            "
  +           "    gl_TexCoord[0] = gl_MultiTexCoord0;                                "
  +           ;"    gl_TexCoord[1] = gl_MultiTexCoord1;                                "
  +           "    gl_Position = ftransform();                                        "
  +           "    gl_FrontColor = gl_Color;                                          "
  +           "    gl_FrontSecondaryColor = gl_SecondaryColor;                        "
  +           "}                                                                      "))
  +
  +(defparameter +pixel-shader+
  +  (unlines "uniform sampler2D splatTexture;                                        "
  +           "void main()                                                            "
  +           "{                                                                      "
  +           "    vec4 color2 = gl_SecondaryColor;                                   "
  +           "    vec4 color = (0.6 + 0.4 * gl_Color) * texture2D(splatTexture, gl_TexCoord[0].st);"
  +           "    gl_FragColor =                                                     "
  +           "         color * color2;" ;mix(vec4(0.1, 0.0, 0.0, color.w), color2, color.w);"
  +           "}                                                                      "))
  +
   (let ((m-pos           nil)
         (m-num-particles 0  )
  -      (m-point-size    1.0)
  -      ;(m-sprite-size   2.0)
  -      ;(m-vertex-shader nil)
  -      ;(m-pixel-shader  nil)
  -      ;(m-program       nil)
  -      ;(m-texture       nil)
  +      ;(m-point-size    1.0)
  +      (m-sprite-size   2.0)
  +      (m-vertex-shader nil)
  +      (m-pixel-shader  nil)
  +      (m-program       nil)
  +      (m-texture       0)
  +      (m-texture-data  (cffi:null-pointer))
         ;(m-pbo           nil)
         ;(m-vbo-color     nil)
  -      ;(m-base-color    nil))
  -      )
  +      (m-base-color    #(0.0 0.0 0.0 0.0)))
  +  
  +  (defun particle-renderer-init ()
  +    (init-gl))
  +  
  +  (defun particle-renderer-release ()
  +    (cffi:foreign-free m-texture-data))
     
     (defun particle-renderer-set-positions (pos num-particles)
       (setf m-pos pos)
       (setf m-num-particles num-particles))
     
     (defun particle-renderer-set-base-color (color)
  -    (declare (ignore color))
  -    (not-implemented))
  +    (setf m-base-color (make-array 4))
  +    (dotimes (i 4)
  +      (setf (aref m-base-color i) (aref color i))))
     
     (defun particle-renderer-set-colors (color num-particles)
       (declare (ignore color num-particles))
  
positive.code: ;;; NBodyDemo
  ;;;
  
  (defun nbody-demo-update-simulation (new-pos old-pos vel delta-time damping num-bodies p)
    (integrate-nbody-system new-pos old-pos vel delta-time damping num-bodies p))
  
  
negative.code:   
    (defun particle-renderer-display ()
      ; mode = PARTICLE_POINTS
      ;(gl:color 1.0 1.0 1.0)
      ;(gl:point-size m-point-size)
      ;(draw-points)
      ; mode = PARTICLE_SPRITES
      (gl:enable :point-sprite)
      (gl:tex-env :point-sprite :coord-replace :true)
      (gl:enable :vertex-program-point-size-nv)
      (gl:point-size m-sprite-size)
      (gl:blend-func :src-alpha :one)
      (gl:enable :blend)
      (gl:depth-mask :false)
      
      (gl:use-program m-program)
      (gl:uniformi (gl:get-uniform-location m-program "splatTexture") 0)
      
      (gl:active-texture :texture0-arb)
      (gl:bind-texture :texture-2d m-texture)
      
      (gl:color 1.0 1.0 1.0)
      (gl:secondary-color (aref m-base-color 0) (aref m-base-color 1) (aref m-base-color 2))
      
      (draw-points)
      
      (gl:use-program 0)
      
      (gl:disable :point-sprite-arb)
      (gl:disable :blend)
      (gl:depth-mask :true))
    
    (defun particle-renderer-set-point-size (size)
      (declare (ignore size))
  