/// <summary> /// /// </summary> /// <param name="e"></param> protected override void OnSizeChanged(EventArgs e) { base.OnSizeChanged(e); int width = this.Width, height = this.Height; if (width > 0 && height > 0) { FBORenderContext renderContext = this.renderContext; if (renderContext != null) { renderContext.MakeCurrent(); renderContext.SetDimensions(width, height); OpenGL.Viewport(0, 0, width, height); if (this.designMode) { GLCanvasHelper.ResizeGL(width, height); } this.Invalidate(); } } }
protected override void OnSizeChanged(EventArgs e) { base.OnSizeChanged(e); RenderContext renderContext = this.renderContext; if (renderContext != null) { renderContext.MakeCurrent(); renderContext.SetDimensions(this.Width, this.Height); OpenGL.Viewport(0, 0, this.Width, this.Height); this.Invalidate(); } }
protected override void SwitchOff() { OpenGL.Viewport(original[0], original[1], original[2], original[3]); }
protected override void SwitchOn() { OpenGL.GetInteger(GetTarget.Viewport, original); OpenGL.Viewport(X, Y, Width, Height); }