mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-01-10 23:35:29 +00:00
Improved documentation for DummyGLContext and Dummy.
Disabled S02_RawInput_Logger for updating. Added WindowInfo.cs
This commit is contained in:
parent
2de33d9d8d
commit
a28c46cdc0
|
@ -18,7 +18,7 @@ using System.Diagnostics;
|
|||
|
||||
namespace Examples.Tests
|
||||
{
|
||||
public class S02_RawInput_Logger : GameWindow, IExample
|
||||
public class S02_RawInput_Logger : GameWindow//, IExample
|
||||
{
|
||||
#region IExample Members
|
||||
|
||||
|
|
|
@ -5,9 +5,9 @@ using System.Text;
|
|||
namespace OpenTK.Platform
|
||||
{
|
||||
/// <summary>
|
||||
/// A dummy GLContext to be used inside the Visual Studio designer.
|
||||
/// An empty IGLContext implementation to be used inside the Visual Studio designer.
|
||||
/// </summary>
|
||||
internal class DummyGLContext : IGLContext
|
||||
internal sealed class DummyGLContext : IGLContext
|
||||
{
|
||||
#region --- IGLContext Members ---
|
||||
|
||||
|
|
|
@ -5,9 +5,9 @@ using System.Text;
|
|||
namespace OpenTK.Platform
|
||||
{
|
||||
/// <summary>
|
||||
/// A dummy GLControl to be used inside the Visual Studio designer.
|
||||
/// An IGLControl implementation to be used inside the Visual Studio designer.
|
||||
/// </summary>
|
||||
internal class DummyGLControl : IGLControl
|
||||
internal sealed class DummyGLControl : IGLControl
|
||||
{
|
||||
bool fullscreen;
|
||||
IGLContext glContext = new DummyGLContext();
|
||||
|
|
127
Source/OpenTK/Platform/WindowInfo.cs
Normal file
127
Source/OpenTK/Platform/WindowInfo.cs
Normal file
|
@ -0,0 +1,127 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace OpenTK.Platform
|
||||
{
|
||||
/// <summary>
|
||||
/// Describes a Windows.Form.Control, Windows.Forms.NativeWindow or OpenTK.GameWindow.
|
||||
/// </summary>
|
||||
public sealed class WindowInfo : IWindowInfo
|
||||
{
|
||||
IWindowInfo implementation;
|
||||
|
||||
#region --- Constructors ---
|
||||
|
||||
/// <summary>
|
||||
/// Detects the underlying platform and constructs a new WindowInfo class.
|
||||
/// </summary>
|
||||
/// <exception cref="PlatformNotSupportedException">Raised when the underlying platform is not supported.</exception>
|
||||
public WindowInfo()
|
||||
{
|
||||
switch (Environment.OSVersion.Platform)
|
||||
{
|
||||
case PlatformID.Unix:
|
||||
case (PlatformID)128:
|
||||
implementation = new X11.WindowInfo();
|
||||
break;
|
||||
|
||||
case PlatformID.Win32NT:
|
||||
case PlatformID.Win32S:
|
||||
case PlatformID.Win32Windows:
|
||||
case PlatformID.WinCE:
|
||||
implementation = new Windows.WindowInfo();
|
||||
break;
|
||||
|
||||
default:
|
||||
throw new PlatformNotSupportedException("Your Operating System is not supported. Please refer to http://opentk.sourceforge.net for more information.");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Detects the underlying platform and constructs a new WindowInfo class describing the specified Control.
|
||||
/// </summary>
|
||||
/// <param name="control">The System.Windows.Forms.Control to get info from.</param>
|
||||
public WindowInfo(Control control) : this()
|
||||
{
|
||||
implementation.GetInfoFrom(control);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Detects the underlying platform and constructs a new WindowInfo class describing the specified NativeWindow.
|
||||
/// </summary>
|
||||
/// <param name="window">The System.Windows.Forms.NativeWindow to get info from.</param>
|
||||
public WindowInfo(NativeWindow window) : this()
|
||||
{
|
||||
implementation.GetInfoFrom(window);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Detects the underlying platform and constructs a new WindowInfo class describing the specified GameWindow.
|
||||
/// </summary>
|
||||
/// <param name="window">The OpenTK.GameWindow to get info from.</param>
|
||||
public WindowInfo(GameWindow window) : this()
|
||||
{
|
||||
implementation.GetInfoFrom(window);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region --- IWindowInfo Members ---
|
||||
|
||||
/// <summary>
|
||||
/// Gets the platform specific handle of the window described by the WindowInfo class.
|
||||
/// </summary>
|
||||
public IntPtr Handle
|
||||
{
|
||||
get { return implementation.Handle; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the parent of the window described by the WindowInfo class.
|
||||
/// </summary>
|
||||
public IWindowInfo Parent
|
||||
{
|
||||
get { return implementation.Parent; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Updates the WindowInfo to describe the specified Control.
|
||||
/// </summary>
|
||||
/// <param name="control">The System.Windows.Forms.Control to describe.</param>
|
||||
public void GetInfoFrom(Control control)
|
||||
{
|
||||
implementation.GetInfoFrom(control);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Updates the WindowInfo to describe the specified NativeWindow.
|
||||
/// </summary>
|
||||
/// <param name="window">The System.Windows.Forms.NativeWindow to describe.</param>
|
||||
public void GetInfoFrom(NativeWindow window)
|
||||
{
|
||||
implementation.GetInfoFrom(window);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Updates the WindowInfo to describe the specified GameWindow.
|
||||
/// </summary>
|
||||
/// <param name="window">The OpenTK.GameWindow to describe.</param>
|
||||
public void GetInfoFrom(GameWindow window)
|
||||
{
|
||||
implementation.GetInfoFrom(window);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Updates the WindowInfo using the specified WindowInfo.
|
||||
/// </summary>
|
||||
/// <param name="window">The OpenTK.Platform.Window to get information from.</param>
|
||||
public void GetInfoFrom(IWindowInfo info)
|
||||
{
|
||||
implementation.GetInfoFrom(info);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue