OpenTkEngine.Core.Graphics.SetProjection C# (CSharp) Method

SetProjection() public static method

public static SetProjection ( Rectangle client ) : void
client Rectangle
return void
        public static void SetProjection(Rectangle client)
        {
            GL.Viewport(client);
            _window = client;

            Matrix4 projection = Matrix4.Identity;

            if (_renderMode == RenderMode.Ortho)
            {
                projection = Matrix4.CreateOrthographicOffCenter(0, client.Width, client.Height, 0, 100, -100);
            }
            else
            {
                projection = Matrix4.CreatePerspectiveFieldOfView((float)Math.PI / 4, client.Width / (float)client.Height, 1.0f, 1000f);
            }
            int uProjectionLocation = _currentShader.GetUniformLocation("uProjection");
            GL.UniformMatrix4(uProjectionLocation, true, ref projection);
        }