Wrap the display globals in a struct (#16998)

* Wrap the display globals in a struct

Makes it easier to search/replace these, for future refactorings.

* Some renaming

* Qt buildfix, also fix the Qt build on Mac (got broken with battery changes)

* Attempt at buildfixing ios

* UWP buildfix
This commit is contained in:
Henrik Rydgård authored and GitHub committed 2023-02-25 13:09:44 +01:00
1 parent 3e98d313a8
commit 8b431b39ba
48 files changed
+319 -313

No files matched your search

+2 -18
View File
@@ -1,27 +1,11 @@
#include "Common/System/Display.h"
#include "Common/Math/math_util.h"
int dp_xres;
int dp_yres;
int pixel_xres;
int pixel_yres;
float g_dpi = 1.0f; // will be overwritten with a value that makes sense.
float g_dpi_scale_x = 1.0f;
float g_dpi_scale_y = 1.0f;
float g_dpi_scale_real_x = 1.0f;
float g_dpi_scale_real_y = 1.0f;
float pixel_in_dps_x = 1.0f;
float pixel_in_dps_y = 1.0f;
float display_hz = 60.0f;
DisplayRotation g_display_rotation;
Lin::Matrix4x4 g_display_rot_matrix = Lin::Matrix4x4::identity();
DisplayProperties g_display;
template<class T>
void RotateRectToDisplayImpl(DisplayRect<T> &rect, T curRTWidth, T curRTHeight) {
switch (g_display_rotation) {
switch (g_display.rotation) {
case DisplayRotation::ROTATE_180:
rect.x = curRTWidth - rect.w - rect.x;
rect.y = curRTHeight - rect.h - rect.y;