mirror of
https://github.com/Ryujinx/Opentk.git
synced 2024-12-25 04:55:29 +00:00
Added Assert function for checking whether a GraphicsContext is exists in the calling thread.
This commit is contained in:
parent
b61bf2e77d
commit
73de884ee7
|
@ -93,9 +93,12 @@ namespace OpenTK.Graphics
|
|||
|
||||
#endregion
|
||||
|
||||
#region private GraphicsContext()
|
||||
|
||||
private GraphicsContext()
|
||||
{
|
||||
}
|
||||
{ }
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// Attempts to create a GraphicsContext object from an existing OpenGL context.
|
||||
|
@ -216,6 +219,19 @@ namespace OpenTK.Graphics
|
|||
#region public static AvailableDisplayFormats
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region public static void Assert()
|
||||
|
||||
/// <summary>
|
||||
/// Checks if a GraphicsContext exists in the calling thread and throws a GraphicsContextException if it doesn't.
|
||||
/// </summary>
|
||||
public static void Assert()
|
||||
{
|
||||
if (GraphicsContext.CurrentContext == null)
|
||||
throw new GraphicsContextException();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
@ -301,7 +317,7 @@ namespace OpenTK.Graphics
|
|||
|
||||
#endregion
|
||||
|
||||
#region --- IGLContextInternal Members ---
|
||||
#region --- IGraphicsContextInternal Members ---
|
||||
|
||||
#region void LoadAll()
|
||||
|
||||
|
|
Loading…
Reference in a new issue