 
   (:require [petulant-life.rendering :as r]
             [petulant-life.config :as c]
-            [petulant-life.shader :as s]))
+            [petulant-life.shader :as s]
+            [petulant-life.life   :as l]))
 
 ;; Initializing the OpenGL window.
 (defn create []

         life-board)))

;; Running the simulation / graphics.
(defn run [shader]
  (while (not (Display/isCloseRequested))
    (do (GL11/glClear GL11/GL_COLOR_BUFFER_BIT)
        (r/draw-rectangles [[0 0 1 1]      ;; For testing no shader-based scaling.
                            [10 10 50 50]] ;; For testing    shader-based scaling.
                           shader
                           [1 0 0 1])

        (r/draw-rectangles (life->screen 50 10 [[0 0] [1 0] [1 1]])
                           shader
                           [0 1 0 1])

        (Display/update))))

(defmacro with-cleanup [close-fn & body]
  `(try

(defn -main [& args]
  (with-cleanup destroy
    (create)
    (run (s/load-shader-program "resources/gol")
      l/torus-step)))
