mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-02-24 08:06:59 +00:00
NRE -> GraphicsContextMissingException
Throw a GraphicsContextMissingException if GraphicsBindingBase.LoadAll() is called without a current GraphicsContext.
This commit is contained in:
parent
0e221a0ce5
commit
94c02e827a
|
@ -51,7 +51,10 @@ namespace OpenTK.Graphics
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
protected override IntPtr GetAddress(string funcname)
|
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