Add scissor support to IFrameBuffer.

This commit is contained in:
Paul Chote
2019-11-03 17:25:41 +00:00
committed by reaperrr
parent e7de7b4c05
commit 0c8a47b5af
3 changed files with 40 additions and 0 deletions

View File

@@ -454,6 +454,8 @@ namespace OpenRA.Platforms.Default
readonly Action bind;
readonly Action unbind;
readonly Action dispose;
readonly Action<object> enableScissor;
readonly Action disableScissor;
public ThreadedFrameBuffer(ThreadedGraphicsContext device, IFrameBuffer frameBuffer)
{
@@ -462,6 +464,9 @@ namespace OpenRA.Platforms.Default
bind = frameBuffer.Bind;
unbind = frameBuffer.Unbind;
dispose = frameBuffer.Dispose;
enableScissor = rect => frameBuffer.EnableScissor((Rectangle)rect);
disableScissor = frameBuffer.DisableScissor;
}
public ITexture Texture
@@ -482,6 +487,16 @@ namespace OpenRA.Platforms.Default
device.Post(unbind);
}
public void EnableScissor(Rectangle rect)
{
device.Post(enableScissor, rect);
}
public void DisableScissor()
{
device.Post(disableScissor);
}
public void Dispose()
{
device.Post(dispose);