Add basic OpenGL DPI Scaling

This commit is contained in:
Riley S
2021-02-23 20:45:48 -05:00
parent 373f8399cd
commit fe9b2c32ee
4 changed files with 29 additions and 5 deletions

View File

@@ -216,8 +216,10 @@ cameraSync(ObjectWithFrame *obj)
inv.at.x = -inv.at.x;
inv.pos.x = -inv.pos.x;
float32 xscl = 1.0f/(2.0f*cam->viewWindow.x);
float32 yscl = 1.0f/(2.0f*cam->viewWindow.y);
V2d dpiScale = engine->device.dpiScale(cam->frameBuffer->width, cam->frameBuffer->height);
float32 xscl = 1.0f/(2.0f*cam->viewWindow.x*dpiScale.x);
float32 yscl = 1.0f/(2.0f*cam->viewWindow.y*dpiScale.y);
proj.flags = 0;
proj.right.x = xscl;