mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-04-28 21:07:59 +03:00
Implement system-scaled HiDPI support (SDL_WINDOW_ALLOW_HIGHDPI - Wayland, macOS, etc)
This commit is contained in:
parent
622f906855
commit
1c8fd2ecdb
6 changed files with 56 additions and 14 deletions
|
@ -54,8 +54,13 @@ bool GraphicsWindowSDL2::setWindowRectangleImplementation(int x, int y, int widt
|
|||
{
|
||||
if(!mWindow) return false;
|
||||
|
||||
int w,h;
|
||||
SDL_GetWindowSize(mWindow, &w, &h);
|
||||
int dw,dh;
|
||||
SDL_GL_GetDrawableSize(mWindow, &dw, &dh);
|
||||
|
||||
SDL_SetWindowPosition(mWindow, x, y);
|
||||
SDL_SetWindowSize(mWindow, width, height);
|
||||
SDL_SetWindowSize(mWindow, width / (dw / w), height / (dh / h));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue