diff --git a/Source/Examples/WinForms/W01_First_Window.cs b/Source/Examples/WinForms/W01_First_Window.cs index 1c04f18d..58c3deb3 100644 --- a/Source/Examples/WinForms/W01_First_Window.cs +++ b/Source/Examples/WinForms/W01_First_Window.cs @@ -41,29 +41,30 @@ namespace Examples.WinForms base.OnLoad(e); glControl1.CreateContext(); + + GL.ClearColor(Color.Crimson); } private void redButton_Click(object sender, EventArgs e) { - GL.ClearColor(0.7f, 0.0f, 0.0f, 0.0f); + GL.ClearColor(Color.Crimson); glControl1.Invalidate(); } private void greenButton_Click(object sender, EventArgs e) { - GL.ClearColor(0.0f, 0.5f, 0.0f, 0.0f); + GL.ClearColor(Color.ForestGreen); glControl1.Invalidate(); } private void blueButton_Click(object sender, EventArgs e) { - GL.ClearColor(0.0f, 0.0f, 0.7f, 0.0f); + GL.ClearColor(Color.RoyalBlue); glControl1.Invalidate(); } private void glControl1_Paint(object sender, PaintEventArgs e) { - System.Diagnostics.Debug.Print("Paint"); GL.Clear(GL.Enums.ClearBufferMask.COLOR_BUFFER_BIT); glControl1.SwapBuffers(); } diff --git a/Source/Examples/WinForms/W02_Immediate_Mode_Cube.Designer.cs b/Source/Examples/WinForms/W02_Immediate_Mode_Cube.Designer.cs index c3c38928..40706d56 100644 --- a/Source/Examples/WinForms/W02_Immediate_Mode_Cube.Designer.cs +++ b/Source/Examples/WinForms/W02_Immediate_Mode_Cube.Designer.cs @@ -33,21 +33,22 @@ // // glControl // - this.glControl.BackColor = System.Drawing.Color.MidnightBlue; + this.glControl.BackColor = System.Drawing.Color.Black; this.glControl.Dock = System.Windows.Forms.DockStyle.Fill; this.glControl.Fullscreen = false; this.glControl.Location = new System.Drawing.Point(0, 0); this.glControl.Name = "glControl"; this.glControl.Size = new System.Drawing.Size(624, 444); this.glControl.TabIndex = 0; + this.glControl.Visible = false; // - // Cube + // W02_Immediate_Mode_Cube // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(624, 444); this.Controls.Add(this.glControl); - this.Name = "Cube"; + this.Name = "W02_Immediate_Mode_Cube"; this.Text = "Cube"; this.ResumeLayout(false); diff --git a/Source/Examples/WinForms/W02_Immediate_Mode_Cube.cs b/Source/Examples/WinForms/W02_Immediate_Mode_Cube.cs index c719c2f3..63ee6d49 100644 --- a/Source/Examples/WinForms/W02_Immediate_Mode_Cube.cs +++ b/Source/Examples/WinForms/W02_Immediate_Mode_Cube.cs @@ -54,7 +54,7 @@ namespace Examples.WinForms GL.GetString(GL.Enums.StringName.RENDERER) + " " + GL.GetString(GL.Enums.StringName.VERSION); - GL.ClearColor(0.1f, 0.1f, 0.5f, 0.0f); + GL.ClearColor(Color.MidnightBlue); GL.Enable(GL.Enums.EnableCap.DEPTH_TEST); Application.Idle += Application_Idle; diff --git a/Source/OpenTK/OpenGL/GLHelper.cs b/Source/OpenTK/OpenGL/GLHelper.cs index a3b00daf..0f636763 100644 --- a/Source/OpenTK/OpenGL/GLHelper.cs +++ b/Source/OpenTK/OpenGL/GLHelper.cs @@ -298,5 +298,14 @@ namespace OpenTK.OpenGL } #endregion + + #region public static void ClearColor() overloads + + public static void ClearColor(System.Drawing.Color color) + { + ClearColor(color.R/255.0f, color.G/255.0f, color.B/255.0f, color.A/255.0f); + } + + #endregion } }