Added Assert function for checking whether a GraphicsContext is exists in the calling thread.
This commit is contained in:
parent
b61bf2e77d
commit
73de884ee7
1 changed files with 19 additions and 3 deletions
|
@ -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