atsb / Doom64EX-Plus

An improved modern version of Doom64EX.
GNU General Public License v2.0
122 stars 17 forks source link

Resolution issue when Windows scaling is not 100% #144

Closed bubbleguuum closed 1 month ago

bubbleguuum commented 1 year ago

Version: 3.6.5.3 Windows Zip downloaded on 01/14/2023.

I use a 27" 4K with Windows set to 200% scaling (resulting in 1080p of desktop space).

Any resolution set in Doom64EX+ results in it being affected by Windows scaling, thus in my partiocular case, doubled. If for example I set 3840x2160 resolution, I endup with the game thinking it is in double that resolution in each direction resulting in on a 1/4 corner of the image shown. If I set it to 1920x1080, I get 3840x2160.

This can be worked-around with right click on Doom64EX+.exe > Properties > Compatibility > Change High DPI Settings, then changing "Override DPI scaling behavior" to "Application".

However, Doom64EX+ should not be affected by Windows scaling the way it is by default. Most other games are not, including the official Kex port.

atsb commented 1 year ago

I also have a HiDPI laptop screen. I just never used scaling. I tried fractional scaling to 150% (2K screen) and you're right, it is affected. I've added the flag 'SDL_WINDOW_ALLOW_HIGHDPI' and running at 2K is produces the correct resolution and not double. Only issue is, sub-HiDPI resolutions are not useful, but I doubt anyone is playing in 720p on a laptop that is capable of 2K anyway.

KEX is a totally different thing, as are most games. EX+ still inherits a lot of the very very old style of OpenGL rendering going on. You can't compare really.

Ill add this flag to the next build and we can see how it works for you.

bubbleguuum commented 1 year ago

Thanks for the fix, it will be less confusing for users having scaling enabled.

atsb commented 1 year ago

Definitely agree with that!

SumatraPeter commented 1 year ago

I came here to report this very issue; unbelievable that no-one reported it till Jan of this very year!

I set the resolution in Doom64EX+ to 1920x1080 to match my laptop's default (max) resolution, and couldn't for the life of me understand why the game was being displayed off center. No amount of googling for Doom64EX+ non-centering issues helped, and it really took me quite some time to figure out that the issue was due to Windows' default recommended 125% scaling on this machine.

image

Eventually I arrived at the same workaround that @bubbleguuum has mentioned above, but that isn't something everyone might be able to figure out independently. Really hope 3.6.6 comes out soon. Any ETA for it @atsb?

atsb commented 1 year ago

I'll do some experimentation

atsb commented 1 year ago

DOOM64EX+.zip

Does this build of the executable work for you?

SumatraPeter commented 1 year ago

@atsb: After turning off Application DPI scaling for the EXE, no change unfortunately.

Edit: Just to add, with Windowed mode Off the display is off center and scaled up, but with it On the display is centered but still scaled up (such that menu items etc. are getting chopped off). Enabling Application DPI scaling for the EXE of course fixes things, irrespective of what Windowed mode is set to.

atsb commented 1 year ago

I’ll have to see what I can do. I’ve enabled DPI scaling within SDL and forced it to scale as per DPI settings and pass those to OpenGL but it seems to ignore it completely, very strange.

SumatraPeter commented 1 year ago

Clearly (G)ZDoom and the like are doing something right, so maybe what they're doing might be applicable here as well?

@bubbleguuum: Does the new build work for you with Application DPI scaling for the EXE turned off first? Would be nice if someone could confirm that it's not just at my end that the new test executable is behaving the same as the 3.6.5.7 release.

atsb commented 1 year ago

Looking at GZDOOM code is useless. They don’t use SDL2 but OpenGL4.

bubbleguuum commented 1 year ago

@SumatraPeter Will test later today.

bubbleguuum commented 1 year ago

Confirming that the linked zip above does not fix the problem.

atsb commented 1 month ago

Done as much as I can with this.

bubbleguuum commented 1 month ago

Note that this issue is fixed since SDL3 and v4.0.0.0: the game starts properly scaled.

atsb commented 1 month ago

Thanks for letting me know, nice to see that they finally fixed SDL scaling properly!