Exemplo n.º 1
0
        public void Resize(int width, int height)
        {
            GL.Viewport(0, 0, width, height); // tell OpenGL to use the whole window for drawing

            //TODO: Save the view port aspect ratio for use in rendering
            _windowAspectRatio = height / (float)width;

            var viewport = Transformation2d.Combine(Transformation2d.Translate(Vector2.One), Transformation2d.Scale(width / 2f, height / 2f));

            InvViewportMatrix = viewport.Inverted();
            GL.Ortho(0, width, height, 0, -1, 1);
            UpdateMatrix();
        }