View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0004430 | The Dark Mod | Coding | public | 30.11.2016 20:36 | 01.04.2024 22:32 |
Reporter | duzenko | Assigned To | duzenko | ||
Priority | normal | Severity | normal | Reproducibility | have not tried |
Status | assigned | Resolution | open | ||
Product Version | SVN | ||||
Summary | 0004430: Allow TDM to run on non-primary monitors | ||||
Description | Currently TDM will always run on a primary Windows monitor. Owners of multi-monitor systems get used to be able to choose what program runs on what monitor. | ||||
Tags | graphics, settings, usability | ||||
Done (partially) for r_useFbo 1. Instructions: - TDM starts fullscreen on primary monitor - alt-enter and ` to open console - drag window to another monitor - alt-enter and ` to close console As for r_useFbo 0 I am confused by this code x = y = w = h = 0; ... SetWindowPos(win32.hWnd, parms.fullScreen ? HWND_TOPMOST : HWND_NOTOPMOST, x, y, w, h, parms.fullScreen ? SWP_NOSIZE | SWP_NOMOVE : SWP_SHOWWINDOW); Anyone who has a clue feel free to fix. |
|
The line you have trouble with can be decoded by: https://msdn.microsoft.com/en-us/library/windows/desktop/ms633545(v=vs.85).aspx That said, this is the most widely referred to solution: https://www.gamedev.net/forums/topic/455737-c-winapi-how-to-start-a-program-in-secondary-display-device/?PageSpeed=noscript The only method I found was to create the window and then move it to a location on the secondary screen before showing it. To do this you need to enumerate the display devices and get their 'virtual coordinates' so that you know where to move the window to. For example on my setup the virtual coordinates for my primary monitor would be (0,0) with a width of 1920 and height of 1200. My secondard monitor however, as it is to the left of my primary has the virtual coordinates of (-1920,0) and the same width and height. https://msdn.microsoft.com/en-us/library/windows/desktop/dd162610(v=vs.85).aspx |
|
Too close to 2.07 beta. Moving to 2.08 | |
Duplicate new issue 0006471 | |
Commenting because my duplicate issue was closed (sorry about that). DarkRadiant supports this feature - is it worth looking at how it's done there? |
|
As far as I understand, we should query monitors and get rectangle of each of them. Then we can set X,Y-position of the created window on the respective monitor. https://stackoverflow.com/questions/1834771/how-do-you-get-createwindowex-to-create-the-window-on-a-specific-monitor I suppose this should NOT apply in Windowed mode. |
|
Windows side is easy, but Linux has to match this function When I played with it originally I stopped on a workaround and not adding a regular GUI option because I couldn't test there |
|
It should be even easier on Linux because it uses GLFW: https://gamedev.stackexchange.com/questions/146810/how-can-i-execute-glfw-fullsceen-in-a-secondary-monitor-xorg The main question is: once someone implements this, who is ready to test and debug on each OS. |
|
I can test/debug for WIndows - I have 3 monitors in my setup. | |
Hmm. There is a cvar r_custommonitor that lets you choose the monitor number ( defaults to 0 AKA primary ) |
|
In which file? I can see r_customWidth/height, but not r_custommonitor anywhere | |
Do you have 2.12 or SVN installed? Darkmod.cfg has seta r_customMonitor "0" |
|
setting r_customMonitor in Darkmod.cfg does nothing. The game starts in the same monitor every time and the line gets removed from Darkmod.cfg after the game starts. Or am I doing it wrong? I just added this to the file: seta r_customMonitor "0" (or "1" or "2", etc) |
|
I wonder if it only works on Linux... | |
@nbohr1more Is Darkmod.cfg in source control though? I think it's your local file, no? |
|
I discovered the cvar by examining console results for r_ + tab. Yes it's Linux only: https://github.com/stgatilov/darkmod_src/blob/c1894aea31035904b3b32b0602b6d24d1ba75c4d/sys/linux/glimp.cpp#L23 static GLFWmonitor *GLimp_GetMonitor() { int count; GLFWmonitor **monitors = glfwGetMonitors( &count ); int requestedMonitor = r_customMonitor.GetInteger(); if ( requestedMonitor < 0 || requestedMonitor >= count ) { common->Printf( "Requested monitor %d not found, using primary monitor\n", requestedMonitor ); r_customMonitor.SetInteger( 0 ); return glfwGetPrimaryMonitor(); } return monitors[requestedMonitor]; } |
|
Oh, I get it now So this ticket will resolve when the Windows part moves to GLFW too |
|
Date Modified | Username | Field | Change |
---|---|---|---|
30.11.2016 20:36 | duzenko | New Issue | |
30.11.2016 20:36 | duzenko | Status | new => assigned |
30.11.2016 20:36 | duzenko | Assigned To | => duzenko |
01.12.2016 12:45 | duzenko | Note Added: 0008577 | |
01.12.2016 12:49 | duzenko | Relationship added | related to 0004402 |
19.09.2017 21:53 | nbohr1more | Note Added: 0009307 | |
06.10.2017 02:33 | nbohr1more | Target Version | TDM 2.06 => TDM 2.07 |
11.12.2018 05:11 | nbohr1more | Note Added: 0010870 | |
11.12.2018 05:12 | nbohr1more | Target Version | TDM 2.07 => TDM 2.08 |
22.03.2020 18:15 | duzenko | Target Version | TDM 2.08 => TDM 2.09 |
05.12.2020 12:41 | stgatilov | Product Version | SVN => TDM 2.06 |
05.12.2020 12:41 | stgatilov | Target Version | TDM 2.09 => |
28.01.2024 02:22 | nbohr1more | Relationship added | has duplicate 0006471 |
28.01.2024 02:24 | nbohr1more | Note Added: 0016448 | |
28.01.2024 02:24 | nbohr1more | Product Version | TDM 2.06 => SVN |
28.01.2024 09:23 | Frost_Salamander | Note Added: 0016454 | |
28.01.2024 09:41 | stgatilov | Note Added: 0016455 | |
28.01.2024 12:55 | duzenko | Note Added: 0016458 | |
28.01.2024 12:56 | duzenko | Note Edited: 0016458 | |
28.01.2024 16:48 | stgatilov | Note Added: 0016459 | |
28.01.2024 18:10 | Frost_Salamander | Note Added: 0016462 | |
28.03.2024 05:30 | nbohr1more | Note Added: 0016595 | |
30.03.2024 06:39 | duzenko | Note Added: 0016597 | |
30.03.2024 20:21 | nbohr1more | Note Added: 0016599 | |
30.03.2024 20:41 | Frost_Salamander | Note Added: 0016600 | |
31.03.2024 00:24 | nbohr1more | Note Added: 0016601 | |
31.03.2024 08:03 | duzenko | Note Added: 0016603 | |
31.03.2024 12:14 | nbohr1more | Note Added: 0016604 | |
31.03.2024 12:16 | nbohr1more | Note Edited: 0016604 | |
01.04.2024 05:54 | duzenko | Note Added: 0016609 | |
01.04.2024 22:32 | Fiver | Tag Attached: usability | |
01.04.2024 22:32 | Fiver | Tag Attached: settings | |
01.04.2024 22:32 | Fiver | Tag Attached: graphics |