Fixes for Ubuntu / Mesa GL Driver

(o) Fixes black screen by adding glFlush.
(o) Fixes performance issues by removing double-update.
(o) Compiles with Ubuntu's incompatible png.h.