Пример #1
0
        /// <summary>
        /// Allocate GL resources or GL states.
        /// </summary>
        /// <param name="sender">
        /// The <see cref="object"/> that has rasied the event.
        /// </param>
        /// <param name="e">
        /// The <see cref="GlControlEventArgs"/> that specifies the event arguments.
        /// </param>
        private void RenderControl_ContextCreated(object sender, GlControlEventArgs e)
        {
            GlControl glControl = (GlControl)sender;

            // GL Debugging
            if (Gl.CurrentExtensions != null && Gl.CurrentExtensions.DebugOutput_ARB)
            {
                Gl.DebugMessageCallback(GLDebugProc, IntPtr.Zero);
                Gl.DebugMessageControl(DebugSource.DontCare, DebugType.DontCare, DebugSeverity.DontCare, 0, null, true);
            }

            _renderer = _rendererFactory.Create(Gl.CurrentVersion);

            _renderer.Create();

            ContextCreated?.Invoke(sender, e);

            Gl.ClearColor(0.0f, 0.4f, 0.6f, 1.0f);

            // Uses multisampling, if available
            if (Gl.CurrentVersion != null && Gl.CurrentVersion.Api == KhronosVersion.ApiGl && glControl.MultisampleBits > 0)
            {
                Gl.Enable(EnableCap.Multisample);
            }
        }
Пример #2
0
 /// <summary>
 /// Raise the event <see cref="ContextCreated"/>.
 /// </summary>
 protected virtual void OnContextCreated()
 {
     ContextCreated?.Invoke(this, new NativeWindowEventArgs(DeviceContext, GLContext));
     _IsContextCreated = true;
 }
Пример #3
0
 public void ObserveContextCreated(ContextCreated handler)
 {
     ContextCreated += handler;
 }
Пример #4
0
 internal void OnContextCreated(int frameId)
 {
     ContextCreated?.Invoke(this, new BrowserContextCreatedEventArgs(this, frameId));
 }
Пример #5
0
 protected virtual void OnContextCreated()
 {
     ContextCreated?.Invoke(this);
 }
Пример #6
0
 /// <summary>
 ///     Passes a <see cref="HttpContext" /> to the <see cref="ContextCreated" /> event
 /// </summary>
 /// <param name="ctx">the context</param>
 protected void PassContext(HttpContext ctx)
 {
     ContextCreated?.Invoke(this, new ContextEventArgs(ctx));
 }
Пример #7
0
 public static void OnContextCreated()
 {
     UpdateViewPort(true);
     Stage.SetRequiresRedraw();
     ContextCreated?.Invoke();
 }