Removed unusued IGLControlHelper interface.

This commit is contained in:
the_fiddler 2008-11-23 09:39:52 +00:00
parent 62ae3698ad
commit 6dcc5b841d
2 changed files with 0 additions and 108 deletions

View file

@ -1,45 +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 detailed licensing details.
*/
#endregion
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
namespace OpenTK.Platform.Windows
{
/// <internal />
/// <summary>Utility to obtain IWindowInfo from a System.Windows.Forms.Control on win32.</summary>
internal sealed class WinGLControlHelper : IGLControlHelper
{
MSG msg = new MSG();
Control control;
#region --- Constructors ---
public WinGLControlHelper(Control c)
{
control = c;
}
#endregion
#region --- IGLControlHelper Members ---
/// <summary>Returns an OpenTK.Platform.IWindowInfo describing this control.</summary>
public IWindowInfo WindowInfo { get { return new WinWindowInfo(control.Handle, null); } }
/// <summary>Returns true if no messages are pending in the event loop.</summary>
public bool IsIdle
{
get { return !OpenTK.Platform.Windows.Functions.PeekMessage(ref msg, IntPtr.Zero, 0, 0, 0); }
}
#endregion
}
}

View file

@ -1,63 +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 detailed licensing details.
*/
#endregion
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
namespace OpenTK.Platform.X11
{
/// <internal />
/// <summary>Utility to obtain IWindowInfo from a System.Windows.Forms.Control on Mono/X11.</summary>
internal sealed class X11GLControlHelper : IGLControlHelper
{
Control control;
IntPtr display;
public X11GLControlHelper(Control c)
{
}
#region IGLControlHelper Members
public IWindowInfo WindowInfo
{
get
{
X11WindowInfo window = new X11WindowInfo();
Type xplatui = Type.GetType("System.Windows.Forms.XplatUIX11, System.Windows.Forms");
if (xplatui == null)
throw new ApplicationException("Could not get System.Windows.Forms.XplatUIX11 through reflection. Unsupported platform or Mono runtime version, aborting.");
display =
window.Display = (IntPtr)xplatui.GetField("DisplayHandle",
System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.NonPublic).GetValue(null);
window.RootWindow = (IntPtr)xplatui.GetField("RootWindow",
System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.NonPublic).GetValue(null);
window.Screen = (int)xplatui.GetField("ScreenNo",
System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.NonPublic).GetValue(null);
return (IWindowInfo)window;
}
}
public bool IsIdle
{
get
{
lock (Functions.Lock)
{
return Functions.XPending(display) == 0;
}
}
}
#endregion
}
}