implemented window singleton in basic opengl