that_editor icon indicating copy to clipboard operation
that_editor copied to clipboard

Implemented high-DPI support

Open CobaltXII opened this issue 5 years ago • 0 comments

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

CobaltXII avatar Jan 22 '19 15:01 CobaltXII