Exemplo n.º 1
0
        public void Display(GLRect rect, bool draw)
        {
            if (Window == null)
            {
                Window = new GraphWindow();
            }

            var xyratio  = Window.DataWidth / Window.DataHeight;
            var newRatio = rect.Width / rect.Height;

            Window.DataOrigin   = rect.Location;
            Window.DataWidth    = rect.Width;
            Window.DataHeight   = rect.Height;
            Window.WindowWidth  = _glcontrol.Width;
            Window.WindowHeight = _glcontrol.Height;

            if (Window.WindowWidth == 0)
            {
                throw new Exception(ZeroError);
            }
            if (Window.WindowHeight == 0)
            {
                throw new Exception(ZeroError);
            }

            if (Math.Abs(newRatio - xyratio) > 0.01)
            {
                _displayChanged = true;
            }
            if (draw)
            {
                Draw();
            }
        }
Exemplo n.º 2
0
        public void Display(GLRect rect, bool draw) {
            if (Window == null) {
                Window = new GraphWindow();
            }

            var xyratio = Window.DataWidth / Window.DataHeight;
            var newRatio = rect.Width / rect.Height;

            Window.DataOrigin = rect.Location;
            Window.DataWidth = rect.Width;
            Window.DataHeight = rect.Height;
            Window.WindowWidth = _glcontrol.Width;
            Window.WindowHeight = _glcontrol.Height;

            if (Window.WindowWidth == 0) throw new Exception(ZeroError);
            if (Window.WindowHeight == 0) throw new Exception(ZeroError);

            if (Math.Abs(newRatio - xyratio) > 0.01) {
                _displayChanged = true;
            }
            if (draw) {
                Draw();
            }
        }
Exemplo n.º 3
0
        public void Display(GLRect rect, bool draw) {
            if (Window == null) {
                Window = new GraphWindow();
            }
            Window.DataOrigin = rect.Location;
            Window.DataWidth = rect.Width;
            Window.DataHeight = rect.Height;
            Window.WindowWidth = _glcontrol.Width;
            Window.WindowHeight = _glcontrol.Height;

            if (Window.WindowWidth == 0) throw new Exception(ZeroError);
            if (Window.WindowHeight == 0) throw new Exception(ZeroError);

            _glcontrol.MakeCurrent();

            LoadDisplayLists();
            if (draw) {
                Draw();
            }
        }