Add frame clock

This commit is contained in:
2021-09-09 13:29:09 +01:00
parent a2288110ae
commit be7b2d2cd7
27 changed files with 176 additions and 87 deletions
+5 -1
View File
@@ -65,9 +65,13 @@ handleResizeEvent :: WindowSizeChangedEventData -> World -> Maybe World
handleResizeEvent sev w = Just
. set (config . windowX) (fromIntegral x)
. set (config . windowY) (fromIntegral y)
$ over sideEffects (pdataResizeUpdate (x `div` divRes) (y `div` divRes) x y : )
$ over sideEffects up
w
where
up :: (World -> IO World) -> World -> IO World
up f w' = do
pdata <- pdataResizeUpdate (x `div` divRes) (y `div` divRes) x y (_preloadData w')
f $ w' & preloadData .~ pdata
x = fromIntegral x'
y = fromIntegral y'
V2 x' y' = windowSizeChangedEventSize sev