diff --git a/src/Init.hs b/src/Init.hs index d377e12..c60c7c4 100644 --- a/src/Init.hs +++ b/src/Init.hs @@ -35,6 +35,7 @@ load :: IO UserData load = do -- liftIO $ logIO A.Debug "Let's drop some Hints for SDL" -- SDL.HintRenderDriver $= SDL.OpenGL + GL.clearColor $= GL.Color4 0 0 0.1 1 liftIO $ logIO A.Debug "init GLEW" _ <- glewInit liftIO $ logIO A.Debug "loading state" diff --git a/src/Main.hs b/src/Main.hs index 41171b4..6b119a0 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -84,4 +84,17 @@ draw = do -- liftIO $ logIO A.Debug $ "Window pixel format: " ++ show pf liftIO $ beginFrame (nano ud) 800 600 1 smDraw (state ud) + drawVignette liftIO $ endFrame (nano ud) + +drawVignette :: Affection UserData () +drawVignette = do + ctx <- nano <$> getAffection + liftIO $ do + save ctx + beginPath ctx + grad <- boxGradient ctx 200 150 400 300 0 500 (rgba 0 0 0 0) (rgba 0 0 0 255) + rect ctx 0 0 800 600 + fillPaint ctx grad + fill ctx + restore ctx