private GlControl BuildGLControl() { StaticLogger.Logger.Debug("Building RenderControl GlControl"); GlControl newRenderControl = new OpenGL.GlControl(); newRenderControl.Animation = true; newRenderControl.AnimationTimer = false; newRenderControl.BackColor = System.Drawing.Color.DimGray; newRenderControl.ColorBits = ((uint)(24u)); newRenderControl.DepthBits = ((uint)(0u)); newRenderControl.Dock = System.Windows.Forms.DockStyle.Fill; newRenderControl.Location = new System.Drawing.Point(0, 0); newRenderControl.MultisampleBits = ((uint)(0u)); newRenderControl.Name = "RenderControl"; newRenderControl.Size = this.Size; newRenderControl.StencilBits = ((uint)(0u)); newRenderControl.TabIndex = 0; newRenderControl.ContextCreated += new EventHandler <GlControlEventArgs>(this.RenderControl_ContextCreated); newRenderControl.ContextDestroying += new EventHandler <GlControlEventArgs>(this.RenderControl_ContextDestroying); newRenderControl.Render += new EventHandler <GlControlEventArgs>(this.RenderControl_Render); newRenderControl.ContextUpdate += new EventHandler <GlControlEventArgs>(this.RenderControl_ContextUpdate); StaticLogger.Logger.Debug("Done building RenderControl GlControl"); return(newRenderControl); }
private void HostControl_Loaded(object sender, RoutedEventArgs e) { OpenGL.GlControl glControl = (OpenGL.GlControl)HostControl.Child; glControl.ContextCreated += GlControl_ContextCreated; glControl.Render += GlControl_Render; }