From 72f297a479b6749674ec80e91be53b8c482123d2 Mon Sep 17 00:00:00 2001 From: Melodi <62381002+Melodi17@users.noreply.github.com> Date: Mon, 4 Aug 2025 12:07:39 +1000 Subject: crowbar --- DisplayEngine.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'DisplayEngine.cs') diff --git a/DisplayEngine.cs b/DisplayEngine.cs index f77598f..f983226 100644 --- a/DisplayEngine.cs +++ b/DisplayEngine.cs @@ -10,6 +10,7 @@ namespace Q1Emu; public class DisplayEngine : Game { private readonly Action _onScreenTextureLoaded; + private readonly Action _requestUpdate; private GraphicsDeviceManager _graphics; private SpriteBatch _spriteBatch; @@ -18,12 +19,13 @@ public class DisplayEngine : Game public int Width { get; } public int Height { get; } - public DisplayEngine(int width, int height, int scaling, Action onScreenTextureLoaded) + public DisplayEngine(int width, int height, int scaling, Action onScreenTextureLoaded, Action requestUpdate) { this.Width = width; this.Height = height; this.Scaling = scaling; this._onScreenTextureLoaded = onScreenTextureLoaded; + this._requestUpdate = requestUpdate; _graphics = new GraphicsDeviceManager(this); Content.RootDirectory = "Content"; @@ -61,6 +63,8 @@ public class DisplayEngine : Game { GraphicsDevice.Clear(Color.CornflowerBlue); + this._requestUpdate(); + _spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.NonPremultiplied, SamplerState.PointClamp, DepthStencilState.None, RasterizerState.CullNone); // Draw the texture to the screen _spriteBatch.Draw(_texture, new Rectangle(0, 0, Width * Scaling, Height * Scaling), Color.White); -- cgit v1.3.1