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

Discuss the future of Warzone 2100 with us.
pastdue
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 339
Joined: 13 Aug 2017, 17:44

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

Post 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).
User avatar
Prot
Trained
Trained
Posts: 242
Joined: 29 Nov 2010, 12:41

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

Post 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.
Last edited by Prot on 28 Jan 2018, 15:01, edited 1 time in total.
User avatar
Terminator
Regular
Regular
Posts: 1077
Joined: 05 Aug 2006, 13:46
Location: Ukraine
Contact:

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

Post by Terminator »

Would love to see an installer build. or just warzone2100.exe file
Death is the only way out... sh*t Happens !

Russian-speaking Social network Group http://vk.com/warzone2100
pastdue
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 339
Joined: 13 Aug 2017, 17:44

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

Post 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.
User avatar
Prot
Trained
Trained
Posts: 242
Joined: 29 Nov 2010, 12:41

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

Post 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
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

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

Post 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!
User avatar
Prot
Trained
Trained
Posts: 242
Joined: 29 Nov 2010, 12:41

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

Post 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
User avatar
Berserk Cyborg
Code contributor
Code contributor
Posts: 938
Joined: 26 Sep 2016, 19:56

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

Post 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.
trevormanaze
Trained
Trained
Posts: 86
Joined: 18 Nov 2015, 04:21

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

Post by trevormanaze »

resizing DPI taking over lobby.

Are these actual games or open sessions that cannot be closed?
Attachments
wz2100-20180209_150443-main.jpg
User avatar
Prot
Trained
Trained
Posts: 242
Joined: 29 Nov 2010, 12:41

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

Post 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/
Bethrezen
Regular
Regular
Posts: 661
Joined: 25 Sep 2009, 02:05

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

Post 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.
User avatar
Prot
Trained
Trained
Posts: 242
Joined: 29 Nov 2010, 12:41

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

Post 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.
pastdue
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 339
Joined: 13 Aug 2017, 17:44

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

Post 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.
Forgon
Code contributor
Code contributor
Posts: 298
Joined: 07 Dec 2016, 22:23

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

Post 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.
pastdue
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 339
Joined: 13 Aug 2017, 17:44

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

Post 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.
Post Reply