From 459488a2e777380fcb65e3b4dd355fe525ff77ca Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Tue, 24 Dec 2024 22:28:38 +0530 Subject: Add search mode for text based searching with ocr --- src/Chelleport/AppShell.hs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/Chelleport/AppShell.hs') diff --git a/src/Chelleport/AppShell.hs b/src/Chelleport/AppShell.hs index ba31982..2e95a85 100644 --- a/src/Chelleport/AppShell.hs +++ b/src/Chelleport/AppShell.hs @@ -35,18 +35,19 @@ type EventHandler state appAction = state -> SDL.Event -> Maybe appAction type View m state = state -> m () -type Initializer m state = m state +type Initializer m state appAction = m (state, Maybe appAction) setupAppShell :: (MonadIO m) => DrawContext -> - Initializer m state -> + Initializer m state appAction -> Update m state appAction -> EventHandler state appAction -> View m state -> m () -setupAppShell (DrawContext {ctxRenderer = renderer}) getInitState update eventHandler draw = - getInitState >>= appLoop +setupAppShell (DrawContext {ctxRenderer = renderer}) getInitState update eventHandler draw = do + state <- getInitState >>= evalUpdateResult + appLoop state where appLoop currentState = do SDL.rendererDrawColor renderer $= colorBackground -- cgit v1.3.1