Debian Codegraph @

examples/user_interface/screen_resolution_change/README.md

raw symbols SCIP
1 # Test Changing Screen Resolutions
2
3 Test changing physical screen resolution using `Application.TryVideoChange`.
4
5 This changes actual monitor resolution, and makes sense for full-screen games.
6
7 ![Screenshot](screenshot.png)
8
9 ## Warning
10
11 Avoid changing the physical screen resolution, in short. Reasons:
12
13 - It is not a nice user experience (despite many games offering this feature):
14
15 - _Alt+Tab_ between the game and other applications means that system either needs to change resolutions (delay and blinking when _Alt+Tab_), or shows other applications in non-standard resolution.
16
17 - It is easy to leave system with non-default resolution upon application exit, by mistake. Or when the game crashes.
18
19 - It is up to the monitor how it handles resolutions that are allowed, but do not match the optimal monitor resolution. The display may be stretched non-uniformly or show black borders.
20
21 - Note: [Godot game engine](https://docs.godotengine.org/en/stable/tutorials/rendering/multiple_resolutions.html) has similar notes discouraging changing resolution.
22
23 - It is not implemented everywhere in our engine. It is right now implemented only for WinAPI (default Windows backend) and Xlib (non-default Unix backend). It is impossible to ever be implemented on some platforms (like mobile).
24
25 Moreover, we miss something like `EnumerateScreenConfigurations` right now, to show to a user a list of available resolutions that matches user's possible resolution. Note that it would be monitor-specific for multi-monitor setups.
26
27 If you want is to easily design a game that works on all possible resolutions then use our UI scaling. This is configurable in `CastleSettings.xml`. See [UI scaling and CastleSettings.xml docs](https://castle-engine.io/manual_castle_settings.php). It doesn't require changing the physical screen resolution, yet allows you to design your game for a particular resolution and it will look good everywhere.
28
29 ## Building
30
31 Using [Castle Game Engine](https://castle-engine.io/).
32
33 Compile by:
34
35 - [CGE editor](https://castle-engine.io/editor). Just use menu items _"Compile"_ or _"Compile And Run"_.
36
37 - Or use [CGE command-line build tool](https://castle-engine.io/build_tool). Run `castle-engine compile` in this directory.
38
39 - Or use [Lazarus](https://www.lazarus-ide.org/). Open in Lazarus `screen_resolution_change_standalone.lpi` file and compile / run from Lazarus. Make sure to first register [CGE Lazarus packages](https://castle-engine.io/lazarus).
40
41 - Or use [Delphi](https://www.embarcadero.com/products/Delphi). Open in Delphi `screen_resolution_change_standalone.dproj` file and compile / run from Delphi. See [CGE and Delphi](https://castle-engine.io/delphi) documentation for details.