OpenTK.GLControl.OnHandleCreated C# (CSharp) Method

OnHandleCreated() protected method

Raises the HandleCreated event.
protected OnHandleCreated ( EventArgs e ) : void
e System.EventArgs Not used.
return void
        protected override void OnHandleCreated(EventArgs e)
        {
            if (context != null)
                context.Dispose();
            if (implementation != null)
                implementation.WindowInfo.Dispose();
            if (DesignMode)
                implementation = new DummyGLControl();
            else
                implementation = GLControlFactory.CreateGLControl(format, this);
            context = implementation.CreateContext(major, minor, flags);
            MakeCurrent();
            if (!DesignMode)
                ((IGraphicsContextInternal)Context).LoadAll();
            // Deferred setting of vsync mode. See VSync property for more information.
            if (initial_vsync_value.HasValue)
            {
                Context.VSync = initial_vsync_value.Value;
                initial_vsync_value = null;
            }

            base.OnHandleCreated(e);
            if (resize_event_suppressed)
            {
                OnResize(EventArgs.Empty);
                resize_event_suppressed = false;
            }
        }