fix sdl2 dependency

This commit is contained in:
nek0 2018-03-17 02:49:16 +01:00
parent 0f2a7a549b
commit c57046ca3b
3 changed files with 5 additions and 4 deletions

View file

@ -101,7 +101,7 @@ library
ghc-options: -Wall
-- Other library packages from which modules are imported.
build-depends: base >=4.9 && < 5
, sdl2
, sdl2 >= 2.4 && < 2.5
, linear
, text
, mtl

View file

@ -35,6 +35,7 @@ data WindowMessage
| MsgWindowSizeChange
{ msgWSCWhen :: Double
, msgWSCWindow :: SDL.Window
, msgWRNewSize :: V2 Int32
}
| MsgWindowMinimize
{ msgWMinWhen :: Double
@ -77,7 +78,7 @@ instance Message WindowMessage where
msgTime (MsgWindowExpose t _) = t
msgTime (MsgWindowMove t _ _) = t
msgTime (MsgWindowResize t _ _) = t
msgTime (MsgWindowSizeChange t _) = t
msgTime (MsgWindowSizeChange t _ _) = t
msgTime (MsgWindowMinimize t _) = t
msgTime (MsgWindowMaximize t _) = t
msgTime (MsgWindowRestore t _) = t

View file

@ -48,8 +48,8 @@ consumeSDLWindowEvents aw = doConsume
SDL.WindowResizedEvent (SDL.WindowResizedEventData window newSize) -> do
partEmit aw (MsgWindowResize ts window newSize)
doConsume es
SDL.WindowSizeChangedEvent (SDL.WindowSizeChangedEventData window) -> do
partEmit aw (MsgWindowSizeChange ts window)
SDL.WindowSizeChangedEvent (SDL.WindowSizeChangedEventData window size) -> do
partEmit aw (MsgWindowSizeChange ts window size)
doConsume es
SDL.WindowMinimizedEvent (SDL.WindowMinimizedEventData window) -> do
partEmit aw (MsgWindowMinimize ts window)