mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-01-10 04:05:28 +00:00
Removed obsolete CreateDummyContext functions and added constructor
constructor comments which explain how to create a dummy context.
This commit is contained in:
parent
7601a86f6d
commit
da6682711a
|
@ -102,7 +102,8 @@ namespace OpenTK.Graphics
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Constructs a new GraphicsContext with the specified GraphicsMode, version and flags, and attaches it to the specified window.
|
/// Constructs a new GraphicsContext with the specified GraphicsMode, version and flags, and attaches it to the specified window. A dummy context will be created if both
|
||||||
|
/// the handle and the window are null.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="mode">The OpenTK.Graphics.GraphicsMode of the GraphicsContext.</param>
|
/// <param name="mode">The OpenTK.Graphics.GraphicsMode of the GraphicsContext.</param>
|
||||||
/// <param name="window">The OpenTK.Platform.IWindowInfo to attach the GraphicsContext to.</param>
|
/// <param name="window">The OpenTK.Platform.IWindowInfo to attach the GraphicsContext to.</param>
|
||||||
|
@ -252,7 +253,8 @@ namespace OpenTK.Graphics
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Constructs a new GraphicsContext from a pre-existing context created outside of OpenTK.
|
/// Constructs a new GraphicsContext from a pre-existing context created outside of OpenTK. A dummy context will be created if both
|
||||||
|
/// the handle and the window are null.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="handle">The handle of the existing context. This must be a valid, unique handle that is not known to OpenTK.</param>
|
/// <param name="handle">The handle of the existing context. This must be a valid, unique handle that is not known to OpenTK.</param>
|
||||||
/// <param name="window">This parameter is reserved.</param>
|
/// <param name="window">This parameter is reserved.</param>
|
||||||
|
@ -360,45 +362,6 @@ namespace OpenTK.Graphics
|
||||||
|
|
||||||
#region --- Static Members ---
|
#region --- Static Members ---
|
||||||
|
|
||||||
#region public static GraphicsContext CreateDummyContext()
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Creates a dummy GraphicsContext to allow OpenTK to work with contexts created by external libraries.
|
|
||||||
/// </summary>
|
|
||||||
/// <returns>A new, dummy GraphicsContext instance.</returns>
|
|
||||||
/// <remarks>
|
|
||||||
/// <para>Instances created by this method will not be functional. Instance methods will have no effect.</para>
|
|
||||||
/// <para>This method requires that a context is current on the calling thread.</para>
|
|
||||||
/// </remarks>
|
|
||||||
[Obsolete("Use GraphicsContext(ContextHandle, IWindowInfo) constructor instead")]
|
|
||||||
public static GraphicsContext CreateDummyContext()
|
|
||||||
{
|
|
||||||
ContextHandle handle = GetCurrentContext();
|
|
||||||
if (handle == ContextHandle.Zero)
|
|
||||||
throw new InvalidOperationException("No GraphicsContext is current on the calling thread.");
|
|
||||||
|
|
||||||
return CreateDummyContext(handle);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Creates a dummy GraphicsContext to allow OpenTK to work with contexts created by external libraries.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="handle">The handle of a context.</param>
|
|
||||||
/// <returns>A new, dummy GraphicsContext instance.</returns>
|
|
||||||
/// <remarks>
|
|
||||||
/// <para>Instances created by this method will not be functional. Instance methods will have no effect.</para>
|
|
||||||
/// </remarks>
|
|
||||||
[Obsolete("Use GraphicsContext(ContextHandle, IWindowInfo) constructor instead")]
|
|
||||||
public static GraphicsContext CreateDummyContext(ContextHandle handle)
|
|
||||||
{
|
|
||||||
if (handle == ContextHandle.Zero)
|
|
||||||
throw new ArgumentOutOfRangeException("handle");
|
|
||||||
|
|
||||||
return new GraphicsContext(handle, (IWindowInfo)null);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region public static void Assert()
|
#region public static void Assert()
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
Loading…
Reference in a new issue