              {:keys [^ByteBuffer glyph-image-data
                      ^ByteBuffer fg-image-data
                      ^ByteBuffer bg-image-data]} :data
-             :keys [p-matrix-buffer mv-matrix-buffer character-width character-height]} gl
+             :keys [p-matrix-buffer mv-matrix-buffer character-width character-height character->col-row]} gl
             glyph-image-data glyph-image-data
             fg-image-data fg-image-data
             bg-image-data bg-image-data

  (int (Math/pow 2 (inc (Math/floor (/ (Math/log v) (Math/log 2)))))))

;; A sequence of [character underline?]
(def characters
  (let [c (concat
            "abcdefghijklmnopqrstuvwxyz"
            "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
            " ~!@#$%^&*()_-+=[]{}|:;,./<>?'\""
            "\u005C"
            "\u00A7"
            "\u00B7"
            "\u01C1"
            "\u039B"
            "\u03B1"
            "\u03C2"
            "\u2206"
            "\u2225"
            "\u2240"
            "\u2248"
            "\u2500"
            "\u2502"
            "\u250C"
            "\u2514"
            "\u2518"
            "\u2534"
            "\u2584"
            "\u2592"
            "\u2648"
            "\u2665"
            "\u1D16"
            "\u255a"
            "\u2550"
            "\u255d"
            "\u2551"
            "\u2554"
            "\u2557"
            "\u00B0"
            "\u2191")
       c (concat (map vector c (repeat false))
                 (map vector c (repeat true)))]
    c))

;; A sequence of [[\character underline?] x y] where [x y] is the column,row in the character atlas.
(def character-idxs
  ;(let [character-matrix (partition-all (int (inc (Math/sqrt (count characters)))) characters)]
  (let [characters-per-line (int (inc (Math/sqrt (count characters))))
        character-matrix    (partition-all characters-per-line characters)]

          texture-coords-vertex-attribute (GL20/glGetAttribLocation pgm-id "aTextureCoord")

          ;; We just need one vertex buffer, a texture-mapped quad will suffice for drawing the terminal.
          {:keys [vertices-vbo-id
                  vertices-count
                  texture-coords-vbo-id]} (init-buffers)
