From df451dbe38c76904e72fa64144a2f9c944794f24 Mon Sep 17 00:00:00 2001 From: Adrian Conlon Date: Fri, 28 Aug 2026 22:38:47 +0100 Subject: [PATCH] Some more consistency tidying --- Gaming/Game.cs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/Gaming/Game.cs b/Gaming/Game.cs index e28cf89..991f067 100644 --- a/Gaming/Game.cs +++ b/Gaming/Game.cs @@ -12,7 +12,6 @@ public abstract class Game(SDL.LogPriority logging) : Device { private readonly Wrapper _wrapper = new(logging); - private readonly SDL.PixelFormat _pixelType = SDL.PixelFormat.ARGB8888; private bool _vsync; private readonly SortedDictionary _gameControllers = []; @@ -23,7 +22,7 @@ protected ScopedHandle BitmapTexture { get; } = new(SDL.DestroyTexture); - protected IntPtr PixelFormat { get; private set; } = IntPtr.Zero; + protected abstract SDL.PixelFormat PixelFormat { get; } public abstract float FramesPerSecond { get; } @@ -99,9 +98,6 @@ Wrapper.MaybeThrowException(success, "Unable to set event loop callback rate hint"); } - this.PixelFormat = SDL.GetPixelFormatDetails(this._pixelType); - Wrapper.MaybeThrowException(this.PixelFormat, "Unable to obtain pixel format details"); - this.ConfigureBackground(); this.CreateBitmapTexture(); } @@ -122,7 +118,7 @@ private void CreateBitmapTexture() { - BitmapTexture.Handle = SDL.CreateTexture(this.Renderer, this._pixelType, SDL.TextureAccess.Streaming, this.RasterWidth, this.RasterHeight); + BitmapTexture.Handle = SDL.CreateTexture(this.Renderer, this.PixelFormat, SDL.TextureAccess.Streaming, this.RasterWidth, this.RasterHeight); Wrapper.MaybeThrowException(BitmapTexture, "Unable to create bitmap texture"); }