Added general documentation to Tutorials.

This commit is contained in:
the_fiddler 2007-09-26 15:39:32 +00:00
parent a64fd74ac1
commit 0e297c3c4e
5 changed files with 19 additions and 12 deletions

View file

@ -15,6 +15,9 @@ using OpenTK.OpenGL;
namespace Examples.Tutorial namespace Examples.Tutorial
{ {
/// <summary>
/// Demonstrates Vertex Arrays (in system memory). Example is incomplete (documentation).
/// </summary>
class T02_Vertex_Array_Cube : GameWindow, IExample class T02_Vertex_Array_Cube : GameWindow, IExample
{ {
float angle; float angle;

View file

@ -20,6 +20,9 @@ using OpenTK.Platform;
namespace Examples.Tutorial namespace Examples.Tutorial
{ {
/// <summary>
/// Demonstrates immediate mode rendering. Example is incomplete, and will probably go away in the future.
/// </summary>
public class T03_Immediate_Mode_Cube : OpenTK.GameWindow, IExample public class T03_Immediate_Mode_Cube : OpenTK.GameWindow, IExample
{ {
#region --- Fields --- #region --- Fields ---

View file

@ -16,7 +16,7 @@ using Examples.Shapes;
namespace Examples.Tutorial namespace Examples.Tutorial
{ {
/// <summary> /// <summary>
/// Demonstrates fixed-function OpenGL lighting. Tutorial is incomplete! /// Demonstrates fixed-function OpenGL lighting. Example is incomplete (documentation).
/// </summary> /// </summary>
class T04_Lit_Cube : GameWindow, IExample class T04_Lit_Cube : GameWindow, IExample
{ {
@ -53,8 +53,9 @@ namespace Examples.Tutorial
GL.Lightv(GL.Enums.LightName.LIGHT0, GL.Enums.LightParameter.DIFFUSE, new float[] { 1.0f, 1.0f, 1.0f, 1.0f }); GL.Lightv(GL.Enums.LightName.LIGHT0, GL.Enums.LightParameter.DIFFUSE, new float[] { 1.0f, 1.0f, 1.0f, 1.0f });
GL.Lightv(GL.Enums.LightName.LIGHT0, GL.Enums.LightParameter.SPECULAR, new float[] { 1.0f, 1.0f, 1.0f, 1.0f }); GL.Lightv(GL.Enums.LightName.LIGHT0, GL.Enums.LightParameter.SPECULAR, new float[] { 1.0f, 1.0f, 1.0f, 1.0f });
GL.LightModelv(GL.Enums.LightModelParameter.LIGHT_MODEL_AMBIENT, new float[] { 0.2f, 0.2f, 0.2f, 1.0f }); GL.LightModelv(GL.Enums.LightModelParameter.LIGHT_MODEL_AMBIENT, new float[] { 0.2f, 0.2f, 0.2f, 1.0f });
//GL.Enable(GL.Enums.EnableCap.LIGHTING); GL.LightModel(GL.Enums.LightModelParameter.LIGHT_MODEL_TWO_SIDE, 1);
//GL.Enable(GL.Enums.EnableCap.LIGHT0); GL.Enable(GL.Enums.EnableCap.LIGHTING);
GL.Enable(GL.Enums.EnableCap.LIGHT0);
// Use GL.Material to set your object's material parameters.. // Use GL.Material to set your object's material parameters..
GL.Materialv(GL.Enums.MaterialFace.FRONT, GL.Enums.MaterialParameter.AMBIENT, new float[] { 0.3f, 0.3f, 0.3f, 1.0f }); GL.Materialv(GL.Enums.MaterialFace.FRONT, GL.Enums.MaterialParameter.AMBIENT, new float[] { 0.3f, 0.3f, 0.3f, 1.0f });
@ -113,17 +114,17 @@ namespace Examples.Tutorial
} }
if (Mouse[OpenTK.Input.MouseButton.Left]) if (Mouse[OpenTK.Input.MouseButton.Left])
x_angle += Mouse.XDelta * 2; x_angle += Mouse.XDelta;
else else
x_angle += 0.5f; x_angle += 0.5f;
if (Mouse[OpenTK.Input.MouseButton.Right]) zoom = Mouse.Wheel * 0.5f;
zoom += Mouse.YDelta * 0.5f;
if (x_angle > 720.0f) // Do not leave x_angle drift too far away, as this will cause inaccuracies.
x_angle -= 720.0f; if (x_angle > 360.0f)
else if (x_angle < -720.0f) x_angle -= 360.0f;
x_angle += 720.0f; else if (x_angle < -360.0f)
x_angle += 360.0f;
} }
#endregion #endregion

View file

@ -23,7 +23,7 @@ using System.Threading;
namespace Examples.Tutorial namespace Examples.Tutorial
{ {
public partial class T07_Display_Lists_Flower : GameWindow, IExample public class T07_Display_Lists_Flower : GameWindow, IExample
{ {
#region --- Variables --- #region --- Variables ---

View file

@ -22,7 +22,7 @@ using OpenTK;
namespace Examples.Tutorial namespace Examples.Tutorial
{ {
/// <summary> /// <summary>
/// Demonstrates how to load and use a simple OpenGL shader program. /// Demonstrates how to load and use a simple OpenGL shader program. Example is incomplete (documentation).
/// </summary> /// </summary>
public class T10_GLSL_Cube : GameWindow, IExample public class T10_GLSL_Cube : GameWindow, IExample
{ {