diff --git a/examples/example00.hs b/examples/example00.hs index f9438f6..993b805 100644 --- a/examples/example00.hs +++ b/examples/example00.hs @@ -51,7 +51,7 @@ load _ = do traceM "over" text <- G.gegl_node_new_child root $ G.textOperation [ G.Property "string" $ G.PropertyString "Hello world!" - -- , G.Property "color" $ G.PropertyColor $ G.RGBA 0 0 1 0.1 + , G.Property "color" $ G.PropertyColor $ G.RGBA 0 0 1 0.1 , G.Property "size" $ G.PropertyDouble 40 ] traceM "text" diff --git a/src/Affection.hs b/src/Affection.hs index 3fe9a85..f40438f 100644 --- a/src/Affection.hs +++ b/src/Affection.hs @@ -11,6 +11,7 @@ module Affection ) where import qualified SDL +import qualified SDL.Raw as Raw import qualified GEGL as G import qualified Data.Text as T @@ -39,7 +40,8 @@ withAffection conf@AffectionConfig{..} = do G.gegl_init execTime <- newMVar =<< getTime Monotonic window <- SDL.createWindow windowTitle windowConfig - surface <- SDL.getWindowSurface window + oldSurf@(SDL.Surface ptr vect) <- SDL.getWindowSurface window + surface <- (\x -> return $ SDL.Surface x Nothing) =<< Raw.convertSurfaceFormat ptr Raw.SDL_PIXELFORMAT_ABGR8888 0 initContainer <- return . (\x -> AffectionData { quitEvent = False , userState = x @@ -52,6 +54,7 @@ withAffection conf@AffectionConfig{..} = do return $ not $ Types.quitEvent current ) (do + liftIO $ SDL.surfaceBlit surface Nothing oldSurf Nothing now <- liftIO $ getTime Monotonic lastTime <- liftIO $ fromMaybe now <$> tryReadMVar execTime drawLoop