Page 1 of 2

[patch] Display Scaling, Window Resizing, High DPI support

Posted: 27 Jan 2018, 03:58
by pastdue
For those who are interested, a patch / PR is now available that adds support for:
  • Display Scaling (100%+)
  • Live Window Resizing (without restarting Warzone)
  • Automatic High-DPI display support (on macOS)
See here for more details: https://github.com/Warzone2100/warzone2100/pull/113

If you have a high-DPI display and are tired of Warzone's interface appearing tiny, Display Scaling is for you. (Available in the Video options menu.)

You can also now resize the Warzone window by dragging the edges / corners (as supported by your OS) or by changing the setting in the Video options menu (without restarting Warzone). (A small caveat: live resizing isn't currently possible while in a multiplayer game, nor when changing video mode - i.e. windowed <-> fullscreen. More details in the Github PR.)

Comments, feedback, etc. greatly appreciated.

Areas of focus for testing:
  • Can you find any remaining UI elements that don't properly recalculate their layout when the window is resized?
  • Any glitches when enabling Display Scaling?
  • Benchmarking 100% Display Scale vs the prior `master` build on your system (particularly: FPS / CPU usage / performance improvement comparisons).

Re: [patch] Display Scaling, Window Resizing, High DPI suppo

Posted: 28 Jan 2018, 11:39
by Prot
I have some FPS boost, and on the fly resized game main window, WOW!
Latest master:
wz2100-master-e2a4e25aca48315af35f4156dcfd0759985e7547.png
After you patch:
wz2100-113.png
Tested at Arch Linux
OpenGL renderer string: AMD Radeon R7 M260DX
OpenGL core profile version string: 4.5.13416 Core Profile Context 15.302
OpenGL core profile shading language version string: 4.40


Tomorrow I'll play around with DPI on a 4k screen.

Re: [patch] Display Scaling, Window Resizing, High DPI suppo

Posted: 28 Jan 2018, 12:54
by Terminator
Would love to see an installer build. or just warzone2100.exe file

Re: [patch] Display Scaling, Window Resizing, High DPI suppo

Posted: 28 Jan 2018, 20:10
by pastdue
Prot wrote:I have some FPS boost, and on the fly resized game main window, WOW!
Excellent!
Prot wrote:Tomorrow I'll play around with DPI on a 4k screen.
Because of current SDL limitations, automatic high-DPI support is only available on macOS at the moment.

However, you should be able to manually use the "Display Scale" option in the Video options menu to achieve the same thing. Let me know how it works for you.

Re: [patch] Display Scaling, Window Resizing, High DPI suppo

Posted: 29 Jan 2018, 15:57
by Prot
I love this path!
Plying on Debian 8 on Nvidia 680 GTX
This is fix "strange camera" in UHD, i post about it before very long ago. Don't know what to call it, this is similar to the effect of "fish eye" and your patch fixes it.
(This forum refuses to take pictures)
Lastest master:
Image

After patch:
Image

Lastest master:
Image

After patch:
Image

Several games in one screen ^^
Image
Image

I also trying livestream to youtube in UHD https://www.youtube.com/watch?v=z_zZYJSbiOE
But it seems that either YouTube does not keep up, or the encoder

Re: [patch] Display Scaling, Window Resizing, High DPI suppo

Posted: 06 Feb 2018, 10:33
by Per
We finally got buildbot to produce Windows executables for this patch: http://buildbot.wz2100.net/files/warzon ... 3a0a40.exe

Please see if it works!

Re: [patch] Display Scaling, Window Resizing, High DPI suppo

Posted: 06 Feb 2018, 11:47
by Prot
Per wrote:We finally got buildbot to produce Windows executables for this patch: http://buildbot.wz2100.net/files/warzon ... 3a0a40.exe

Please see if it works!
Work fine for me.

Resizing on the fly!
2018-02-06 (4).png
2018-02-06 (1).png

Re: [patch] Display Scaling, Window Resizing, High DPI suppo

Posted: 06 Feb 2018, 20:18
by Berserk Cyborg
Conditions
Map: MizaMaze advanced bases
1 minute test time
All AI are Nexus
texture size = 2048
antialiasing = 2x
windowed @ 1024x768

Master
fps, vertical sync OFF: ~100 (jumps around 97-103)
fps, vertical sync ON: ~28 (jumps around 23-31)
fps, vertical sync ON, shadows: ~28 (jumps around 15-28)

Display scaling patch
fps, vertical sync OFF: ~173 (jumps around 163-188) :bow2:
fps, vertical sync ON: ~25 (jumps around 23-29)
fps, vertical sync ON, shadows: ~23 (jumps around 21-28)

Overall, vertical sync is for suckers.

Re: [patch] Display Scaling, Window Resizing, High DPI suppo

Posted: 10 Feb 2018, 01:07
by trevormanaze
resizing DPI taking over lobby.

Are these actual games or open sessions that cannot be closed?

Re: [patch] Display Scaling, Window Resizing, High DPI suppo

Posted: 10 Feb 2018, 08:35
by Prot
trevormanaze wrote:resizing DPI taking over lobby.

Are these actual games or open sessions that cannot be closed?
I see this master server bug before.
I think this is master server problem, not a patch.
Also those games still listed on master server, i see on my monitor http://wz2100.euphobos.ru/

Re: [patch] Display Scaling, Window Resizing, High DPI suppo

Posted: 11 Feb 2018, 16:33
by Bethrezen
Guys think you need to check the changes you made to build bot because master wont load for me.

Just updated to the latest version
warzone2100-master-20180211-143024-e02cc41.exe (11-Feb-2018 13:58)
and when I try to start it I'm getting the following error

Image

The problem is that is a Vista DLL apparently and I'm running XP, so the question is why is master looking for a Vista dependency ?

The last 2 builds have also exhibited this problem the last build that i have that works for me is warzone2100-master-20180204-051309-ab17b9b.exe

so can someone check this out please.

Re: [patch] Display Scaling, Window Resizing, High DPI suppo

Posted: 12 Feb 2018, 06:45
by Prot
Also in debian 8 i try to ./configure and it is pass, but i have only SDL 2.0.2 instead 2.0.4
Somewhere need set dependency to 2.0.4, because make ends with errors

Code: Select all

main_sdl.cpp: In function ‘bool wzChangeWindowResolution(int, unsigned int, unsigned int)’:
main_sdl.cpp:1518:49: error: ‘SDL_GetDisplayUsableBounds’ was not declared in this scope
   if (SDL_GetDisplayUsableBounds(screen, &bounds) != 0) {
                                                 ^
main_sdl.cpp: In function ‘void wzGetWindowToRendererScaleFactor(float*, float*)’:
main_sdl.cpp:1948:59: error: ‘SDL_GetDisplayDPI’ was not declared in this scope
  if (SDL_GetDisplayDPI(displayIndex, nullptr, &hdpi, &vdpi) < 0)
                                                           ^
main_sdl.cpp: In function ‘void wzSetWindowIsResizable(bool)’:
main_sdl.cpp:1994:48: error: ‘SDL_SetWindowResizable’ was not declared in this scope
  SDL_SetWindowResizable(WZwindow, sdl_resizable);
                                                ^
Makefile:435: ошибка выполнения рецепта для цели «main_sdl.o»
make[2]: *** [main_sdl.o] Ошибка 1
When i install SDL 2.0.4 it's all fine, but problem that in configure stage is passed.

Re: [patch] Display Scaling, Window Resizing, High DPI suppo

Posted: 12 Feb 2018, 08:57
by pastdue
Prot wrote:Also in debian 8 i try to ./configure and it is pass, but i have only SDL 2.0.2 instead 2.0.4
Somewhere need set dependency to 2.0.4, because make ends with errors.
This was due a temporary workaround for the buildbot (ef82d4815beb0007c9b12a25b216d5ae3989fcb6) that was pushed to the master branch. Research is underway for a proper long-term fix that works with the cross-compiling buildbot and properly enforces the minimum SDL version requirement.

Re: [patch] Display Scaling, Window Resizing, High DPI suppo

Posted: 12 Feb 2018, 11:30
by Forgon
Prot wrote:Also in debian 8 i try to ./configure and it is pass, but i have only SDL 2.0.2 instead 2.0.4
Somewhere need set dependency to 2.0.4, because make ends with errors [...]
So, is the dependency actually SDL 2.0.4 rather than SDL 2.0.5? I have been confused about that for a while.

Re: [patch] Display Scaling, Window Resizing, High DPI suppo

Posted: 12 Feb 2018, 19:39
by pastdue
According to the SDL docs (and when I briefly tried with SDL 2.0.4 by accident), the requirement for the new SDL APIs is SDL 2.0.5.