Add overload for `IGuiApi.WithSurface` with stronger encapsulation
This commit is contained in:
parent
22e5e035d2
commit
1bc1f1b3d2
|
@ -65,6 +65,19 @@ namespace BizHawk.Client.Common
|
|||
{
|
||||
}
|
||||
|
||||
public void WithSurface(DisplaySurfaceID surfaceID, Action<IGuiApi> drawingCallsFunc)
|
||||
{
|
||||
_usingSurfaceID = surfaceID;
|
||||
try
|
||||
{
|
||||
drawingCallsFunc(this);
|
||||
}
|
||||
finally
|
||||
{
|
||||
_usingSurfaceID = null;
|
||||
}
|
||||
}
|
||||
|
||||
public void WithSurface(DisplaySurfaceID surfaceID, Action drawingCallsFunc)
|
||||
{
|
||||
_usingSurfaceID = surfaceID;
|
||||
|
|
|
@ -12,6 +12,9 @@ namespace BizHawk.Client.Common
|
|||
[Obsolete("No longer supported, no-op.")]
|
||||
void SetAttributes(ImageAttributes a);
|
||||
|
||||
void WithSurface(DisplaySurfaceID surfaceID, Action<IGuiApi> drawingCallsFunc);
|
||||
|
||||
[Obsolete("use the other overload e.g. `APIs.Gui.WithSurface(..., gui => { gui.DrawLine(...); });`")]
|
||||
void WithSurface(DisplaySurfaceID surfaceID, Action drawingCallsFunc);
|
||||
|
||||
[Obsolete("No longer supported, no-op.")]
|
||||
|
|
Loading…
Reference in New Issue