Add IPostProcessWorldShader for custom effect render passes.

This commit is contained in:
Paul Chote
2023-10-22 16:58:58 +01:00
committed by Gustas
parent b1f5367822
commit 47af7a9023
10 changed files with 174 additions and 2 deletions

View File

@@ -111,6 +111,19 @@ namespace OpenRA.Platforms.Default
}
}
public void SetDataFromReadBuffer(Rectangle rect)
{
VerifyThreadAffinity();
if (!Exts.IsPowerOf2(rect.Width) || !Exts.IsPowerOf2(rect.Height))
throw new InvalidDataException($"Non-power-of-two rectangle {rect.Width}x{rect.Height}");
PrepareTexture();
var glInternalFormat = OpenGL.Profile == GLProfile.Embedded ? OpenGL.GL_BGRA : OpenGL.GL_RGBA8;
OpenGL.glCopyTexImage2D(OpenGL.GL_TEXTURE_2D, 0, glInternalFormat, rect.X, rect.Y, rect.Width, rect.Height, 0);
OpenGL.CheckGLError();
}
public byte[] GetData()
{
VerifyThreadAffinity();