mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2024-11-23 12:22:35 +00:00
Fixed a rendering issue when resizing the main window
This commit is contained in:
parent
2fd192479d
commit
542d68370d
2 changed files with 15 additions and 0 deletions
|
@ -474,6 +474,19 @@ namespace CodeImp.DoomBuilder.Rendering
|
|||
}
|
||||
}
|
||||
|
||||
// This clears a target
|
||||
public void ClearRendertarget(Color4 backcolor, Surface target, Surface depthbuffer)
|
||||
{
|
||||
// Set rendertarget
|
||||
device.DepthStencilSurface = depthbuffer;
|
||||
device.SetRenderTarget(0, target);
|
||||
|
||||
if(depthbuffer != null)
|
||||
device.Clear(ClearFlags.Target | ClearFlags.ZBuffer, backcolor, 1f, 0);
|
||||
else
|
||||
device.Clear(ClearFlags.Target, backcolor, 1f, 0);
|
||||
}
|
||||
|
||||
// This ends a drawing session
|
||||
public void FinishRendering()
|
||||
{
|
||||
|
|
|
@ -432,6 +432,8 @@ namespace CodeImp.DoomBuilder.Rendering
|
|||
//StartPlotter(true); Finish();
|
||||
//StartThings(true); Finish();
|
||||
//StartOverlay(true); Finish();
|
||||
graphics.ClearRendertarget(General.Colors.Background.WithAlpha(0).ToColorValue(), thingstex.GetSurfaceLevel(0), null);
|
||||
graphics.ClearRendertarget(General.Colors.Background.WithAlpha(0).ToColorValue(), overlaytex.GetSurfaceLevel(0), null);
|
||||
|
||||
// Create font
|
||||
font = new SlimDX.Direct3D9.Font(graphics.Device, FONT_WIDTH, FONT_HEIGHT, FontWeight.Bold, 1, false, CharacterSet.Ansi, Precision.Default, FontQuality.Antialiased, PitchAndFamily.Default, FONT_NAME);
|
||||
|
|
Loading…
Reference in a new issue