Revert "Run graphics rendering on a dedicated thread."
This reverts commit b9be52c5428d4a3862d62fe3a2c01663bd3692c3.
This commit is contained in:
@@ -18,12 +18,12 @@ namespace OpenRA.Platforms.Default
|
||||
{
|
||||
sealed class FrameBuffer : ThreadAffine, IFrameBuffer
|
||||
{
|
||||
readonly ITexture texture;
|
||||
readonly Texture texture;
|
||||
readonly Size size;
|
||||
uint framebuffer, depth;
|
||||
bool disposed;
|
||||
|
||||
public FrameBuffer(Size size, ITextureInternal texture)
|
||||
public FrameBuffer(Size size)
|
||||
{
|
||||
this.size = size;
|
||||
if (!Exts.IsPowerOf2(size.Width) || !Exts.IsPowerOf2(size.Height))
|
||||
@@ -35,7 +35,7 @@ namespace OpenRA.Platforms.Default
|
||||
OpenGL.CheckGLError();
|
||||
|
||||
// Color
|
||||
this.texture = texture;
|
||||
texture = new Texture();
|
||||
texture.SetEmpty(size.Width, size.Height);
|
||||
OpenGL.glFramebufferTexture2D(OpenGL.FRAMEBUFFER_EXT, OpenGL.COLOR_ATTACHMENT0_EXT, OpenGL.GL_TEXTURE_2D, texture.ID, 0);
|
||||
OpenGL.CheckGLError();
|
||||
@@ -120,9 +120,14 @@ namespace OpenRA.Platforms.Default
|
||||
}
|
||||
}
|
||||
|
||||
~FrameBuffer()
|
||||
{
|
||||
Game.RunAfterTick(() => Dispose(false));
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
Dispose(true);
|
||||
Game.RunAfterTick(() => Dispose(true));
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user