~jack/misc

fb9ba93fbc5c264940b01bb45fe8d69728973bfb — Jack Kelly 7 months ago ab60c0c
Stop using MonadSample
1 files changed, 4 insertions(+), 5 deletions(-)

M consengine/src/App.hs
M consengine/src/App.hs => consengine/src/App.hs +4 -5
@@ 155,7 155,7 @@ guest window manager = do
        Just prog -> pure $ zip vaos vertexBuffers <&> \(vao, (_, size)) ->
          Draw prog vao (Map.fromList [("proj", Mat4 ==> matrix)]) GL_TRIANGLE_FAN 0 size

  performEvent_ $ eTick $> draw window bDraws
  draw window $ bDraws <@ eTick

  pure quitE



@@ 202,12 202,11 @@ pumpInput window fireQuit fireInput = liftIO $ do
      readRef keysR >>= \keys -> traverse_ fireInput (nonEmpty $ reverse keys)

draw
  :: (MonadIO m, MonadSample t m, Reflex t)
  :: (MonadIO m, PerformEvent t m, MonadIO (Performable m), Reflex t)
  => GLFW.Window
  -> Behavior t [Draw]
  -> Event t [Draw]
  -> m ()
draw win bDraws = do
  draws <- sample bDraws
draw win eDraws = performEvent_ $ eDraws <&> \draws ->
  liftIO $ do
    glClear $ GL_COLOR_BUFFER_BIT .|. GL_DEPTH_BUFFER_BIT
    for_ draws $ \(Draw prog vao uni prim start n) -> do