Opentk/Source/Examples/Tests/S02_RawInput_Logger.cs
the_fiddler 59b503b3c3 Bumped version numbers.
WinRawInput now correctly subclasses WinGLNative or WinGLControl. WinRawKeyboard now correctly responds to events.
Removed T10_GLSL_Cube.cs which was erroneously moved outside the Examples/Tutorial directory.
Updated INativeWindow, IGameWindow and IGLControl interfaces.
Updated examples to use the new GameWindow interface.
Added documentation to GameWindow.
Improved GameWindow error handling. More defensive programming.
2007-08-04 12:09:58 +00:00

83 lines
2.2 KiB
C#

using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using OpenTK;
using OpenTK.OpenGL;
using System.Threading;
using System.Runtime.Serialization;
using System.IO;
using System.Diagnostics;
namespace Examples.Tests
{
public class S02_RawInput_Logger : GameWindow, IExample
{
#region IExample Members
public void Launch()
{
//using (S02_RawInput_Logger ex = new S02_RawInput_Logger())
{
try
{
//ex.Run();
Run();
}
catch (Exception expt)
{
System.Diagnostics.Debug.WriteLine(
String.Format(
"Exception: {3}{0}Stacktrace:{0}{1}{0}{0}{2}",
System.Environment.NewLine,
expt.TargetSite,
expt.StackTrace,
expt.Message
)
);
/*MessageBox.Show(
String.Format(
"Stacktrace:{0}{1}{0}{0}{2}",
System.Environment.NewLine,
expt.TargetSite,
expt.StackTrace
),
expt.Message
);*/
throw;
}
}
Debug.Flush();
Debug.Close();
}
#endregion
public S02_RawInput_Logger()
{
GL.ClearColor(0.0f, 0.0f, 0.0f, 0.0f);
}
public override void OnRenderFrame()
{
base.OnRenderFrame();
GL.Clear(GL.Enums.ClearBufferMask.COLOR_BUFFER_BIT);
Context.SwapBuffers();
}
public override void Run()
{
while (!Quit)
{
ProcessEvents();
OnUpdateFrame();
OnRenderFrame();
Thread.Sleep(10);
}
}
}
}