threading fix
parent
d431c5bd6d
commit
f6f44eb658
|
@ -48,11 +48,15 @@ namespace MoonWorksMultiWindow
|
||||||
|
|
||||||
protected override void Draw(System.TimeSpan dt, double alpha)
|
protected override void Draw(System.TimeSpan dt, double alpha)
|
||||||
{
|
{
|
||||||
Task mainDraw = Task.Run(MainDraw);
|
var mainDraw = Task.Run(MainDraw);
|
||||||
Task extraDraw = Task.Run(ExtraWindowDraw);
|
var extraDraw = Task.Run(ExtraWindowDraw);
|
||||||
|
|
||||||
|
mainDraw.Wait();
|
||||||
|
extraDraw.Wait();
|
||||||
|
GraphicsDevice.Submit(mainDraw.Result, extraDraw.Result);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void MainDraw()
|
private CommandBuffer MainDraw()
|
||||||
{
|
{
|
||||||
var commandBuffer = GraphicsDevice.AcquireCommandBuffer();
|
var commandBuffer = GraphicsDevice.AcquireCommandBuffer();
|
||||||
|
|
||||||
|
@ -77,10 +81,10 @@ namespace MoonWorksMultiWindow
|
||||||
Window
|
Window
|
||||||
);
|
);
|
||||||
|
|
||||||
GraphicsDevice.Submit(commandBuffer);
|
return commandBuffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ExtraWindowDraw()
|
private CommandBuffer ExtraWindowDraw()
|
||||||
{
|
{
|
||||||
var commandBuffer = GraphicsDevice.AcquireCommandBuffer();
|
var commandBuffer = GraphicsDevice.AcquireCommandBuffer();
|
||||||
|
|
||||||
|
@ -105,7 +109,7 @@ namespace MoonWorksMultiWindow
|
||||||
ExtraWindow
|
ExtraWindow
|
||||||
);
|
);
|
||||||
|
|
||||||
GraphicsDevice.Submit(commandBuffer);
|
return commandBuffer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue