flex-launcher icon indicating copy to clipboard operation
flex-launcher copied to clipboard

Fix output on secondary monitor by rendering via OpenGL

Open literallylara opened this issue 6 months ago • 2 comments

On my home server the primary screen is connected to a KVM and the secondary to my TV. With the standard settings (I assume it defaults to Vulkan then?) it renders a black screen on the secondary monitor. When compiled with SDL_WINDOW_OPENGL it works as expected.

I am starting flex-launcher via gamescope:

gamescope --hdr-enabled -W 1920 -H 1080 -O HDMI-A-2 -f -- flex-launcher

Possibly related: #45

literallylara avatar Jul 01 '25 19:07 literallylara

The SDL Renderer API is just high level abstraction for lower level graphics APIs, including OpenGL and Vulkan. The flag SDL_WINDOW_OPENGL is really meant for if you are going to draw directly using OpenGL, and just need SDL to create the context for you.

When using the SDL Renderer API, you can set an environment variable SDL_RENDER_DRIVER to instruct SDL which underlying graphics API should be used. For example, to force the OpenGL renderer, you can run Flex Launcher like so:

SDL_RENDER_DRIVER=opengl flex-launcher

Please try that and let me know the result.

complexlogic avatar Jul 11 '25 15:07 complexlogic

Hmm I see. Please excuse my lack of experience with SDL. The environment variable you suggested unfortunately did not seem to have any effect. Perhaps the issue lies with gamescope. Or perhaps there is a way to tell SDL which monitor/index to use. I will experiment some more when I find the time.

literallylara avatar Jul 12 '25 19:07 literallylara