     (doto
         (Thread.
          (fn []
-           (loop [frame (pave/pull-frame fq 1000)]
-             (if frame
-               (let [^BufferedImage image (decoder frame)]
-                 (seesaw/invoke-now
-                  (.drawImage
-                   (.getGraphics view)
-                   image
-                   0 0
-                   (.getWidth view) (.getHeight view)
-                   view)))
-               ;;(log/info "Delayed frame" frame fq)
-               )
-             (recur (pave/pull-frame fq 1000)))))
+           (let [g (.getGraphics view)
+                 bi (BufferedImage.
+                     (.getWidth view)
+                     (.getHeight view)
+                     BufferedImage/TYPE_INT_ARGB)
+                 gbi (.createGraphics bi)]
+             (loop [frame (pave/pull-frame fq 1000)]
+               (when frame
+                 (let [^BufferedImage image (decoder frame)]
+                   (seesaw/invoke-now
+                    (draw-image view gbi image)
+                    (draw-hud view gbi drone)
+                    (.drawImage g bi 0 0 nil))))
+               (recur (pave/pull-frame fq 1000))))))
       (.setDaemon true)
       (.start))))
 

              (apply action-fn action-args))))))))


(def drone-video-port 5555)


(defn connect-video-controller [ui drone]

            [com.lemonodor.gflags :as gflags]
            [seesaw.core :as seesaw])
  (:import [java.awt.event InputEvent KeyEvent]
           [java.awt Color Font Graphics Graphics2D]
           [java.awt.image BufferedImage]
           [java.net Socket]
           [javax.swing JPanel]))
