2007-08-10 09:27:13 +00:00
|
|
|
|
#region --- License ---
|
|
|
|
|
/* Copyright (c) 2006, 2007 Stefanos Apostolopoulos
|
|
|
|
|
* See license.txt for license info
|
|
|
|
|
*/
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
using System;
|
2007-08-03 00:14:31 +00:00
|
|
|
|
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()
|
|
|
|
|
{
|
2007-08-04 12:09:58 +00:00
|
|
|
|
//using (S02_RawInput_Logger ex = new S02_RawInput_Logger())
|
2007-08-03 00:14:31 +00:00
|
|
|
|
{
|
2007-08-04 12:09:58 +00:00
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
//ex.Run();
|
|
|
|
|
Run();
|
|
|
|
|
}
|
|
|
|
|
catch (Exception expt)
|
2007-08-03 00:14:31 +00:00
|
|
|
|
{
|
2007-08-04 12:09:58 +00:00
|
|
|
|
System.Diagnostics.Debug.WriteLine(
|
|
|
|
|
String.Format(
|
|
|
|
|
"Exception: {3}{0}Stacktrace:{0}{1}{0}{0}{2}",
|
|
|
|
|
System.Environment.NewLine,
|
|
|
|
|
expt.TargetSite,
|
|
|
|
|
expt.StackTrace,
|
2007-08-03 00:14:31 +00:00
|
|
|
|
expt.Message
|
2007-08-04 12:09:58 +00:00
|
|
|
|
)
|
|
|
|
|
);
|
|
|
|
|
/*MessageBox.Show(
|
|
|
|
|
String.Format(
|
|
|
|
|
"Stacktrace:{0}{1}{0}{0}{2}",
|
|
|
|
|
System.Environment.NewLine,
|
|
|
|
|
expt.TargetSite,
|
|
|
|
|
expt.StackTrace
|
|
|
|
|
),
|
|
|
|
|
expt.Message
|
|
|
|
|
);*/
|
|
|
|
|
throw;
|
2007-08-03 00:14:31 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2007-08-04 12:09:58 +00:00
|
|
|
|
Debug.Flush();
|
|
|
|
|
Debug.Close();
|
|
|
|
|
|
2007-08-03 00:14:31 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
public S02_RawInput_Logger()
|
|
|
|
|
{
|
2007-08-06 11:26:58 +00:00
|
|
|
|
this.CreateWindow(new OpenTK.Platform.DisplayMode(100, 100));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void OnLoad(EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
base.OnLoad(e);
|
|
|
|
|
|
2007-08-03 00:14:31 +00:00
|
|
|
|
GL.ClearColor(0.0f, 0.0f, 0.0f, 0.0f);
|
|
|
|
|
}
|
|
|
|
|
|
2007-08-06 11:22:18 +00:00
|
|
|
|
public override void OnRenderFrame(EventArgs e)
|
2007-08-03 00:14:31 +00:00
|
|
|
|
{
|
2007-08-06 11:22:18 +00:00
|
|
|
|
base.OnRenderFrame(e);
|
2007-08-03 00:14:31 +00:00
|
|
|
|
|
|
|
|
|
GL.Clear(GL.Enums.ClearBufferMask.COLOR_BUFFER_BIT);
|
|
|
|
|
Context.SwapBuffers();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|