How does GZDoom enumerate monitors in Linux?

Need help running G/Q/ZDoom/ECWolf/Zandronum/3DGE? Did your computer break? Ask here.

Moderator: GZDoom Developers

How does GZDoom enumerate monitors in Linux?

Postby youda008 » Sun Jan 24, 2021 3:15 am

Hello. I'm writing my own launcher of GZDoom mods and i would like to have an option to select a monitor to start GZDoom in by appending apropriate '+vid_adapter x' to the launch command.
GZDoom-monitors.png

This works fine in Windows, but is problematic in Linux.
I wrote some code that enumerates monitors using libXrandr, but the order of the monitors in the list is different from the order that GZDoom uses for its vid_adapter command,
which means when i select the first monitor from my list and start GZDoom with +vid_adapter 1, it starts on the second monitor and vice versa.
In order for this to work, i must use the exact same way of enumerating monitors as GZDoom so that the order in my launcher matches the order in GZDoom.
Can you please explain how it works?
You do not have the required permissions to view the files attached to this post.
User avatar
youda008
 
Joined: 01 May 2019

Re: How does GZDoom enumerate monitors in Linux?

Postby _mental_ » Sun Jan 24, 2021 3:59 am

You need take a look at SDL2 source code. GZDoom passes the value of vid_adapter CVAR to its functions as is. Also, the primary monitor should have zero index I think.
_mental_
 
 
 
Joined: 07 Aug 2011

Re: How does GZDoom enumerate monitors in Linux?

Postby youda008 » Sun Jan 24, 2021 4:15 am

So i open GZDoom sources and first thing i see is
Code: Select allExpand view
   // This assumes the monitors are returned by EnumDisplayMonitors in the
   // order they're found in the Direct3D9 adapters list. Fingers crossed...

:lol:
looks i'm not the only one fighting these issues
User avatar
youda008
 
Joined: 01 May 2019

Re: How does GZDoom enumerate monitors in Linux?

Postby _mental_ » Sun Jan 24, 2021 4:30 am

Taking into account that the mentioned code is Windows-specific, it has nothing to do with display enumeration on Linux.
_mental_
 
 
 
Joined: 07 Aug 2011


Return to Technical Issues

Who is online

Users browsing this forum: No registered users and 1 guest