From 1869e2b7287e71b02609096267f640fab7ec5ff1 Mon Sep 17 00:00:00 2001 From: ParantezTech <12572227+par274@users.noreply.github.com> Date: Thu, 8 Oct 2026 02:52:53 +0300 Subject: [PATCH] [VideoOut] Allow a hidden presenter window --- src/SharpEmu.Libs/VideoOut/SdlHostWindow.cs | 8 +++++++- src/SharpEmu.Libs/VideoOut/VulkanVideoPresenter.cs | 5 +++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/SharpEmu.Libs/VideoOut/SdlHostWindow.cs b/src/SharpEmu.Libs/VideoOut/SdlHostWindow.cs index 8f6ff76..ef7eb5a 100644 --- a/src/SharpEmu.Libs/VideoOut/SdlHostWindow.cs +++ b/src/SharpEmu.Libs/VideoOut/SdlHostWindow.cs @@ -54,7 +54,8 @@ internal sealed unsafe class SdlHostWindow : IDisposable, IHostGamepadOutput string title, HostVideoOptions options, SdlGraphicsApi graphicsApi, - Action? toggleBackendHud = null) + Action? toggleBackendHud = null, + bool hidden = false) { _options = options.Normalize(); _graphicsApi = graphicsApi; @@ -81,6 +82,11 @@ internal sealed unsafe class SdlHostWindow : IDisposable, IHostGamepadOutput } _baseTitle = title; + if (hidden) + { + return; + } + PerfOverlay.Configure(_options); MoveToConfiguredDisplay(); ApplyConfiguredMode(_options.WindowMode); diff --git a/src/SharpEmu.Libs/VideoOut/VulkanVideoPresenter.cs b/src/SharpEmu.Libs/VideoOut/VulkanVideoPresenter.cs index c9a8d52..3c4e00c 100644 --- a/src/SharpEmu.Libs/VideoOut/VulkanVideoPresenter.cs +++ b/src/SharpEmu.Libs/VideoOut/VulkanVideoPresenter.cs @@ -253,7 +253,7 @@ internal static unsafe partial class VulkanVideoPresenter private const ulong SwapchainAcquireTimeoutNs = 250_000_000; - public Presenter(uint width, uint height) + public Presenter(uint width, uint height, bool hidden = false) { _commandStream = new CommandStreamQueue(this); _relay = new GpuWorkerRelay(WakeRenderThread, _commandStream.TryEnqueueControlBarrier); @@ -263,7 +263,8 @@ internal static unsafe partial class VulkanVideoPresenter _window = new SdlHostWindow( VideoOutExports.GetWindowTitle(), _videoOptions, - SdlGraphicsApi.Vulkan); + SdlGraphicsApi.Vulkan, + hidden: hidden); } public void Run()