SDL 2.0 retina mac

后端 未结 2 682
抹茶落季
抹茶落季 2021-01-02 10:13

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 cod

相关标签:
2条回答
  • 2021-01-02 10:54

    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().

    0 讨论(0)
  • 2021-01-02 10:59

    Right now, SDL doesn't support retina displays on Macs (or High-DPI displays on Windows machines).

    There is discussion about how best to add these features, and a few prototype patches on SDL's bug tracker, here: https://bugzilla.libsdl.org/show_bug.cgi?id=1934

    Presumably we'll see official retina support in a future release of SDL2. Or if you're willing to compile your own SDL libraries, those patches work for me.

    0 讨论(0)
提交回复
热议问题