removed glFlush and fixed mipmap