From 00221ba22533f51f1ba59970688e4924a2f651ec Mon Sep 17 00:00:00 2001 From: the_fiddler Date: Thu, 25 Jun 2009 22:47:59 +0000 Subject: [PATCH] * OpenGL/1.1/DisplayLists.cs: Avoid Glu in favor of OpenTK.Matrix4. * OpenAL/Test/TestAudioContext.cs: Remove deprecated Alut calls. * OpenTK/GLControl/SimpleGLControl.Designer.cs: Use DockStyle.Fill instead of anchoring. --- Source/Examples/OpenAL/Test/TestAudioContext.cs | 5 +---- Source/Examples/OpenGL/1.1/DisplayLists.cs | 11 ++++++----- .../OpenTK/GLControl/SimpleGLControl.Designer.cs | 6 ++---- 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/Source/Examples/OpenAL/Test/TestAudioContext.cs b/Source/Examples/OpenAL/Test/TestAudioContext.cs index 5200bad8..4fc44aea 100644 --- a/Source/Examples/OpenAL/Test/TestAudioContext.cs +++ b/Source/Examples/OpenAL/Test/TestAudioContext.cs @@ -22,10 +22,7 @@ namespace Examples public static void PrintOpenALErrors( IntPtr device ) { ALError AlErr = AL.GetError(); - // AudioContext should throw on errors, so no need to test them manually. - //AlcError AlcErr = Alc.GetError(device); - AlutError AlutErr = Alut.GetError(); - Console.WriteLine("Al: " + AlErr + " Alut: " + Alut.GetErrorString(AlutErr)); + Console.WriteLine("OpenAL error: {0}", AlErr); } public static void Main() diff --git a/Source/Examples/OpenGL/1.1/DisplayLists.cs b/Source/Examples/OpenGL/1.1/DisplayLists.cs index 304941c1..196de4d7 100644 --- a/Source/Examples/OpenGL/1.1/DisplayLists.cs +++ b/Source/Examples/OpenGL/1.1/DisplayLists.cs @@ -97,14 +97,15 @@ namespace Examples.Tutorial protected override void OnResize(EventArgs e) { - GL.Viewport(0, 0, Width, Height); + GL.Viewport(ClientRectangle); - double ratio = 0.0; - ratio = this.Width / (double)this.Height; + float aspect = this.ClientSize.Width / (float)this.ClientSize.Height; + + Matrix4 projection_matrix; + Matrix4.CreatePerspectiveFieldOfView((float)Math.PI / 4, aspect, 1, 64, out projection_matrix); GL.MatrixMode(MatrixMode.Projection); - GL.LoadIdentity(); - Glu.Perspective(45.0, ratio, 1.0, 64.0); + GL.LoadMatrix(ref projection_matrix); } #endregion diff --git a/Source/Examples/OpenTK/GLControl/SimpleGLControl.Designer.cs b/Source/Examples/OpenTK/GLControl/SimpleGLControl.Designer.cs index e8e1e2ac..1b3ab67c 100644 --- a/Source/Examples/OpenTK/GLControl/SimpleGLControl.Designer.cs +++ b/Source/Examples/OpenTK/GLControl/SimpleGLControl.Designer.cs @@ -69,11 +69,9 @@ // // glControl1 // - this.glControl1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); + this.glControl1.Dock = System.Windows.Forms.DockStyle.Fill; this.glControl1.BackColor = System.Drawing.SystemColors.ControlDarkDark; - this.glControl1.Location = new System.Drawing.Point(1, 0); + this.glControl1.Location = new System.Drawing.Point(0, 0); this.glControl1.Name = "glControl1"; this.glControl1.Size = new System.Drawing.Size(629, 565); this.glControl1.TabIndex = 0;