/// <summary> Set the view port into openGL</summary> public void SetViewPort() { System.Diagnostics.Debug.Assert(context == GLStatics.GetContext(), "Context incorrect"); // safety //System.Diagnostics.Debug.WriteLine("Set GL Viewport {0} {1} w {2} h {3}", ViewPort.Left, ScreenSize.Height - ViewPort.Bottom, ViewPort.Width, ViewPort.Height); OpenTK.Graphics.OpenGL.GL.Viewport(ViewPort.Left, ScreenSize.Height - ViewPort.Bottom, ViewPort.Width, ViewPort.Height); OpenTK.Graphics.OpenGL.GL.DepthRange(DepthRange.X, DepthRange.Y); }
/// <summary> Resize view port to newsize.</summary> public virtual void ResizeViewPort(object sender, Size newsize) // override to change view port to a custom one { System.Diagnostics.Debug.Assert(context == GLStatics.GetContext(), "Context incorrect"); // safety //System.Diagnostics.Debug.WriteLine("Set GL Screensize {0}", newsize); ScreenSize = newsize; ScreenCoordMax = newsize; ViewPort = new Rectangle(new Point(0, 0), newsize); SetViewPort(); }
/// <summary> Construct </summary> public GLMatrixCalc() { context = GLStatics.GetContext(); }