Rewriting, also removing hack for if being ran by cygwin.
Auto flushing of buffers from opengl.