engine: store scaling factor between physical and logical window size

This commit is contained in:
Alibek Omarov
2025-12-07 15:23:07 +03:00
parent 7e730cf171
commit a4431b5cfd
2 changed files with 8 additions and 1 deletions

View File

@@ -74,6 +74,9 @@ void R_SaveVideoMode( int w, int h, int render_w, int render_h, qboolean maximiz
if( refState.width == render_w && refState.height == render_h )
return;
refState.scale_x = (float)render_w / w;
refState.scale_y = (float)render_h / h;
refState.width = render_w;
refState.height = render_h;

View File

@@ -125,7 +125,7 @@ typedef struct ref_globals_s
{
qboolean developer;
// viewport width and height
// viewport width and height (physical window size)
int width;
int height;
@@ -144,6 +144,10 @@ typedef struct ref_globals_s
size_t visbytes; // cluster size
int desktopBitsPixel;
// scaling factor of physical window size compared to logical
float scale_x;
float scale_y;
} ref_globals_t;
typedef struct ref_client_s