adding process function
This commit is contained in:
parent
cb16e5ef09
commit
a32c8957bd
4 changed files with 9 additions and 5 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue