diff --git a/Build/Prebuild.exe b/Build/Prebuild.exe index 15fa73de..c0317579 100644 Binary files a/Build/Prebuild.exe and b/Build/Prebuild.exe differ diff --git a/Build/Prebuild.xml b/Build/Prebuild.xml index d691bb5c..87aaea6e 100644 --- a/Build/Prebuild.xml +++ b/Build/Prebuild.xml @@ -165,6 +165,8 @@ + + diff --git a/Source/Examples/ExampleAttribute.cs b/Source/Examples/ExampleAttribute.cs index bda9be82..636370b5 100644 --- a/Source/Examples/ExampleAttribute.cs +++ b/Source/Examples/ExampleAttribute.cs @@ -28,6 +28,9 @@ namespace Examples public ExampleAttribute(string title, ExampleCategory category, string subcategory, int difficulty) : this(title, category, subcategory, difficulty, true) { } + public ExampleAttribute(string title, ExampleCategory category, string subcategory, bool visible) + : this(title, category, subcategory, 0, visible) { } + public ExampleAttribute(string title, ExampleCategory category, string subcategory, int difficulty, bool visible) { this.Title = title; diff --git a/Source/Examples/ExampleBrowser.cs b/Source/Examples/ExampleBrowser.cs index b9bb8967..b94739d2 100644 --- a/Source/Examples/ExampleBrowser.cs +++ b/Source/Examples/ExampleBrowser.cs @@ -1,14 +1,10 @@ using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Text; -using System.Windows.Forms; -using System.Reflection; -using Examples.Properties; using System.Diagnostics; +using System.Drawing; using System.Drawing.Text; +using System.Reflection; +using System.Windows.Forms; +using Examples.Properties; namespace Examples { @@ -47,9 +43,11 @@ namespace Examples protected override void OnLoad(EventArgs e) { base.OnLoad(e); - LoadSamplesFromAssembly(Assembly.GetExecutingAssembly()); + Debug.Listeners.Add(new TextBoxTraceListener(textBoxOutput)); treeViewSamples.TreeViewNodeSorter = new SamplesTreeViewSorter(); + + LoadSamplesFromAssembly(Assembly.GetExecutingAssembly()); } #endregion @@ -70,6 +68,7 @@ namespace Examples else { richTextBoxDescription.Rtf = String.Empty; + richTextBoxDescription.Text = "Documentation has not been entered."; richTextBoxSource.Rtf = String.Empty; } } diff --git a/Source/Examples/ExampleLauncher.Designer.cs b/Source/Examples/ExampleLauncher.Designer.cs deleted file mode 100644 index 5861108a..00000000 --- a/Source/Examples/ExampleLauncher.Designer.cs +++ /dev/null @@ -1,109 +0,0 @@ -namespace Examples -{ - partial class ExampleLauncher - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.listBox1 = new System.Windows.Forms.ListBox(); - this.runButton = new System.Windows.Forms.Button(); - this.splitContainer1 = new System.Windows.Forms.SplitContainer(); - this.splitContainer1.Panel1.SuspendLayout(); - this.splitContainer1.Panel2.SuspendLayout(); - this.splitContainer1.SuspendLayout(); - this.SuspendLayout(); - // - // listBox1 - // - this.listBox1.Dock = System.Windows.Forms.DockStyle.Fill; - this.listBox1.FormattingEnabled = true; - this.listBox1.Location = new System.Drawing.Point(0, 0); - this.listBox1.Margin = new System.Windows.Forms.Padding(1); - this.listBox1.Name = "listBox1"; - this.listBox1.Size = new System.Drawing.Size(292, 212); - this.listBox1.Sorted = true; - this.listBox1.TabIndex = 0; - this.listBox1.DoubleClick += new System.EventHandler(this.listBox1_DoubleClick); - this.listBox1.KeyUp += new System.Windows.Forms.KeyEventHandler(this.listBox1_KeyUp); - // - // runButton - // - this.runButton.Dock = System.Windows.Forms.DockStyle.Fill; - this.runButton.Location = new System.Drawing.Point(0, 0); - this.runButton.Margin = new System.Windows.Forms.Padding(1); - this.runButton.Name = "runButton"; - this.runButton.Size = new System.Drawing.Size(292, 52); - this.runButton.TabIndex = 0; - this.runButton.Text = "Run Example"; - this.runButton.UseVisualStyleBackColor = true; - this.runButton.Click += new System.EventHandler(this.runButton_Click); - // - // splitContainer1 - // - this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill; - this.splitContainer1.IsSplitterFixed = true; - this.splitContainer1.Location = new System.Drawing.Point(0, 0); - this.splitContainer1.Name = "splitContainer1"; - this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal; - // - // splitContainer1.Panel1 - // - this.splitContainer1.Panel1.Controls.Add(this.listBox1); - // - // splitContainer1.Panel2 - // - this.splitContainer1.Panel2.Controls.Add(this.runButton); - this.splitContainer1.Size = new System.Drawing.Size(292, 266); - this.splitContainer1.SplitterDistance = 213; - this.splitContainer1.SplitterWidth = 1; - this.splitContainer1.TabIndex = 1; - // - // ExampleLauncher - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(292, 366); - this.Controls.Add(this.splitContainer1); - this.MinimumSize = new System.Drawing.Size(300, 400); - this.Name = "ExampleLauncher"; - this.Text = "OpenTK Example Launcher"; - this.Load += new System.EventHandler(this.ExampleLauncher_Load); - this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.ExampleLauncher_FormClosing); - this.splitContainer1.Panel1.ResumeLayout(false); - this.splitContainer1.Panel2.ResumeLayout(false); - this.splitContainer1.ResumeLayout(false); - this.ResumeLayout(false); - - } - - #endregion - - private System.Windows.Forms.ListBox listBox1; - private System.Windows.Forms.Button runButton; - private System.Windows.Forms.SplitContainer splitContainer1; - - } -} \ No newline at end of file diff --git a/Source/Examples/ExampleLauncher.cs b/Source/Examples/ExampleLauncher.cs deleted file mode 100644 index 8f290f32..00000000 --- a/Source/Examples/ExampleLauncher.cs +++ /dev/null @@ -1,203 +0,0 @@ -#region --- License --- -/* Licensed under the MIT/X11 license. - * Copyright (c) 2006-2008 the OpenTK Team. - * This notice may not be removed from any source distribution. - * See license.txt for licensing details. - */ -#endregion - -#region --- Using Directives --- - -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Text; -using System.Windows.Forms; -using System.Reflection; -using System.Threading; -using System.Diagnostics; -using System.Security; -using System.Security.Permissions; -using System.Security.Policy; -using System.IO; - -using OpenTK; - -#endregion - -namespace Examples -{ - [Obsolete] - public partial class ExampleLauncher : Form - { - bool show_hidden; - List hidden_items = new List(); - - #region --- Constructor --- - - public ExampleLauncher() - { - this.Font = SystemFonts.MessageBoxFont; - InitializeComponent(); - } - - #endregion - - #region public void ExampleLauncher_Load(object sender, EventArgs e) - - public void ExampleLauncher_Load(object sender, EventArgs e) - { - // Get all examples - Type[] types = Assembly.GetExecutingAssembly().GetTypes(); - StringBuilder sb = new StringBuilder(); - foreach (Type type in types) - { - object[] attributes = type.GetCustomAttributes(false); - ExampleAttribute example = null; - foreach (object attr in attributes) - if (attr is ExampleAttribute) - example = (ExampleAttribute)attr; - - if (example != null) - { - //sb.Append(example.Category); - //sb.Append(" "); - //if (example.Difficulty < 10) - // sb.Append("0"); // To keep items nicely sorted. - //sb.Append(example.Difficulty); - //sb.Append(": "); - ////sb.Append(type.Name); - //sb.Append(example.Title); - - if (example.Visible) - { - listBox1.Items.Add(new ExampleInfo(type, example)); - } - else - { -#if DEBUG - example.Title += " (hidden)"; - listBox1.Items.Add(new ExampleInfo(type, example)); -#else - hidden_items.Add(new ExampleInfo(type, example)); -#endif - } - // Clean the StringBuilder for the next pass. - sb.Remove(0, sb.Length); - } - } - // Select first item - if (listBox1.Items.Count > 0) - this.listBox1.SelectedIndex = 0; - - RaiseWindow(); - } - - #endregion - - void RaiseWindow() - { - // Force the ExampleLauncher to appear. - this.TopMost = false; - this.TopMost = true; - this.TopMost = false; - } - - #region private void RunExample() - - private void RunExample() - { - if (listBox1.SelectedItem != null) - { - try - { - ExampleInfo info = (ExampleInfo)listBox1.SelectedItem; - Type example = info.Example; - - Debug.Print("Launching example: {0}", example.ToString()); - this.Visible = false; - Application.DoEvents(); - - example.GetMethod("Main").Invoke(null, null); - - GC.Collect(); - GC.WaitForPendingFinalizers(); - GC.Collect(); - - } - catch (TargetInvocationException expt) - { - string ex_info; - if (expt.InnerException != null) - ex_info = expt.InnerException.ToString(); - else - ex_info = expt.ToString(); - MessageBox.Show(ex_info, "An OpenTK example encountered an error.", MessageBoxButtons.OK, MessageBoxIcon.Warning); - - Debug.Print(expt.ToString()); -#if DEBUG - //throw; -#endif - } - catch (NullReferenceException expt) - { - MessageBox.Show(expt.ToString(), "The Example launcher failed to load the example.", MessageBoxButtons.OK, MessageBoxIcon.Warning); - } - finally - { - this.Visible = true; - RaiseWindow(); - } - } - } - - #endregion - - #region Launcher events - - private void listBox1_DoubleClick(object sender, EventArgs e) - { - RunExample(); - } - - private void listBox1_KeyUp(object sender, KeyEventArgs e) - { - switch (e.KeyCode) - { - case Keys.Enter: - RunExample(); - break; - - // On Ctrl+F1 enable hidden items (for debugging/testing OpenTK) - case Keys.F1: - if (e.Control) - show_hidden = !show_hidden; - - if (show_hidden) - listBox1.Items.AddRange(hidden_items.ToArray()); - else - foreach (ExampleInfo item in hidden_items) - listBox1.Items.Remove(item); - - break; - } - } - - private void runButton_Click(object sender, EventArgs e) - { - RunExample(); - } - - private void ExampleLauncher_FormClosing(object sender, FormClosingEventArgs e) - { - Debug.Flush(); - Debug.Close(); - Trace.Flush(); - Trace.Close(); - } - - #endregion - } -} diff --git a/Source/Examples/OpenAL/PlayStatic.cs b/Source/Examples/OpenAL/1.1/PlayStatic.cs similarity index 100% rename from Source/Examples/OpenAL/PlayStatic.cs rename to Source/Examples/OpenAL/1.1/PlayStatic.cs diff --git a/Source/Examples/OpenAL/Playback.cs b/Source/Examples/OpenAL/1.1/Playback.cs similarity index 100% rename from Source/Examples/OpenAL/Playback.cs rename to Source/Examples/OpenAL/1.1/Playback.cs diff --git a/Source/Examples/OpenAL/StreamingPlayback.cs b/Source/Examples/OpenAL/1.1/StreamingPlayback.cs similarity index 100% rename from Source/Examples/OpenAL/StreamingPlayback.cs rename to Source/Examples/OpenAL/1.1/StreamingPlayback.cs diff --git a/Source/Examples/OpenAL/EFXReverb.cs b/Source/Examples/OpenAL/EFX/EFXReverb.cs similarity index 100% rename from Source/Examples/OpenAL/EFXReverb.cs rename to Source/Examples/OpenAL/EFX/EFXReverb.cs diff --git a/Source/Examples/OpenAL/TestAudioContext.cs b/Source/Examples/OpenAL/Test/TestAudioContext.cs similarity index 100% rename from Source/Examples/OpenAL/TestAudioContext.cs rename to Source/Examples/OpenAL/Test/TestAudioContext.cs diff --git a/Source/Examples/Tutorial/T07_Display_Lists_Flower.cs b/Source/Examples/OpenGL/1.1/DisplayLists.cs similarity index 97% rename from Source/Examples/Tutorial/T07_Display_Lists_Flower.cs rename to Source/Examples/OpenGL/1.1/DisplayLists.cs index c4913119..f31f03a4 100644 --- a/Source/Examples/Tutorial/T07_Display_Lists_Flower.cs +++ b/Source/Examples/OpenGL/1.1/DisplayLists.cs @@ -22,7 +22,7 @@ using OpenTK.Graphics; namespace Examples.Tutorial { - [Example("Display Lists", ExampleCategory.OpenGL, "1.1")] + [Example("Display Lists", ExampleCategory.OpenGL, "1.1", Documentation="DisplayLists")] public class T07_Display_Lists_Flower : GameWindow { #region --- Fields --- diff --git a/Source/Examples/Tutorial/T03_Immediate_Mode_Cube.cs b/Source/Examples/OpenGL/1.1/ImmediateMode.cs similarity index 98% rename from Source/Examples/Tutorial/T03_Immediate_Mode_Cube.cs rename to Source/Examples/OpenGL/1.1/ImmediateMode.cs index 69d3248e..39e7257f 100644 --- a/Source/Examples/Tutorial/T03_Immediate_Mode_Cube.cs +++ b/Source/Examples/OpenGL/1.1/ImmediateMode.cs @@ -25,7 +25,7 @@ namespace Examples.Tutorial /// /// Demonstrates immediate mode rendering. /// - [Example("Immediate mode", ExampleCategory.OpenGL, "1.1")] + [Example("Immediate mode", ExampleCategory.OpenGL, "1.1", Documentation="ImmediateMode")] public class T03_Immediate_Mode_Cube : GameWindow { #region --- Fields --- diff --git a/Source/Examples/Tutorial/Textures.cs b/Source/Examples/OpenGL/1.1/Textures.cs similarity index 98% rename from Source/Examples/Tutorial/Textures.cs rename to Source/Examples/OpenGL/1.1/Textures.cs index fd474437..caf9b1ec 100644 --- a/Source/Examples/Tutorial/Textures.cs +++ b/Source/Examples/OpenGL/1.1/Textures.cs @@ -23,7 +23,7 @@ namespace Examples.Tutorial /// /// Demonstrates simple OpenGL Texturing. /// - [Example("Texture mapping", ExampleCategory.OpenGL, "1.1")] + [Example("Texture mapping", ExampleCategory.OpenGL, "1.1", Documentation="Textures")] public class Textures : GameWindow { Bitmap bitmap = new Bitmap("Data/logo.jpg"); diff --git a/Source/Examples/Tutorial/T02_Vertex_Arrays.cs b/Source/Examples/OpenGL/1.1/VertexArrays.cs similarity index 100% rename from Source/Examples/Tutorial/T02_Vertex_Arrays.cs rename to Source/Examples/OpenGL/1.1/VertexArrays.cs diff --git a/Source/Examples/Tutorial/T04_Vertex_Lighting.cs b/Source/Examples/OpenGL/1.1/VertexLighting.cs similarity index 98% rename from Source/Examples/Tutorial/T04_Vertex_Lighting.cs rename to Source/Examples/OpenGL/1.1/VertexLighting.cs index 745cae87..4b8df942 100644 --- a/Source/Examples/Tutorial/T04_Vertex_Lighting.cs +++ b/Source/Examples/OpenGL/1.1/VertexLighting.cs @@ -19,7 +19,7 @@ namespace Examples.Tutorial /// /// Demonstrates fixed-function OpenGL lighting. Example is incomplete (documentation). /// - [Example("Vertex Lighting", ExampleCategory.OpenGL, "1.1")] + [Example("Vertex Lighting", ExampleCategory.OpenGL, "1.1", false)] public class T04_Vertex_Lighting : GameWindow { float x_angle, zoom; diff --git a/Source/Examples/Tutorial/T08_VBO.cs b/Source/Examples/OpenGL/1.5/VertexBufferObject.cs similarity index 99% rename from Source/Examples/Tutorial/T08_VBO.cs rename to Source/Examples/OpenGL/1.5/VertexBufferObject.cs index 89686939..23aa645d 100644 --- a/Source/Examples/Tutorial/T08_VBO.cs +++ b/Source/Examples/OpenGL/1.5/VertexBufferObject.cs @@ -21,7 +21,7 @@ using OpenTK.Math; namespace Examples.Tutorial { - [Example("Vertex Buffer Objects", ExampleCategory.OpenGL, "1.5")] + [Example("Vertex Buffer Objects", ExampleCategory.OpenGL, "1.5", Documentation="VertexBufferObjects")] public class T08_VBO : GameWindow { #region --- Private Fields --- diff --git a/Source/Examples/OpenGL/FrameBufferObject.cs b/Source/Examples/OpenGL/EXT/FrameBufferObject.cs similarity index 99% rename from Source/Examples/OpenGL/FrameBufferObject.cs rename to Source/Examples/OpenGL/EXT/FrameBufferObject.cs index bcbc7db1..b9ff7e7a 100644 --- a/Source/Examples/OpenGL/FrameBufferObject.cs +++ b/Source/Examples/OpenGL/EXT/FrameBufferObject.cs @@ -18,7 +18,7 @@ using OpenTK.Graphics.OpenGL; namespace Examples.Tutorial { - [Example("Framebuffer Objects", ExampleCategory.OpenGL, "FBO", Documentation = "FramebufferObject")] + [Example("Framebuffer Objects", ExampleCategory.OpenGL, "FBO", Documentation="FramebufferObject")] public class SimpleFBO : GameWindow { public SimpleFBO() diff --git a/Source/Examples/OpenGL/FramebufferObject.rtf b/Source/Examples/OpenGL/EXT/FramebufferObject.rtf similarity index 100% rename from Source/Examples/OpenGL/FramebufferObject.rtf rename to Source/Examples/OpenGL/EXT/FramebufferObject.rtf diff --git a/Source/Examples/OpenGL/JuliaSetFractal.cs b/Source/Examples/OpenGL/GLSL/JuliaSetFractal.cs similarity index 99% rename from Source/Examples/OpenGL/JuliaSetFractal.cs rename to Source/Examples/OpenGL/GLSL/JuliaSetFractal.cs index 291e931c..2c9fe47b 100644 --- a/Source/Examples/OpenGL/JuliaSetFractal.cs +++ b/Source/Examples/OpenGL/GLSL/JuliaSetFractal.cs @@ -26,7 +26,7 @@ namespace Examples.Tutorial /// One more major optimization could be applied (exploit the symmetry of the image with RTT), but /// that would make the program alot more complicated to follow. You can do this as an exercise. /// - [Example("GLSL Animated Julia Set", ExampleCategory.OpenGL, "GLSL")] + [Example("GLSL Animated Julia Set", ExampleCategory.OpenGL, "GLSL", Documentation="JuliaSetFractal.cs")] public class JuliaSetFractal : GameWindow { public JuliaSetFractal() diff --git a/Source/Examples/Tutorial/T10_GLSL_Cube.cs b/Source/Examples/OpenGL/GLSL/SimpleGLSL.cs similarity index 99% rename from Source/Examples/Tutorial/T10_GLSL_Cube.cs rename to Source/Examples/OpenGL/GLSL/SimpleGLSL.cs index 7f4c2f61..092a0197 100644 --- a/Source/Examples/Tutorial/T10_GLSL_Cube.cs +++ b/Source/Examples/OpenGL/GLSL/SimpleGLSL.cs @@ -29,7 +29,7 @@ namespace Examples.Tutorial /// /// Demonstrates how to load and use a simple OpenGL shader program. Example is incomplete (documentation). /// - [Example("First shader", ExampleCategory.OpenGL, "GLSL")] + [Example("First shader", ExampleCategory.OpenGL, "GLSL", Documentation="SimpleGLSL")] public class T10_GLSL_Cube : GameWindow { #region --- Fields --- diff --git a/Source/Examples/OpenGL/GluTessellation.cs b/Source/Examples/OpenGL/GLU/Tessellation.cs similarity index 100% rename from Source/Examples/OpenGL/GluTessellation.cs rename to Source/Examples/OpenGL/GLU/Tessellation.cs diff --git a/Source/Examples/Tutorial/Text.cs b/Source/Examples/OpenTK/Fonts/FontRenderingAdvanced.cs similarity index 95% rename from Source/Examples/Tutorial/Text.cs rename to Source/Examples/OpenTK/Fonts/FontRenderingAdvanced.cs index ac85c79b..3ee078d8 100644 --- a/Source/Examples/Tutorial/Text.cs +++ b/Source/Examples/OpenTK/Fonts/FontRenderingAdvanced.cs @@ -20,8 +20,8 @@ namespace Examples.Tutorial /// /// Shows how to render and scroll large amounts of text. /// - [Example("Font rendering (advanced)", ExampleCategory.OpenTK, "Fonts", 2)] - public class Text : GameWindow + [Example("Font rendering (advanced)", ExampleCategory.OpenTK, "Fonts", 2, Documentation="FontRenderingAdvanced")] + public class FontRenderingAdvanced : GameWindow { Font serif = new Font(FontFamily.GenericSerif, 16.0f); Font sans = new Font(FontFamily.GenericSansSerif, 18.0f); @@ -35,7 +35,7 @@ namespace Examples.Tutorial float wraparound_position; float current_position; - public Text() + public FontRenderingAdvanced() : base(800, 600) { } @@ -147,7 +147,7 @@ namespace Examples.Tutorial [STAThread] public static void Main() { - using (Text example = new Text()) + using (FontRenderingAdvanced example = new FontRenderingAdvanced()) { // Get the title and category of this example using reflection. ExampleAttribute info = ((ExampleAttribute)example.GetType().GetCustomAttributes(false)[0]); diff --git a/Source/Examples/WinForms/FontRendering.Designer.cs b/Source/Examples/OpenTK/Fonts/FontRenderingBasic.Designer.cs similarity index 99% rename from Source/Examples/WinForms/FontRendering.Designer.cs rename to Source/Examples/OpenTK/Fonts/FontRenderingBasic.Designer.cs index 8dd3e632..2217ad7b 100644 --- a/Source/Examples/WinForms/FontRendering.Designer.cs +++ b/Source/Examples/OpenTK/Fonts/FontRenderingBasic.Designer.cs @@ -1,6 +1,6 @@ namespace Examples.WinForms { - partial class FontRendering + partial class FontRenderingBasic { /// /// Required designer variable. diff --git a/Source/Examples/WinForms/FontRendering.cs b/Source/Examples/OpenTK/Fonts/FontRenderingBasic.cs similarity index 93% rename from Source/Examples/WinForms/FontRendering.cs rename to Source/Examples/OpenTK/Fonts/FontRenderingBasic.cs index 209123a9..7567e539 100644 --- a/Source/Examples/WinForms/FontRendering.cs +++ b/Source/Examples/OpenTK/Fonts/FontRenderingBasic.cs @@ -9,8 +9,8 @@ using OpenTK.Graphics; namespace Examples.WinForms { - [Example("Font rendering (basic)", ExampleCategory.OpenTK, "Fonts", Difficulty = 1, Documentation = "FontRendering")] - public partial class FontRendering : Form + [Example("Font rendering (basic)", ExampleCategory.OpenTK, "Fonts", Difficulty = 1, Documentation = "FontRenderingBasic")] + public partial class FontRenderingBasic : Form { #region Fields @@ -23,7 +23,7 @@ namespace Examples.WinForms #region Constructors - public FontRendering() + public FontRenderingBasic() { InitializeComponent(); ResizeRedraw = true; @@ -111,7 +111,7 @@ namespace Examples.WinForms [STAThread] public static void Main() { - using (FontRendering example = new FontRendering()) + using (FontRenderingBasic example = new FontRenderingBasic()) { Utilities.SetWindowTitle(example); example.ShowDialog(); diff --git a/Source/Examples/WinForms/FontRendering.resx b/Source/Examples/OpenTK/Fonts/FontRenderingBasic.resx similarity index 100% rename from Source/Examples/WinForms/FontRendering.resx rename to Source/Examples/OpenTK/Fonts/FontRenderingBasic.resx diff --git a/Source/Examples/WinForms/FontRendering.rtf b/Source/Examples/OpenTK/Fonts/FontRenderingBasic.rtf similarity index 100% rename from Source/Examples/WinForms/FontRendering.rtf rename to Source/Examples/OpenTK/Fonts/FontRenderingBasic.rtf diff --git a/Source/Examples/WinForms/DerivedGLControl.Designer.cs b/Source/Examples/OpenTK/GLControl/DerivedGLControl.Designer.cs similarity index 100% rename from Source/Examples/WinForms/DerivedGLControl.Designer.cs rename to Source/Examples/OpenTK/GLControl/DerivedGLControl.Designer.cs diff --git a/Source/Examples/WinForms/DerivedGLControl.cs b/Source/Examples/OpenTK/GLControl/DerivedGLControl.cs similarity index 100% rename from Source/Examples/WinForms/DerivedGLControl.cs rename to Source/Examples/OpenTK/GLControl/DerivedGLControl.cs diff --git a/Source/Examples/WinForms/W02_Immediate_Mode_Cube.Designer.cs b/Source/Examples/OpenTK/GLControl/GLControlGameLoop.Designer.cs similarity index 93% rename from Source/Examples/WinForms/W02_Immediate_Mode_Cube.Designer.cs rename to Source/Examples/OpenTK/GLControl/GLControlGameLoop.Designer.cs index 4014e3cf..c84b7444 100644 --- a/Source/Examples/WinForms/W02_Immediate_Mode_Cube.Designer.cs +++ b/Source/Examples/OpenTK/GLControl/GLControlGameLoop.Designer.cs @@ -1,6 +1,6 @@ namespace Examples.WinForms { - partial class W02_Immediate_Mode_Cube + partial class GameLoopForm { /// /// Required designer variable. @@ -40,7 +40,6 @@ this.glControl.Size = new System.Drawing.Size(784, 564); this.glControl.TabIndex = 0; this.glControl.VSync = false; - this.glControl.Layout += new System.Windows.Forms.LayoutEventHandler(this.glControl_Layout); // // W02_Immediate_Mode_Cube // diff --git a/Source/Examples/WinForms/W02_Immediate_Mode_Cube.cs b/Source/Examples/OpenTK/GLControl/GLControlGameLoop.cs similarity index 91% rename from Source/Examples/WinForms/W02_Immediate_Mode_Cube.cs rename to Source/Examples/OpenTK/GLControl/GLControlGameLoop.cs index 3f7f7749..92895038 100644 --- a/Source/Examples/WinForms/W02_Immediate_Mode_Cube.cs +++ b/Source/Examples/OpenTK/GLControl/GLControlGameLoop.cs @@ -23,14 +23,14 @@ using OpenTK.Platform; namespace Examples.WinForms { - [Example("GLControl game loop", ExampleCategory.OpenTK, "GLControl")] - public partial class W02_Immediate_Mode_Cube : Form + [Example("Simple GLControl Game Loop", ExampleCategory.OpenTK, "GLControl", 2, Documentation="GLControlGameLoop")] + public partial class GameLoopForm : Form { static float angle = 0.0f; #region --- Constructor --- - public W02_Immediate_Mode_Cube() + public GameLoopForm() { InitializeComponent(); } @@ -45,7 +45,7 @@ namespace Examples.WinForms glControl.KeyDown += new KeyEventHandler(glControl_KeyDown); glControl.KeyUp += new KeyEventHandler(glControl_KeyUp); - //glControl.Resize += new EventHandler(glControl_Resize); + glControl.Resize += new EventHandler(glControl_Resize); glControl.Paint += new PaintEventHandler(glControl_Paint); Text = @@ -58,7 +58,8 @@ namespace Examples.WinForms Application.Idle += Application_Idle; - //glControl_Resize(glControl, EventArgs.Empty); + // Ensure that the viewport and projection matrix are set correctly. + glControl_Resize(glControl, EventArgs.Empty); } void glControl_KeyUp(object sender, KeyEventArgs e) @@ -207,11 +208,6 @@ namespace Examples.WinForms #endregion - private void glControl_Layout(object sender, LayoutEventArgs e) - { - glControl_Resize(sender, EventArgs.Empty); - } - #region public static void Main() /// @@ -220,7 +216,7 @@ namespace Examples.WinForms [STAThread] public static void Main() { - using (W02_Immediate_Mode_Cube example = new W02_Immediate_Mode_Cube()) + using (GameLoopForm example = new GameLoopForm()) { // Get the title and category of this example using reflection. ExampleAttribute info = ((ExampleAttribute)example.GetType().GetCustomAttributes(false)[0]); diff --git a/Source/Examples/WinForms/W01_First_Window.resx b/Source/Examples/OpenTK/GLControl/GLControlGameLoop.resx similarity index 100% rename from Source/Examples/WinForms/W01_First_Window.resx rename to Source/Examples/OpenTK/GLControl/GLControlGameLoop.resx diff --git a/Source/Examples/WinForms/W04_Multiple_GLControls.Designer.cs b/Source/Examples/OpenTK/GLControl/MultipleGLControls.Designer.cs similarity index 98% rename from Source/Examples/WinForms/W04_Multiple_GLControls.Designer.cs rename to Source/Examples/OpenTK/GLControl/MultipleGLControls.Designer.cs index f1ee6260..4238de8e 100644 --- a/Source/Examples/WinForms/W04_Multiple_GLControls.Designer.cs +++ b/Source/Examples/OpenTK/GLControl/MultipleGLControls.Designer.cs @@ -1,6 +1,6 @@ namespace Examples.WinForms { - partial class W04_Multiple_GLControls + partial class MultipleGLControlsForm { /// /// Required designer variable. diff --git a/Source/Examples/WinForms/W04_Multiple_GLControls.cs b/Source/Examples/OpenTK/GLControl/MultipleGLControls.cs similarity index 62% rename from Source/Examples/WinForms/W04_Multiple_GLControls.cs rename to Source/Examples/OpenTK/GLControl/MultipleGLControls.cs index 37010915..4530a2ae 100644 --- a/Source/Examples/WinForms/W04_Multiple_GLControls.cs +++ b/Source/Examples/OpenTK/GLControl/MultipleGLControls.cs @@ -11,17 +11,17 @@ using OpenTK.Graphics.OpenGL; namespace Examples.WinForms { - [Example("Multiple GLControls test", ExampleCategory.OpenTK, "GLControl", 4)] - public partial class W04_Multiple_GLControls : Form + [Example("Multiple GLControls", ExampleCategory.OpenTK, "GLControl", 3, Documentation="MultipleGLControls.cs")] + public partial class MultipleGLControlsForm : Form { - public W04_Multiple_GLControls() + public MultipleGLControlsForm() { InitializeComponent(); } public static void Main() { - using (W04_Multiple_GLControls example = new W04_Multiple_GLControls()) + using (MultipleGLControlsForm example = new MultipleGLControlsForm()) { Utilities.SetWindowTitle(example); example.ShowDialog(); diff --git a/Source/Examples/WinForms/W02_Immediate_Mode_Cube.resx b/Source/Examples/OpenTK/GLControl/MultipleGLControls.resx similarity index 100% rename from Source/Examples/WinForms/W02_Immediate_Mode_Cube.resx rename to Source/Examples/OpenTK/GLControl/MultipleGLControls.resx diff --git a/Source/Examples/WinForms/W01_First_Window.Designer.cs b/Source/Examples/OpenTK/GLControl/SimpleGLControl.Designer.cs similarity index 99% rename from Source/Examples/WinForms/W01_First_Window.Designer.cs rename to Source/Examples/OpenTK/GLControl/SimpleGLControl.Designer.cs index 0e491a14..e8e1e2ac 100644 --- a/Source/Examples/WinForms/W01_First_Window.Designer.cs +++ b/Source/Examples/OpenTK/GLControl/SimpleGLControl.Designer.cs @@ -1,6 +1,6 @@ namespace Examples.WinForms { - partial class W01_First_Window + partial class SimpleForm { /// /// Required designer variable. diff --git a/Source/Examples/WinForms/W01_First_Window.cs b/Source/Examples/OpenTK/GLControl/SimpleGLControl.cs similarity index 93% rename from Source/Examples/WinForms/W01_First_Window.cs rename to Source/Examples/OpenTK/GLControl/SimpleGLControl.cs index c98e3d04..ad23db0d 100644 --- a/Source/Examples/WinForms/W01_First_Window.cs +++ b/Source/Examples/OpenTK/GLControl/SimpleGLControl.cs @@ -21,10 +21,10 @@ using OpenTK.Graphics; namespace Examples.WinForms { - [Example("Simple GLControl", ExampleCategory.OpenTK, "GLControl", 1)] - public partial class W01_First_Window : Form + [Example("Simple GLControl", ExampleCategory.OpenTK, "GLControl", 1, Documentation="SimpleGLControl")] + public partial class SimpleForm : Form { - public W01_First_Window() + public SimpleForm() { InitializeComponent(); } @@ -93,7 +93,7 @@ namespace Examples.WinForms [STAThread] public static void Main() { - using (W01_First_Window example = new W01_First_Window()) + using (SimpleForm example = new SimpleForm()) { Utilities.SetWindowTitle(example); example.ShowDialog(); diff --git a/Source/Examples/WinForms/W04_Multiple_GLControls.resx b/Source/Examples/OpenTK/GLControl/SimpleGLControl.resx similarity index 100% rename from Source/Examples/WinForms/W04_Multiple_GLControls.resx rename to Source/Examples/OpenTK/GLControl/SimpleGLControl.resx diff --git a/Source/Examples/Tutorial/T01_Simple_Window.cs b/Source/Examples/OpenTK/GameWindow/SimpleWindow.cs similarity index 95% rename from Source/Examples/Tutorial/T01_Simple_Window.cs rename to Source/Examples/OpenTK/GameWindow/SimpleWindow.cs index 1224d22d..d684711a 100644 --- a/Source/Examples/Tutorial/T01_Simple_Window.cs +++ b/Source/Examples/OpenTK/GameWindow/SimpleWindow.cs @@ -21,10 +21,10 @@ namespace Examples.Tutorial /// /// Demonstrates the GameWindow class. /// - [Example("Simple Window", ExampleCategory.OpenTK, "GameWindow")] - public class T01_Simple_Window : GameWindow + [Example("Simple Window", ExampleCategory.OpenTK, "GameWindow", Documentation="SimpleWindow")] + public class SimpleWindow : GameWindow { - public T01_Simple_Window() : base(800, 600) + public SimpleWindow() : base(800, 600) { Keyboard.KeyDown += new OpenTK.Input.KeyDownEvent(Keyboard_KeyDown); } @@ -132,7 +132,7 @@ namespace Examples.Tutorial [STAThread] public static void Main() { - using (T01_Simple_Window example = new T01_Simple_Window()) + using (SimpleWindow example = new SimpleWindow()) { // Get the title and category of this example using reflection. Utilities.SetWindowTitle(example); diff --git a/Source/Examples/Tests/Color4Serialization.cs b/Source/Examples/OpenTK/Test/Color4Serialization.cs similarity index 98% rename from Source/Examples/Tests/Color4Serialization.cs rename to Source/Examples/OpenTK/Test/Color4Serialization.cs index 5eae74b7..d7adf47a 100644 --- a/Source/Examples/Tests/Color4Serialization.cs +++ b/Source/Examples/OpenTK/Test/Color4Serialization.cs @@ -50,8 +50,6 @@ namespace Examples.Tests Console.WriteLine(color2); Console.WriteLine(color.Equals(color2)); } - - Console.ReadKey(true); } } } diff --git a/Source/Examples/Tests/Extensions.Designer.cs b/Source/Examples/OpenTK/Test/Extensions.Designer.cs similarity index 100% rename from Source/Examples/Tests/Extensions.Designer.cs rename to Source/Examples/OpenTK/Test/Extensions.Designer.cs diff --git a/Source/Examples/Tests/Extensions.cs b/Source/Examples/OpenTK/Test/Extensions.cs similarity index 100% rename from Source/Examples/Tests/Extensions.cs rename to Source/Examples/OpenTK/Test/Extensions.cs diff --git a/Source/Examples/Tests/Extensions.resx b/Source/Examples/OpenTK/Test/Extensions.resx similarity index 100% rename from Source/Examples/Tests/Extensions.resx rename to Source/Examples/OpenTK/Test/Extensions.resx diff --git a/Source/Examples/Tests/GameWindowStates.cs b/Source/Examples/OpenTK/Test/GameWindowStates.cs similarity index 100% rename from Source/Examples/Tests/GameWindowStates.cs rename to Source/Examples/OpenTK/Test/GameWindowStates.cs diff --git a/Source/Examples/Tests/InputLogger.Designer.cs b/Source/Examples/OpenTK/Test/InputLogger.Designer.cs similarity index 100% rename from Source/Examples/Tests/InputLogger.Designer.cs rename to Source/Examples/OpenTK/Test/InputLogger.Designer.cs diff --git a/Source/Examples/Tests/InputLogger.cs b/Source/Examples/OpenTK/Test/InputLogger.cs similarity index 100% rename from Source/Examples/Tests/InputLogger.cs rename to Source/Examples/OpenTK/Test/InputLogger.cs diff --git a/Source/Examples/Tests/InputLogger.resx b/Source/Examples/OpenTK/Test/InputLogger.resx similarity index 100% rename from Source/Examples/Tests/InputLogger.resx rename to Source/Examples/OpenTK/Test/InputLogger.resx diff --git a/Source/Examples/Tests/MathSerialization.cs b/Source/Examples/OpenTK/Test/MathSerialization.cs similarity index 100% rename from Source/Examples/Tests/MathSerialization.cs rename to Source/Examples/OpenTK/Test/MathSerialization.cs diff --git a/Source/Examples/Tests/MathSpeed.cs b/Source/Examples/OpenTK/Test/MathSpeed.cs similarity index 100% rename from Source/Examples/Tests/MathSpeed.cs rename to Source/Examples/OpenTK/Test/MathSpeed.cs diff --git a/Source/Examples/Tests/S01_Call_Performance.cs b/Source/Examples/OpenTK/Test/S01_Call_Performance.cs similarity index 98% rename from Source/Examples/Tests/S01_Call_Performance.cs rename to Source/Examples/OpenTK/Test/S01_Call_Performance.cs index fbad8804..89dcf73e 100644 --- a/Source/Examples/Tests/S01_Call_Performance.cs +++ b/Source/Examples/OpenTK/Test/S01_Call_Performance.cs @@ -18,7 +18,8 @@ using OpenTK.Graphics; namespace Examples.Tests { - public class S01_Call_Performance : IExample + // This test is obsolete. + public class S01_Call_Performance { const int num_calls = 1000000; float[] v = new float[] { 0.0f, 0.0f }; diff --git a/Source/Examples/Tests/TestResolutionChanges.cs b/Source/Examples/OpenTK/Test/TestResolutionChanges.cs similarity index 100% rename from Source/Examples/Tests/TestResolutionChanges.cs rename to Source/Examples/OpenTK/Test/TestResolutionChanges.cs diff --git a/Source/Examples/Properties/Resources.Designer.cs b/Source/Examples/Properties/Resources.Designer.cs index e909658f..e77fae3c 100644 --- a/Source/Examples/Properties/Resources.Designer.cs +++ b/Source/Examples/Properties/Resources.Designer.cs @@ -59,5 +59,838 @@ namespace Examples.Properties { resourceCulture = value; } } + + /// + /// Looks up a localized string similar to #region License + ///// + ///// The Open Toolkit Library License + ///// + ///// Copyright (c) 2006 - 2008 the Open Toolkit library, except where noted. + ///// + ///// Permission is hereby granted, free of charge, to any person obtaining a copy + ///// of this software and associated documentation files (the "Software"), to deal + ///// in the Software without restriction, including without limitation the rights to + ///// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + ///// the Software, and to permit person [rest of string was truncated]";. + /// + internal static string Color4Serialization { + get { + return ResourceManager.GetString("Color4Serialization", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to #region --- License --- + ////* Copyright (c) 2006, 2007 Stefanos Apostolopoulos + /// * See license.txt for license info + /// */ + ///#endregion + /// + ///#region --- Using Directives --- + /// + ///using System; + ///using System.Collections.Generic; + ///using System.ComponentModel; + ///using System.Data; + ///using System.Drawing; + ///using System.Text; + ///using System.Windows.Forms; + ///using System.Threading; + /// + ///using OpenTK; + ///using OpenTK.Graphics; + /// + ///#endregion --- Using Directives --- + /// + ///namespace Examples.Tutorial + ///{ + /// [Example("Display Lists", E [rest of string was truncated]";. + /// + internal static string DisplayLists { + get { + return ResourceManager.GetString("DisplayLists", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to #region License + ///// + ///// The Open Toolkit Library License + ///// + ///// Copyright (c) 2006 - 2009 the Open Toolkit library. + ///// + ///// Permission is hereby granted, free of charge, to any person obtaining a copy + ///// of this software and associated documentation files (the "Software"), to deal + ///// in the Software without restriction, including without limitation the rights to + ///// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + ///// the Software, and to permit persons to whom the Softwa [rest of string was truncated]";. + /// + internal static string EFXReverb { + get { + return ResourceManager.GetString("EFXReverb", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to #region --- License --- + ////* Copyright (c) 2006, 2007 Stefanos Apostolopoulos + /// * See license.txt for license info + /// */ + ///#endregion + /// + ///using System; + ///using System.Collections.Generic; + ///using System.ComponentModel; + ///using System.Data; + ///using System.Drawing; + ///using System.Text; + ///using System.Windows.Forms; + ///using System.Threading; + ///using System.Reflection; + /// + ///using OpenTK; + ///using OpenTK.Graphics.OpenGL; + ///using OpenTK.Graphics.OpenGL.Enums; + ///using OpenTK.Graphics; + ///using System.Text.RegularExpressions; + /// + ///names [rest of string was truncated]";. + /// + internal static string Extensions { + get { + return ResourceManager.GetString("Extensions", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to #region --- License --- + ////* Copyright (c) 2006, 2007 Stefanos Apostolopoulos + /// * See license.txt for license info + /// */ + ///#endregion + /// + ///using System; + ///using System.Collections.Generic; + ///using System.Text; + ///using System.IO; + ///using System.Drawing; + ///using System.Diagnostics; + /// + ///using OpenTK; + ///using OpenTK.Graphics; + ///using OpenTK.Input; + /// + ///namespace Examples.Tutorial + ///{ + /// /// <summary> + /// /// Shows how to render and scroll large amounts of text. + /// /// </summary> + /// [Example("Font rendering (advanced)", [rest of string was truncated]";. + /// + internal static string FontRenderingAdvanced { + get { + return ResourceManager.GetString("FontRenderingAdvanced", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {\rtf1\ansi\ansicpg1253\deff0\deflang1032{\fonttbl{\f0\fswiss\fprq2\fcharset0 Arial;}{\f1\fswiss\fcharset0 Arial;}{\f2\fswiss\fcharset161{\*\fname Arial;}Arial Greek;}{\f3\fswiss\fprq2\fcharset161{\*\fname Arial;}Arial Greek;}{\f4\fmodern\fprq1\fcharset0 Consolas;}} + ///{\colortbl ;\red0\green0\blue255;\red43\green145\blue175;} + ///{\*\generator Msftedit 5.41.21.2508;}\viewkind4\uc1\pard\qc\lang1033\b\f0\fs32 Font rendering\par + ///\b0\f1\fs20\par + ///\lang1032\f2\par + ///\pard\lang1033\b\f1\fs24 Overview\par + ///\par + ///\b0\f [rest of string was truncated]";. + /// + internal static string FontRenderingBasic { + get { + return ResourceManager.GetString("FontRenderingBasic", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to namespace Examples.WinForms + ///{ + /// partial class FontRenderingBasic + /// { + /// /// <summary> + /// /// Required designer variable. + /// /// </summary> + /// private System.ComponentModel.IContainer components = null; + /// + /// /// <summary> + /// /// Clean up any resources being used. + /// /// </summary> + /// /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> + /// protected override void Dispose(bool disposing) + /// { + /// [rest of string was truncated]";. + /// + internal static string FontRenderingBasic_Designer { + get { + return ResourceManager.GetString("FontRenderingBasic_Designer", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to using System; + ///using System.Collections.Generic; + ///using System.ComponentModel; + ///using System.Data; + ///using System.Drawing; + ///using System.Text; + ///using System.Windows.Forms; + ///using OpenTK.Graphics; + /// + ///namespace Examples.WinForms + ///{ + /// [Example("Font rendering (basic)", ExampleCategory.OpenTK, "Fonts", Difficulty = 1, Documentation = "FontRenderingBasic")] + /// public partial class FontRenderingBasic : Form + /// { + /// #region Fields + /// + /// float[] sizes = new float[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1 [rest of string was truncated]";. + /// + internal static string FontRenderingBasic1 { + get { + return ResourceManager.GetString("FontRenderingBasic1", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to <?xml version="1.0" encoding="utf-8"?> + ///<root> + /// <!-- + /// Microsoft ResX Schema + /// + /// Version 2.0 + /// + /// The primary goals of this format is to allow a simple XML format + /// that is mostly human readable. The generation and parsing of the + /// various data types are done through the TypeConverter classes + /// associated with the data types. + /// + /// Example: + /// + /// ... ado.net/XML headers & schema ... + /// <resheader name="resmimetype">text/microsoft-resx</resheader> + /// <resheader n [rest of string was truncated]";. + /// + internal static string FontRenderingBasic2 { + get { + return ResourceManager.GetString("FontRenderingBasic2", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to #region --- License --- + ////* Licensed under the MIT/X11 license. + /// * Copyright (c) 2006-2008 the OpenTK Team. + /// * This notice may not be removed from any source distribution. + /// * See license.txt for licensing details. + /// */ + ///#endregion + /// + ///using System; + ///using System.Diagnostics; + ///using System.Drawing; + /// + ///using OpenTK; + ///using OpenTK.Input; + ///using OpenTK.Math; + ///using OpenTK.Graphics; + ///using OpenTK.Graphics.OpenGL; + /// + ///namespace Examples.Tutorial + ///{ + /// [Example("Framebuffer Objects", ExampleCategory.OpenGL, "FB [rest of string was truncated]";. + /// + internal static string FrameBufferObject { + get { + return ResourceManager.GetString("FrameBufferObject", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {\rtf1\ansi\ansicpg1253\deff0\deflang1032\deflangfe1032{\fonttbl{\f0\fswiss\fprq2\fcharset0 Arial;}{\f1\fswiss\fcharset0 Arial;}{\f2\fswiss\fcharset161{\*\fname Arial;}Arial Greek;}} + ///{\*\generator Msftedit 5.41.21.2508;}\viewkind4\uc1\pard\qc\lang1033\b\f0\fs32 Framebuffer Objects\par + ///\b0\f1\fs20\par + ///\lang1032\f2\par + ///\pard\lang1033\b\f1\fs24 Overview\par + ///\par + ///\b0\fs22 This sample demonstrates Framebuffer objects (FBOs) via the EXT_framebuffer_object extension. FBOs provide an efficient method to perfo [rest of string was truncated]";. + /// + internal static string FramebufferObject1 { + get { + return ResourceManager.GetString("FramebufferObject1", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to #region --- License --- + ////* Copyright (c) 2006, 2007 Stefanos Apostolopoulos + /// * See license.txt for license info + /// */ + ///#endregion + /// + ///using System; + ///using System.Collections.Generic; + ///using System.Text; + ///using System.Diagnostics; + ///using System.Drawing; + ///using System.Threading; + /// + ///using OpenTK; + ///using OpenTK.Graphics; + ///using OpenTK.Input; + /// + ///namespace Examples.Tests + ///{ + /// [Example("GameWindow states", ExampleCategory.OpenTK, "Test")] + /// public class GameWindowStates : GameWindow + /// { + /// Font font [rest of string was truncated]";. + /// + internal static string GameWindowStates { + get { + return ResourceManager.GetString("GameWindowStates", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to #region --- License --- + ////* This source file is released under the MIT license. See License.txt for more information. + /// * Coded by Erik Ylvisaker and Stefanos Apostolopoulos. + /// */ + ///#endregion + /// + ///#region --- Using directives --- + /// + ///using System; + ///using System.Collections.Generic; + ///using System.ComponentModel; + ///using System.Data; + ///using System.Drawing; + ///using System.Text; + ///using System.Windows.Forms; + ///using System.Diagnostics; + ///using System.Threading; + /// + ///using OpenTK.Graphics; + ///using OpenTK.Platform; + /// + ///#endr [rest of string was truncated]";. + /// + internal static string GLControlGameLoop { + get { + return ResourceManager.GetString("GLControlGameLoop", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to #region --- License --- + ////* Licensed under the MIT/X11 license. + /// * Copyright (c) 2006-2008 the OpenTK Team. + /// * This notice may not be removed from any source distribution. + /// * See license.txt for licensing detailed licensing details. + /// */ + ///#endregion + /// + ///#region --- Using Directives --- + /// + ///using System; + ///using System.Collections.Generic; + ///using System.Windows.Forms; + ///using System.Threading; + ///using System.Drawing; + /// + ///using OpenTK; + ///using OpenTK.Graphics; + ///using OpenTK.Graphics.OpenGL; + /// + ///#endregion + /// + ///names [rest of string was truncated]";. + /// + internal static string ImmediateMode { + get { + return ResourceManager.GetString("ImmediateMode", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to #region --- License --- + ////* Copyright (c) 2006, 2007 Stefanos Apostolopoulos + /// * See license.txt for license info + /// */ + ///#endregion + /// + ///using System; + ///using System.Collections.Generic; + ///using System.ComponentModel; + ///using System.Data; + ///using System.Drawing; + ///using System.Text; + ///using System.Windows.Forms; + /// + ///using OpenTK; + ///using OpenTK.Platform; + ///using OpenTK.Input; + ///using System.Diagnostics; + ///using System.Threading; + /// + ///using OpenTK.Graphics; + ///using OpenTK.Graphics.OpenGL; + /// + ///namespace Examples.Tests + ///{ + /// [rest of string was truncated]";. + /// + internal static string InputLogger { + get { + return ResourceManager.GetString("InputLogger", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to #region --- License --- + ////* Licensed under the MIT/X11 license. + /// * Copyright (c) 2006-2008 the OpenTK Team. + /// * This notice may not be removed from any source distribution. + /// * See license.txt for licensing detailed licensing details. + /// * + /// * Written by Christoph Brandtner + /// */ + ///#endregion + /// + ///using System; + ///using System.Windows.Forms; + ///using System.Diagnostics; + ///using System.Drawing; + ///using System.Drawing.Imaging; + ///using System.IO; + /// + ///using OpenTK; + ///using OpenTK.Graphics; + /// + ///namespace Examples.Tutorial + ///{ [rest of string was truncated]";. + /// + internal static string JuliaSetFractal { + get { + return ResourceManager.GetString("JuliaSetFractal", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to using System; + ///using System.Collections.Generic; + ///using System.ComponentModel; + ///using System.Data; + ///using System.Drawing; + ///using System.Text; + ///using System.Windows.Forms; + /// + ///using OpenTK; + ///using OpenTK.Graphics.OpenGL; + /// + ///namespace Examples.WinForms + ///{ + /// [Example("Multiple GLControls", ExampleCategory.OpenTK, "GLControl", 3)] + /// public partial class MultipleGLControlsForm : Form + /// { + /// public MultipleGLControlsForm() + /// { + /// InitializeComponent(); + /// } + /// + /// public s [rest of string was truncated]";. + /// + internal static string MultipleGLControls { + get { + return ResourceManager.GetString("MultipleGLControls", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to #region --- License --- + ////* Licensed under the MIT/X11 license. + /// * Copyright (c) 2006-2008 the OpenTK Team. + /// * This notice may not be removed from any source distribution. + /// * See license.txt for licensing details. + /// */ + ///#endregion + /// + ///using System; + ///using System.Threading; + ///using System.IO; + /// + ///using OpenTK.Audio; + /// + ///namespace Examples + ///{ + /// [Example("Playback", ExampleCategory.OpenAL, "1.1")] + /// public class Playback + /// { + /// static readonly string filename = Path.Combine(Path.Combine("Data", " [rest of string was truncated]";. + /// + internal static string Playback { + get { + return ResourceManager.GetString("Playback", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to /* + /// * Copyright (c) 2006, Creative Labs Inc. + /// * All rights reserved. + /// * + /// * Redistribution and use in source and binary forms, with or without modification, are permitted provided + /// * that the following conditions are met: + /// * + /// * * Redistributions of source code must retain the above copyright notice, this list of conditions and + /// * the following disclaimer. + /// * * Redistributions in binary form must reproduce the above copyright notice, this list of conditions + /// * and the following [rest of string was truncated]";. + /// + internal static string PlayStatic { + get { + return ResourceManager.GetString("PlayStatic", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to #region --- License --- + ////* Copyright (c) 2006, 2007 Stefanos Apostolopoulos + /// * See license.txt for license info + /// */ + ///#endregion + /// + ///#region --- Using directives --- + /// + ///using System; + ///using System.Collections.Generic; + ///using System.ComponentModel; + ///using System.Data; + ///using System.Drawing; + ///using System.Text; + ///using System.Windows.Forms; + /// + ///using OpenTK; + ///using OpenTK.Graphics; + /// + ///#endregion + /// + ///namespace Examples.WinForms + ///{ + /// [Example("Simple GLControl", ExampleCategory.OpenTK, "GLControl", 1)] + /// pu [rest of string was truncated]";. + /// + internal static string SimpleGLControl { + get { + return ResourceManager.GetString("SimpleGLControl", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to #region --- License --- + ////* Licensed under the MIT/X11 license. + /// * Copyright (c) 2006-2008 the OpenTK Team. + /// * This notice may not be removed from any source distribution. + /// * See license.txt for licensing detailed licensing details. + /// */ + ///#endregion + /// + ///#region --- Using Directives --- + /// + ///using System; + ///using System.Collections.Generic; + ///using System.ComponentModel; + ///using System.Drawing; + ///using System.Text; + ///using System.Windows.Forms; + ///using System.Threading; + ///using System.Diagnostics; + ///using System.IO; [rest of string was truncated]";. + /// + internal static string SimpleGLSL { + get { + return ResourceManager.GetString("SimpleGLSL", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to #region --- License --- + ////* Copyright (c) 2006, 2007 Stefanos Apostolopoulos + /// * See license.txt for license info + /// */ + ///#endregion + /// + ///using System; + ///using System.Collections.Generic; + ///using System.Text; + ///using System.Drawing; + ///using System.Diagnostics; + /// + ///using OpenTK; + ///using OpenTK.Graphics.OpenGL; + ///using OpenTK.Graphics; + ///using OpenTK.Graphics.OpenGL.Enums; + ///using OpenTK.Input; + /// + ///namespace Examples.Tutorial + ///{ + /// /// <summary> + /// /// Demonstrates the GameWindow class. + /// /// </summary> + /// [Exampl [rest of string was truncated]";. + /// + internal static string SimpleWindow { + get { + return ResourceManager.GetString("SimpleWindow", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to #region --- License --- + ////* Licensed under the MIT/X11 license. + /// * Copyright (c) 2006-2008 the OpenTK Team. + /// * This notice may not be removed from any source distribution. + /// * See license.txt for licensing details. + /// */ + ///#endregion + /// + ///using System; + ///using System.Collections.Generic; + ///using System.Text; + ///using System.Threading; + ///using System.ComponentModel; + /// + ///using OpenTK.Audio; + /// + ///namespace Examples.OpenAL + ///{ + /// // Not working correctly (sound pops). + /// + /// //[Example("Streaming Playback", ExampleCateg [rest of string was truncated]";. + /// + internal static string StreamingPlayback { + get { + return ResourceManager.GetString("StreamingPlayback", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to #region --- License --- + ////* Licensed under the MIT/X11 license. + /// * Copyright (c) 2006-2008 the OpenTK Team. + /// * This notice may not be removed from any source distribution. + /// * See license.txt for licensing details. + /// */ + ///#endregion + /// + ///using System; + ///using System.Diagnostics; + ///using System.Runtime.InteropServices; + /// + ///using OpenTK; + ///using OpenTK.Graphics; + ///using OpenTK.Input; + /// + ///namespace Examples + ///{ + /// [Example("GLU Tesselation Functions Test", ExampleCategory.OpenGL, "GLU", Visible = false)] + /// public [rest of string was truncated]";. + /// + internal static string Tessellation { + get { + return ResourceManager.GetString("Tessellation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to #region --- License --- + ////* Licensed under the MIT/X11 license. + /// * Copyright (c) 2006-2008 the OpenTK Team. + /// * This notice may not be removed from any source distribution. + /// * See license.txt for licensing details. + /// */ + ///#endregion + /// + ///using System; + /// + ///using OpenTK.Audio; + /// + ///using AlContext = System.IntPtr; + ///using AlDevice = System.IntPtr; + ///using System.Diagnostics; + /// + ///namespace Examples + ///{ + /// [Example("AudioContext Test", ExampleCategory.OpenTK, "Test", 0, false)] + /// class TestApp + /// { + /// publ [rest of string was truncated]";. + /// + internal static string TestAudioContext { + get { + return ResourceManager.GetString("TestAudioContext", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to #region --- License --- + ////* Licensed under the MIT/X11 license. + /// * Copyright (c) 2006-2008 the OpenTK team. + /// * This notice may not be removed. + /// * See license.txt for licensing detailed licensing details. + /// */ + ///#endregion + /// + ///using System; + ///using System.Collections.Generic; + ///using System.Text; + ///using System.Windows.Forms; + ///using System.Diagnostics; + /// + ///using OpenTK.Graphics; + ///using System.Threading; + /// + ///namespace Examples.Tests + ///{ + /// [Example("Test Resolution Changes", ExampleCategory.OpenTK, "Test")] + /// [rest of string was truncated]";. + /// + internal static string TestResolutionChanges { + get { + return ResourceManager.GetString("TestResolutionChanges", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to #region --- License --- + ////* Copyright (c) 2006, 2007 Stefanos Apostolopoulos + /// * See license.txt for license info + /// */ + ///#endregion + /// + ///using System; + ///using System.Collections.Generic; + ///using System.Text; + ///using System.Diagnostics; + ///using System.IO; + /// + ///using System.Drawing; + ///using System.Drawing.Imaging; + /// + ///using OpenTK; + ///using OpenTK.Graphics.OpenGL; + ///using OpenTK.Graphics; + ///using OpenTK.Graphics.OpenGL.Enums; + /// + ///namespace Examples.Tutorial + ///{ + /// /// <summary> + /// /// Demonstrates simple OpenGL Texturing. [rest of string was truncated]";. + /// + internal static string Textures { + get { + return ResourceManager.GetString("Textures", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to #region --- License --- + ////* Copyright (c) 2006, 2007 Stefanos Apostolopoulos + /// * See license.txt for license info + /// */ + ///#endregion + /// + ///using System; + ///using System.Collections.Generic; + ///using System.Text; + ///using System.Drawing; + ///using System.Threading; + /// + ///using OpenTK; + ///using OpenTK.Graphics.OpenGL; + ///using System.Diagnostics; + ///using OpenTK.Input; + ///using OpenTK.Graphics; + ///using OpenTK.Graphics.OpenGL.Enums; + /// + ///namespace Examples.Tutorial + ///{ + /// /// <summary> + /// /// Demonstrates Vertex Arrays (in system memo [rest of string was truncated]";. + /// + internal static string VertexArrays { + get { + return ResourceManager.GetString("VertexArrays", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to #region --- License --- + ////* Copyright (c) 2006, 2007 Stefanos Apostolopoulos + /// * See license.txt for license info + /// */ + ///#endregion + /// + ///#region --- Using directives --- + /// + ///using System; + ///using System.Collections.Generic; + ///using System.Text; + ///using System.Runtime.InteropServices; + ///using System.Threading; + /// + ///using OpenTK; + ///using OpenTK.Graphics; + ///using OpenTK.Platform; + ///using OpenTK.Math; + /// + ///#endregion + /// + ///namespace Examples.Tutorial + ///{ + /// [Example("Vertex Buffer Objects", ExampleCategory.OpenGL, "1.5", Docume [rest of string was truncated]";. + /// + internal static string VertexBufferObject { + get { + return ResourceManager.GetString("VertexBufferObject", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to #region --- License --- + ////* Copyright (c) 2006, 2007 Stefanos Apostolopoulos + /// * See license.txt for license info + /// */ + ///#endregion + /// + ///using System; + ///using System.Collections.Generic; + ///using System.Text; + ///using System.Drawing; + /// + ///using OpenTK; + ///using OpenTK.Graphics; + ///using Examples.Shapes; + ///using OpenTK.Math; + /// + ///namespace Examples.Tutorial + ///{ + /// /// <summary> + /// /// Demonstrates fixed-function OpenGL lighting. Example is incomplete (documentation). + /// /// </summary> + /// [Example("Vertex Lighting", E [rest of string was truncated]";. + /// + internal static string VertexLighting { + get { + return ResourceManager.GetString("VertexLighting", resourceCulture); + } + } } } diff --git a/Source/Examples/Properties/Resources.resx b/Source/Examples/Properties/Resources.resx index f7a8edb6..1533ef8d 100644 --- a/Source/Examples/Properties/Resources.resx +++ b/Source/Examples/Properties/Resources.resx @@ -118,16 +118,94 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - ..\winforms\fontrendering.cs;System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8 + + ..\opentk\test\color4serialization.cs;System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8 - - ..\winforms\fontrendering.rtf;System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + ..\opengl\1.1\displaylists.cs;System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8 - - ..\OpenGL\FrameBufferObject.cs;System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8 + + ..\openal\efx\efxreverb.cs;System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8 - - ..\OpenGL\FramebufferObject.rtf;System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;windows-1253 + + ..\opentk\test\extensions.cs;System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8 + + + ..\opentk\fonts\fontrenderingadvanced.cs;System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8 + + + ..\opentk\fonts\fontrenderingbasic.rtf;System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;windows-1253 + + + ..\opentk\fonts\fontrenderingbasic.cs;System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8 + + + ..\opentk\fonts\fontrenderingbasic.resx;System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;windows-1253 + + + ..\opentk\fonts\fontrenderingbasic.designer.cs;System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8 + + + ..\opengl\ext\framebufferobject.cs;System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8 + + + ..\opengl\ext\framebufferobject.rtf;System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;windows-1253 + + + ..\opentk\test\gamewindowstates.cs;System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8 + + + ..\opentk\glcontrol\glcontrolgameloop.cs;System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8 + + + ..\opengl\1.1\immediatemode.cs;System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8 + + + ..\opentk\test\inputlogger.cs;System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8 + + + ..\opengl\glsl\juliasetfractal.cs;System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8 + + + ..\opentk\glcontrol\multipleglcontrols.cs;System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8 + + + ..\openal\1.1\playback.cs;System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8 + + + ..\openal\1.1\playstatic.cs;System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8 + + + ..\opentk\glcontrol\simpleglcontrol.cs;System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8 + + + ..\opentk\gamewindow\simplewindow.cs;System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8 + + + ..\openal\1.1\streamingplayback.cs;System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8 + + + ..\opengl\glu\tessellation.cs;System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8 + + + ..\openal\test\testaudiocontext.cs;System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8 + + + ..\opentk\test\testresolutionchanges.cs;System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8 + + + ..\opengl\1.1\textures.cs;System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8 + + + ..\opengl\1.1\vertexarrays.cs;System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8 + + + ..\opengl\1.5\vertexbufferobject.cs;System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8 + + + ..\opengl\1.1\vertexlighting.cs;System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8 + + + ..\opengl\glsl\simpleglsl.cs;System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8 \ No newline at end of file diff --git a/Source/Examples/Tutorial/Fonts.cs b/Source/Examples/Tutorial/Fonts.cs deleted file mode 100644 index 2c81e037..00000000 --- a/Source/Examples/Tutorial/Fonts.cs +++ /dev/null @@ -1,207 +0,0 @@ -#region --- License --- -/* Copyright (c) 2006, 2007 Stefanos Apostolopoulos - * See license.txt for license info - */ -#endregion - -using System; -using System.Collections.Generic; -using System.Text; -using System.Drawing; - -using OpenTK; -using OpenTK.Graphics; -using OpenTK.Graphics.OpenGL; -using OpenTK.Input; -using System.IO; -using OpenTK.Graphics.OpenGL.Enums; -using OpenTK.Math; - -namespace Examples.Tutorial -{ - /// - /// Tests Font loading and rendering. - /// - [Example("Fonts", ExampleCategory.OpenTK, "Fonts", Visible = false)] - class Fonts : GameWindow - { - public Fonts() : base(800, 600) - { } - - #region --- Fields --- - - ITextPrinter printer = new TextPrinter(); - const string text = "Hello, world!"; - - // Load some different TextureFont sizes to compare their quality. - // You'll never need to load that many fonts in your application, - // 3 or 4 should be more than enough. - Font[] fonts = new Font[] - { - new Font(FontFamily.GenericSerif, 8.0f), - new Font(FontFamily.GenericSerif, 10.0f), - new Font(FontFamily.GenericSerif, 12.0f), - new Font(FontFamily.GenericSerif, 14.0f), - - new Font(FontFamily.GenericSerif, 16.0f), - new Font(FontFamily.GenericSerif, 18.0f), - new Font(FontFamily.GenericSerif, 20.0f), - new Font(FontFamily.GenericSerif, 22.0f), - - new Font(FontFamily.GenericSerif, 24.0f, FontStyle.Bold), - new Font(FontFamily.GenericSerif, 26.0f), - new Font(FontFamily.GenericSerif, 28.0f), - new Font(FontFamily.GenericSerif, 30.0f), - - new Font(FontFamily.GenericSerif, 32.0f, FontStyle.Italic), - new Font(FontFamily.GenericSerif, 34.0f), - new Font(FontFamily.GenericSerif, 36.0f), - new Font(FontFamily.GenericSerif, 38.0f), - - new Font(FontFamily.GenericSansSerif, 8.0f), - new Font(FontFamily.GenericSansSerif, 10.0f), - new Font(FontFamily.GenericSansSerif, 12.0f), - new Font(FontFamily.GenericSansSerif, 14.0f), - - new Font(FontFamily.GenericSansSerif, 16.0f), - new Font(FontFamily.GenericSansSerif, 18.0f), - new Font(FontFamily.GenericSansSerif, 20.0f), - new Font(FontFamily.GenericSansSerif, 22.0f), - - new Font(FontFamily.GenericSansSerif, 24.0f, FontStyle.Bold), - new Font(FontFamily.GenericSansSerif, 26.0f), - new Font(FontFamily.GenericSansSerif, 28.0f), - new Font(FontFamily.GenericSansSerif, 30.0f), - - new Font(FontFamily.GenericSansSerif, 32.0f, FontStyle.Italic), - new Font(FontFamily.GenericSansSerif, 34.0f), - new Font(FontFamily.GenericSansSerif, 36.0f), - new Font(FontFamily.GenericSansSerif, 38.0f), - }; - - #endregion - - #region OnLoad - - /// - /// To maintain high rendering performance, we need to cache the text - /// we wish to draw, for each font we want to draw it with. To achieve - /// this, we use the TextPrinter.Prepare() method, which returns a - /// TextHandle - i.e. a handle to the cached text. - /// - /// We can use these TextHandles with the TextPrinter.Draw() method - /// to draw text with very high performance. - /// - /// - /// - public override void OnLoad(EventArgs e) - { - GL.ClearColor(Color.MidnightBlue); - } - - #endregion - - #region OnUnload - - /// - /// It is important that we need to call the Dispose() methods to reclaim of - /// each and every TextHandle and TextureFont to reclaim the unamanged - /// (OpenGL) resources they are using. - /// - /// - public override void OnUnload(EventArgs e) - { - foreach (Font f in fonts) - f.Dispose(); - } - - #endregion - - #region OnResize - - protected override void OnResize(OpenTK.Platform.ResizeEventArgs e) - { - GL.Viewport(0, 0, Width, Height); - } - - #endregion - - #region OnUpdateFrame - - public override void OnUpdateFrame(UpdateFrameEventArgs e) - { - if (Keyboard[Key.Escape]) - this.Exit(); - } - - #endregion - - #region OnRenderFrame - - /// - /// To render pixel-perfect text, we have to setup a 2d display projection - /// with a width/height that corresponds to our current Viewport. - /// In OpenGL this can be easily achieved using the GL.Ortho method. - /// - /// It is still possible to render text in a 3d projection, but it will - /// be very hard to achieve pixel-perfect precision. - /// - /// - /// To achieve the highest possible performance, render your 3d scene first. - /// At the end of the RenderFrame call, setup a 2d projection and render all - /// text in one go. - /// - /// - /// - public override void OnRenderFrame(RenderFrameEventArgs e) - { - GL.Clear(ClearBufferMask.ColorBufferBit); - - printer.Begin(); - - // Print using the first font. - for (int i = 0; i < fonts.Length / 2; i++) - { - printer.Print(text, fonts[i], Color.White); - GL.Translate(0, fonts[i].Height, 0); - } - - // Move to the right, and print using the second font. - //float width, height; - //fonts[handles.Length / 2 - 1].MeasureString(text, out width, out height); - RectangleF rect = printer.Measure(text, fonts[fonts.Length / 2 - 1]).BoundingBox; - GL.LoadIdentity(); - GL.Translate(rect.Width + 32.0f, 0, 0); - for (int i = fonts.Length / 2; i < fonts.Length; i++) - { - printer.Print(text, fonts[i], Color.White); - GL.Translate(0, fonts[i].Height, 0); - } - - printer.End(); - - SwapBuffers(); - } - - #endregion - - #region public static void Main() - - /// - /// Entry point of this example. - /// - [STAThread] - public static void Main() - { - using (Fonts example = new Fonts()) - { - // Get the title and category of this example using reflection. - ExampleAttribute info = ((ExampleAttribute)example.GetType().GetCustomAttributes(false)[0]); - example.Title = String.Format("OpenTK | {0} {1}: {2}", info.Category, info.Difficulty, info.Title); - example.Run(30.0, 0.0); - } - } - - #endregion - } -}