Esempio n. 1
0
        public static void Set2D(int width, int height)
        {
            is3D            = false;
            Settings.Width  = width;
            Settings.Height = height;

            GLExt.SetProjectionMatrix(Matrix4.CreateOrthographicOffCenter(0, width, 0, height, -1, 1));
            GLExt.LoadIdentity();
            GL.Viewport(0, 0, width, height);
            GL.Disable(EnableCap.CullFace);
            GLExt.SetLighting(false);
        }
Esempio n. 2
0
        public static void Set3D(int width, int height, float near, float far)
        {
            is3D            = true;
            Settings.Width  = width;
            Settings.Height = height;
            Near            = near;
            Far             = far;

            GLExt.SetProjectionMatrix(Matrix4.CreatePerspectiveFieldOfView(MathHelper.DegreesToRadians(Fov),
                                                                           (float)width / (float)height, near, far));
            GLExt.LoadIdentity();
            GL.Viewport(0, 0, width, height);
            GL.Enable(EnableCap.CullFace);
            GLExt.SetLighting(true);
        }