From b7919fc3ddbe0cad9739161b697bfd62bb12f10a Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Wed, 26 Aug 2026 13:22:10 +0200 Subject: [PATCH] Fix warnings when running on `null` renderer --- Source/Engine/Render2D/FontTextureAtlas.cpp | 2 +- Source/Engine/UI/GUI/RenderOutputControl.cs | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Source/Engine/Render2D/FontTextureAtlas.cpp b/Source/Engine/Render2D/FontTextureAtlas.cpp index 07af69556..ec662c0d4 100644 --- a/Source/Engine/Render2D/FontTextureAtlas.cpp +++ b/Source/Engine/Render2D/FontTextureAtlas.cpp @@ -222,7 +222,7 @@ void FontTextureAtlas::Flush() void FontTextureAtlas::EnsureTextureCreated() const { - if (_texture->IsAllocated() == false) + if (_texture->IsAllocated() == false && GPUDevice::Instance->GetRendererType() != RendererType::Null) { // Initialize atlas texture if (_texture->Init(GPUTextureDescription::New2D(_width, _height, 1, _format, GPUTextureFlags::ShaderResource))) diff --git a/Source/Engine/UI/GUI/RenderOutputControl.cs b/Source/Engine/UI/GUI/RenderOutputControl.cs index 8dc6707bf..9c05e5f98 100644 --- a/Source/Engine/UI/GUI/RenderOutputControl.cs +++ b/Source/Engine/UI/GUI/RenderOutputControl.cs @@ -220,7 +220,9 @@ namespace FlaxEngine.GUI width = _customResolution.Value.X; height = _customResolution.Value.Y; } - if (_backBuffer == null || _backBuffer.Width == width && _backBuffer.Height == height) + if (_backBuffer == null || (_backBuffer.Width == width && _backBuffer.Height == height)) + return; + if (GPUDevice.Instance.RendererType == RendererType.Null) return; if (width < 1 || height < 1) {