How does GZDoom enumerate monitors in Linux?

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

Moderator: GZDoom Developers

Forum rules
Contrary to popular belief, we are not all-knowing-all-seeing magical beings!

If you want help you're going to have to provide lots of info. Like what is your hardware, what is your operating system, what version of GZDoom/LZDoom/whatever you're using, what mods you're loading, how you're loading it, what you've already tried for fixing the problem, and anything else that is even remotely relevant to the problem.

We can't magically figure out what it is if you're going to be vague, and if we feel like you're just wasting our time with guessing games we will act like that's what you're really doing and won't help you.
Post Reply
User avatar
youda008
Posts: 50
Joined: Wed May 01, 2019 8:15 am

How does GZDoom enumerate monitors in Linux?

Post by youda008 »

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
GZDoom-monitors.png (3.06 KiB) Viewed 809 times
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?
_mental_
 
 
Posts: 3820
Joined: Sun Aug 07, 2011 4:32 am

Re: How does GZDoom enumerate monitors in Linux?

Post by _mental_ »

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.
User avatar
youda008
Posts: 50
Joined: Wed May 01, 2019 8:15 am

Re: How does GZDoom enumerate monitors in Linux?

Post by youda008 »

So i open GZDoom sources and first thing i see is

Code: Select all

	// 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
_mental_
 
 
Posts: 3820
Joined: Sun Aug 07, 2011 4:32 am

Re: How does GZDoom enumerate monitors in Linux?

Post by _mental_ »

Taking into account that the mentioned code is Windows-specific, it has nothing to do with display enumeration on Linux.
Post Reply

Return to “Technical Issues”