Beautified platform selection in GLControl.cs
Added missing ')' in Keyboard.ToString() function.
This commit is contained in:
parent
9ac9af08ac
commit
3bf2d03def
2 changed files with 28 additions and 16 deletions
|
@ -58,10 +58,18 @@ namespace OpenTK
|
||||||
this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
|
this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
|
||||||
//this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
|
//this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
|
||||||
|
|
||||||
|
this.Disposed += new EventHandler(GLControl_Disposed);
|
||||||
|
|
||||||
//Debug.Print("Creating GLControl.");
|
//Debug.Print("Creating GLControl.");
|
||||||
//this.CreateControl();
|
//this.CreateControl();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GLControl_Disposed(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
//glControl.Context.Dispose();
|
||||||
|
//Application.ExitThread();
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
/*
|
/*
|
||||||
CreateParams @params;
|
CreateParams @params;
|
||||||
|
@ -92,24 +100,27 @@ namespace OpenTK
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void CreateContext()
|
public void CreateContext()
|
||||||
{
|
{
|
||||||
|
if (glControl != null)
|
||||||
|
{
|
||||||
|
throw new ApplicationException("Attempted to create GLControl more than once.");
|
||||||
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (Environment.OSVersion.Platform == PlatformID.Win32NT ||
|
switch (Environment.OSVersion.Platform)
|
||||||
Environment.OSVersion.Platform == PlatformID.Win32Windows)
|
|
||||||
{
|
{
|
||||||
glControl = new OpenTK.Platform.Windows.WinGLControl(this, new DisplayMode(Width, Height));
|
case PlatformID.Win32NT:
|
||||||
}
|
case PlatformID.Win32Windows:
|
||||||
else if (Environment.OSVersion.Platform == PlatformID.Unix ||
|
glControl = new OpenTK.Platform.Windows.WinGLControl(this, new DisplayMode(Width, Height));
|
||||||
Environment.OSVersion.Platform == (PlatformID)128) // some older versions of Mono reported 128.
|
break;
|
||||||
{
|
|
||||||
glControl = new OpenTK.Platform.X11.X11GLControl(this);
|
case PlatformID.Unix:
|
||||||
//, new DisplayMode(this.Width, this.Height, new OpenTK.Platform.ColorDepth(1, 1, 1, 1), 1, 0, 0, 0, false, false, false, 0.0f));
|
case (PlatformID)128: // some older versions of Mono reported 128.
|
||||||
}
|
glControl = new OpenTK.Platform.X11.X11GLControl(this);
|
||||||
else
|
break;
|
||||||
{
|
|
||||||
throw new PlatformNotSupportedException(
|
default:
|
||||||
"Your operating system is not currently supported. We are sorry for the inconvenience."
|
throw new PlatformNotSupportedException("Your operating system is not currently supported. We are sorry for the inconvenience.");
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
|
@ -283,5 +294,6 @@ namespace OpenTK
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -116,7 +116,7 @@ namespace OpenTK.Input
|
||||||
public override string ToString()
|
public override string ToString()
|
||||||
{
|
{
|
||||||
//return base.ToString();
|
//return base.ToString();
|
||||||
return String.Format("ID: {0} (keys: {1}, function keys: {2}, leds: {3}",
|
return String.Format("ID: {0} (keys: {1}, function keys: {2}, leds: {3})",
|
||||||
DeviceID, NumberOfKeys, NumberOfFunctionKeys, NumberOfLeds);
|
DeviceID, NumberOfKeys, NumberOfFunctionKeys, NumberOfLeds);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue