adding process function

This commit is contained in:
nek0 2017-03-16 20:52:45 +01:00
parent cb16e5ef09
commit a32c8957bd
4 changed files with 9 additions and 5 deletions

View file

@ -90,7 +90,7 @@ draw = do
traceM "drawing"
UserData{..} <- getAffection
drawRect (nodeGraph M.! "nop") (G.RGB 1 0 0) Fill (G.GeglRectangle 10 10 500 500) foreground
liftIO $ G.gegl_node_process $ nodeGraph M.! "sink"
process $ nodeGraph M.! "sink"
update :: Affection UserData ()
update = do

View file

@ -85,9 +85,7 @@ load _ = do
draw :: Affection UserData ()
draw = do
traceM "drawing"
UserData{..} <- getAffection
clear foreground
maybe (return ()) (\(x, y) ->
drawRect
(nodeGraph M.! "nop")
@ -96,7 +94,7 @@ draw = do
(G.GeglRectangle (x - 10) (y - 10) 20 20)
foreground
) coordinates
liftIO $ G.gegl_node_process $ nodeGraph M.! "sink"
process (nodeGraph M.! "sink")
update :: Affection UserData ()
update = do

View file

@ -89,7 +89,7 @@ draw :: Affection UserData ()
draw = do
traceM "drawing"
UserData{..} <- getAffection
liftIO $ G.gegl_node_process $ nodeGraph M.! "sink"
process $ nodeGraph M.! "sink"
-- ad <- get
-- ud <- getAffection
-- drawParticles partDraw $ particles ud

View file

@ -7,6 +7,7 @@ module Affection.Draw
, handleDrawRequest
, invalidateDrawRequest
, present
, process
, clearArea
) where
@ -66,6 +67,11 @@ present rect buf kill = do
{ drawStack = (DrawRequest rect buf k) : drawStack ad
}
process
:: G.GeglNode
-> Affection us ()
process = liftIO . G.gegl_node_process
-- | function for handling 'DrawRequest's and updating the output
handleDrawRequest
:: Ptr a -- ^ Pixel buffer to blit to