Render via an intermediate frame buffer.

This commit is contained in:
Paul Chote
2019-08-28 00:31:08 +01:00
committed by teinarss
parent d2298b6f04
commit c0ee346c1c
5 changed files with 63 additions and 21 deletions

View File

@@ -83,7 +83,7 @@ namespace OpenRA.Platforms.Default
return new Shader(name);
}
public void EnableScissor(int left, int top, int width, int height)
public void EnableScissor(int x, int y, int width, int height)
{
VerifyThreadAffinity();
@@ -97,16 +97,15 @@ namespace OpenRA.Platforms.Default
var windowScale = window.WindowScale;
var surfaceSize = window.SurfaceSize;
var bottom = windowSize.Height - (top + height);
if (windowSize != surfaceSize)
{
left = (int)Math.Round(windowScale * left);
bottom = (int)Math.Round(windowScale * bottom);
x = (int)Math.Round(windowScale * x);
y = (int)Math.Round(windowScale * y);
width = (int)Math.Round(windowScale * width);
height = (int)Math.Round(windowScale * height);
}
OpenGL.glScissor(left, bottom, width, height);
OpenGL.glScissor(x, y, width, height);
OpenGL.CheckGLError();
OpenGL.glEnable(OpenGL.GL_SCISSOR_TEST);
OpenGL.CheckGLError();

View File

@@ -59,7 +59,7 @@ namespace OpenRA.Platforms.Default
}
}
internal Size SurfaceSize
public Size SurfaceSize
{
get
{