Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented high-DPI support #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

CobaltXII
Copy link

This is done by initializing the SDL_Window with the SDL_WINDOW_ALLOW_HIGHDPI flag. Alone, that flag is not enough. So, I use SDL_GL_GetDrawableSize() to fetch the real size of the window. I then create two 'scaling factor' variables, one for each dimension. The 'scaling factor' variables are calculated by dividing the output of SDL_GL_GetDrawableSize by the original window size... i.e. pixels_width, pixels_height. Then, in the function SDL_ReDraw (by Bisqwit), the destination rectangle (trect) is scaled by the scaling factors, creating a smooth, crisp display on high-DPI monitors.
screen shot 2019-01-22 at 10 08 39 am

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant