Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot select 4K resolution (3840x2160) in Options -> Display menu #200

Open
Apteryks opened this issue Oct 21, 2024 · 6 comments
Open

Cannot select 4K resolution (3840x2160) in Options -> Display menu #200

Apteryks opened this issue Oct 21, 2024 · 6 comments

Comments

@Apteryks
Copy link
Contributor

Hi,

The list of available resolutions to choose from somehow does not include my native 4K resolution of 3840x2160. The highest one that is made available by the game is 2560x1600, and this doesn't work very well in fullscreen (the game appears in the lower left corner of my screen, and selecting menus with the mouse is erratic).

My understanding is that SDL2 should be responsible for providing the available supported resolutions? Any tip to debug this and hopefully fix it?

Thank you.

@Apteryks
Copy link
Contributor Author

Apteryks commented Oct 21, 2024

If I manually edit the ~/.vdrift/VDrift.config file to have resolution = 3840,2160, it gets lowered to 800x600 at run time.

EDIT: That does not appear to be true; after deleting the ~/.vdrift/startingup.txt and retrying, I got a window set to 3840,2160 correctly. The resulotion shown in the Options -> Display screen still tops at 2560x1600, though.

@Apteryks
Copy link
Contributor Author

At least the SDL_GetDesktopDisplayMode call returns the correct values:

(gdb) p desktop_mode
$11 = {format = 370546692, w = 3840, h = 2160, refresh_rate = 60, driverdata = 0x7f2b70}
(gdb) bt
#0  Window::ChangeDisplay (this=0x7fffffff1b50, width=800, height=600, depth_bpp=24, antialiasing=0, fullscreen=false, vsync=false, gl3_core=true, info_output=..., error_output=...) at src/window.cpp:204
#1  0x00000000006aecaa in Window::Init (this=0x7fffffff1b50, caption=..., resx=800, resy=600, depth_bpp=24, antialiasing=0, fullscreen=false, vsync=false, info_output=..., error_output=...) at src/window.cpp:70
#2  0x0000000000496aba in Game::InitCoreSubsystems (this=0x7fffffff1500) at src/game.cpp:329
#3  0x00000000004956e0 in Game::Start (this=0x7fffffff1500, args=...) at src/game.cpp:153
#4  0x000000000061a795 in main (argc=2, argv=0x7fffffffc2e8) at src/main.cpp:71

@Apteryks Apteryks changed the title Cannot select 4K resolution (3840x2160) Cannot select 4K resolution (3840x2160) in Options -> Display menu Oct 21, 2024
@Apteryks
Copy link
Contributor Author

Apteryks commented Oct 21, 2024

Ah, it appears this is not a problem in the code, but of the hard-coded list that comes with the latest vdrift-data (settings/options.config):

[ display.resolution ]
desc = Change the resolution of your screen.
type = string
default = 800,600
values = list
num_vals = 21
opt00 = 640 x 480
val00 = 640,480
opt01 = 800 x 480
val01 = 800,480
opt02 = 800 x 600
val02 = 800,600
opt03 = 1024 x 768
val03 = 1024,768
opt04 = 1152 x 720
val04 = 1152,720
opt05 = 1152 x 864
val05 = 1152,864
opt06 = 1280 x 720
val06 = 1280,720
opt07 = 1280 x 768
val07 = 1280,768
opt08 = 1280 x 800
val08 = 1280,800
opt09 = 1280 x 960
val09 = 1280,960
opt10 = 1280 x 1024
val10 = 1280,1024
opt11 = 1360 x 768
val11 = 1360,768
opt12 = 1366 x 768
val12 = 1366,768
opt13 = 1440 x 900
val13 = 1440,900
opt14 = 1600 x 900
val14 = 1600,900
opt15 = 1600 x 1200
val15 = 1600,1200
opt16 = 1680 x 1050
val16 = 1680,1050
opt17 = 1920 x 1080
val17 = 1920,1080
opt18 = 1920 x 1200
val18 = 1920,1200
opt19 = 2560 x 1440
val19 = 2560,1440
opt20 = 2560 x 1600
val20 = 2560,1600

@Apteryks
Copy link
Contributor Author

I came up with the following patch, and can now select my 4K resolution correctly:

Index: vdrift-data/settings/options.config
===================================================================
--- vdrift-data/settings/options.config	(revision 1460)
+++ vdrift-data/settings/options.config	(working copy)
@@ -316,7 +316,7 @@
 type = string
 default = 800,600
 values = list
-num_vals = 21
+num_vals = 22
 opt00 = 640 x 480
 val00 = 640,480
 opt01 = 800 x 480
@@ -359,6 +359,8 @@
 val19 = 2560,1440
 opt20 = 2560 x 1600
 val20 = 2560,1600
+opt21 = 3840 x 2160
+val21 = 3840,2160
 
 [ display.shadow_distance ]
 desc = Set the distance at which shadows become visible

Please apply it to the SVN repository :-).

@logzero
Copy link
Member

logzero commented Oct 21, 2024

Data updated.

I think I'll add runtime resolution enumeration (probably this weekend).

@Apteryks
Copy link
Contributor Author

That would be great (runtime resolution enumeration); I was wondering if that would be easy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants