SetDimensions() public method

public SetDimensions ( int width, int height ) : void
width int
height int
return void
Example #1
0
        /// <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();
                }
            }
        }