           glyph-texture    (with-gl-context gl-lock (xy-texture-id next-pow-2-columns next-pow-2-rows glyph-image-data))
           fg-texture       (with-gl-context gl-lock (texture-id next-pow-2-columns next-pow-2-rows fg-image-data))
           bg-texture       (with-gl-context gl-lock (texture-id next-pow-2-columns next-pow-2-rows bg-image-data))
-          [fbo-id fbo-texture-id]
-                           (with-gl-context gl-lock (fbo-texture next-pow-2-columns next-pow-2-rows))
+          [fbo-id fbo-texture]
+                           (with-gl-context gl-lock (fbo-texture screen-width screen-height))
           ; init shaders
-          pgm-id ^long                    (with-gl-context gl-lock (init-shaders))
+          [pgm-id
+           fb-pgm-id]      (with-gl-context gl-lock (init-shaders))
           pos-vertex-attribute            (with-gl-context gl-lock (GL20/glGetAttribLocation pgm-id "aVertexPosition"))
           texture-coords-vertex-attribute (with-gl-context gl-lock (GL20/glGetAttribLocation pgm-id "aTextureCoord"))
+          fb-pos-vertex-attribute            (with-gl-context gl-lock (GL20/glGetAttribLocation fb-pgm-id "aVertexPosition"))
+          fb-texture-coords-vertex-attribute (with-gl-context gl-lock (GL20/glGetAttribLocation fb-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
                   vao-id]}          (with-gl-context gl-lock (init-buffers))
-          u-MVMatrix                (with-gl-context gl-lock (GL20/glGetUniformLocation pgm-id "uMVMatrix"))
-          u-PMatrix                 (with-gl-context gl-lock (GL20/glGetUniformLocation pgm-id "uPMatrix"))
-          u-font                    (with-gl-context gl-lock (GL20/glGetUniformLocation pgm-id "uFont"))
-          u-glyphs                  (with-gl-context gl-lock (GL20/glGetUniformLocation pgm-id "uGlyphs"))
-          u-fg                      (with-gl-context gl-lock (GL20/glGetUniformLocation pgm-id "uFg"))
-          u-bg                      (with-gl-context gl-lock (GL20/glGetUniformLocation pgm-id "uBg"))
-          font-size                 (with-gl-context gl-lock (GL20/glGetUniformLocation pgm-id "fontSize"))
-          term-dim                  (with-gl-context gl-lock (GL20/glGetUniformLocation pgm-id "termDimensions"))
-          font-tex-dim              (with-gl-context gl-lock (GL20/glGetUniformLocation pgm-id "fontTextureDimensions"))
-          glyph-tex-dim             (with-gl-context gl-lock (GL20/glGetUniformLocation pgm-id "glyphTextureDimensions"))
+          [glyph-tex-dim
+           u-MVMatrix
+           u-PMatrix
+           u-font
+           u-glyphs
+           u-fg
+           u-bg
+           font-size
+           term-dim
+           font-tex-dim]  (with-gl-context gl-lock (mapv #(GL20/glGetUniformLocation pgm-id %)
+                                                         ["glyphTextureDimensions"
+                                                          "uMVMatrix"
+                                                          "uPMatrix"
+                                                          "uFont"
+                                                          "uGlyphs"
+                                                          "uFg"
+                                                          "uBg"
+                                                          "fontSize"
+                                                          "termDimensions"
+                                                          "fontTextureDimensions"]))
+           [u-fb
+            u-fb-MVMatrix
+            u-fb-PMatrix] (with-gl-context gl-lock (mapv #(GL20/glGetUniformLocation fb-pgm-id %)
+                                                         ["uFb"
+                                                          "uMVMatrix"
+                                                          "uPMatrix"]))
           terminal
           ;; Create and return terminal
           (OpenGlTerminal. columns

    (reset! cursor-xy [x y]))
  (refresh! [_]
    (with-gl-context gl-lock
      (let [{{:keys [vertices-vbo-id vertices-count texture-coords-vbo-id vao-id]} :buffers
             {:keys [font-texture glyph-texture fg-texture bg-texture]} :textures
             program-id :program-id
             {:keys [u-MVMatrix u-PMatrix u-font u-glyphs u-fg u-bg font-size term-dim font-tex-dim
                     font-texture-width font-texture-height glyph-tex-dim glyph-texture-width glyph-texture-height]} :uniforms
             {:keys [^ByteBuffer glyph-image-data
                     ^ByteBuffer fg-image-data
                     ^ByteBuffer bg-image-data]} :data

                                       :font-texture-height font-texture-height
                                       :glyph-tex-dim glyph-tex-dim
                                       :glyph-texture-width glyph-texture-width
                                       :glyph-texture-height glyph-texture-height
                                       :u-fb u-fb}
                            :data {:glyph-image-data glyph-image-data
                                   :fg-image-data fg-image-data
                                   :bg-image-data bg-image-data}}
