Move screenshot taking after the drawing of OpenGL objects