Added glFlush command after buffer swap.