/// <summary>Resizes the OpenGL viewport if the window is resized</summary>
internal static void WindowResize(int newWidth, int newHeight)
{
Width = newWidth;
Height = newHeight;
if (Loading.Complete)
{
MainLoop.UpdateViewport(MainLoop.ViewPortChangeMode.NoChange);
World.InitializeCameraRestriction();
if (Renderer.OptionBackfaceCulling)
{
GL.Enable(EnableCap.CullFace);
}
else
{
GL.Disable(EnableCap.CullFace);
}
Renderer.ReAddObjects();
}
else
{
GL.Viewport(0, 0, Width, Height);
GL.MatrixMode(MatrixMode.Projection);
GL.LoadIdentity();
GL.Ortho(0.0, (double)Width, (double)Height, 0.0, -1.0, 1.0);
}
}