GrafitiDemo.Viewer.Reshape C# (CSharp) Méthode

Reshape() private méthode

private Reshape ( int w, int h ) : void
w int
h int
Résultat void
        private void Reshape(int w, int h)
        {
            if (h == 0)     // Prevent A Divide By Zero By
                h = 1;		// Making Height Equal One

            Gl.glViewport(0, 0, w, h); // Reset The Current Viewport

            Gl.glMatrixMode(Gl.GL_PROJECTION);
            Gl.glLoadIdentity();

            //int[] vPort = new int[4];
            //Gl.glGetIntegerv(Gl.GL_VIEWPORT, vPort);
            //Gl.glOrtho(vPort[0], vPort[0] + vPort[2], vPort[1] + vPort[3], vPort[1], -1, 1);

            Glu.gluPerspective(90f, 4f / 3f, 0.1f, 100f);
            //Gl.glFrustum(0, w, h, 0, 0.1, 500);
            //Gl.glOrtho(0, w, h, 0, -1, 1);

            Gl.glMatrixMode(Gl.GL_MODELVIEW);
        }