I have been playing around with SDL 2.0 but after searching I haven't found anything online about how to support retina macs. When creating a window using the following code.
gWindow = SDL_CreateWindow("SDL Tutorial", SDL_WINDOWPOS_UNDEFINED,
SDL_WINDOWPOS_UNDEFINED, 500, 500, SDL_WINDOW_SHOWN);
It creates a window that has an actual size of 1000 * 1000. This isn't really an issue because it's how apps are supposed to work using a hidpi screen. However, when loading images I can't seem to find a way to load images that are 2x as big for retina screens and my images always look blurry.
Current versions of SDL2 have support for retina.
To create a retina window, pass a flag SDL_WINDOW_ALLOW_HIGHDPI
into SDL_CreateWindow()
.
After a resize event, you can check the actual buffer resolution with the API call SDL_GL_GetDrawableSize()
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With