Properly handling HighDPI on MacOS with SDL and OpenGL

1k Views Asked by At

My attempts at High-DPI rendering on MacOS for my game, Bitfighter, always end up looking bad, like a scaled-up version of a low-res game.

The game uses SDL2 + OpenGL and I have correctly enabled the SDL_WINDOW_ALLOW_HIGHDPI window flag as well as making it HighDPI aware in the Info.plist. This all works and I get the higher-res title bar just fine. I use SDL_GL_GetDrawableSize and it correctly returns the 2x larger pixel size than the window size, but the following techniques to re-scale it don't yield good results:

  • Using glViewport using window coords
  • Using glViewport with drawable coords, then glOrtho to scale (as suggested in the SDL doc README-ios.md)

Both show pixely vector graphics. What can I do to get OpenGL to draw better with MacOS High-DPI?

Thanks.

0

There are 0 best solutions below