NRE -> GraphicsContextMissingException
Throw a GraphicsContextMissingException if GraphicsBindingBase.LoadAll() is called without a current GraphicsContext.
This commit is contained in:
parent
0e221a0ce5
commit
94c02e827a
1 changed files with 4 additions and 1 deletions
|
@ -51,7 +51,10 @@ namespace OpenTK.Graphics
|
|||
/// </remarks>
|
||||
protected override IntPtr GetAddress(string funcname)
|
||||
{
|
||||
return (GraphicsContext.CurrentContext as IGraphicsContextInternal).GetAddress(funcname);
|
||||
var context = GraphicsContext.CurrentContext as IGraphicsContextInternal;
|
||||
if (context == null)
|
||||
throw new GraphicsContextMissingException();
|
||||
return context != null ? context.GetAddress(funcname) : IntPtr.Zero;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue