haskell-game / sdl2

Haskell bindings to the SDL2 library
Other
363 stars 87 forks source link

add SDL_WINDOWPOS_CENTERED_DISPLAY_{0..15} #215

Closed nxths closed 4 years ago

nxths commented 4 years ago

This commit is to expose more multi-display support, e.g.

-- moves a window to the center of display 2
let SDL.Internal.Window rawWindow = window  -- (window :: SDL.Window)
SDL.Raw.setWindowPosition rawWindow SDL.Raw.SDL_WINDOWPOS_CENTERED_DISPLAY_2 SDL.Raw.SDL_WINDOWPOS_CENTERED_DISPLAY_2

Don't think pattern synonyms or #const allows implementing this more cleanly, so it is how it is. https://github.com/emscripten-ports/SDL2/blob/master/include/SDL_video.h#L137 suggests that SDL2 supports up to 16 displays, but I was only able to manually test up to 3 displays.