graphics: rewrite auto-rotate and refresh rate options to be more reliable (#607)

## Description of change

Rotate monitor & change the refresh rate **well before** the game is
launched.

This is much faster and more reliable compared to what we do now, which
is trying to do monitor changes during CreateWindow hooks. For example,
SDVX makes a bunch of OS / NVAPI calls to figure out monitor geometry
while it's booting, and by the time CreateWindow is called, the game
already made up its mind, which leads to weird graphical issues.

This affects both windowed mode and full screen.

In addition, add options for normal orientation (landscape) and upside
down (landscape, flipped) options. This can be used if the monitor is
normally rotated to portrait, but the game needs to be in landscape.
This commit is contained in:
bicarus
2026-04-04 03:23:28 -07:00
committed by GitHub
parent e0f6cb2cbd
commit a4c3eddc2f
5 changed files with 133 additions and 102 deletions
+3
View File
@@ -15,6 +15,7 @@ enum graphics_orientation {
ORIENTATION_CW = 0,
ORIENTATION_CCW = 1,
ORIENTATION_NORMAL = 2,
ORIENTATION_FLIPPED = 3
};
enum graphics_dx9on12_state {
@@ -107,3 +108,5 @@ bool graphics_window_decoration_change_crashes_game();
bool graphics_window_resize_breaks_game();
bool graphics_window_move_and_resize_breaks_game();
void graphics_load_windowed_subscreen_parameters();
void update_monitor_on_boot();