add Scene class
This commit is contained in:
parent
00ac2ef5b2
commit
31f56d62a3
1 changed files with 26 additions and 0 deletions
26
src/Classes/Scene.hs
Normal file
26
src/Classes/Scene.hs
Normal file
|
@ -0,0 +1,26 @@
|
|||
{-# LANGUAGE ExistentialQuantification #-}
|
||||
module Scenes.Scene where
|
||||
|
||||
import Affection
|
||||
|
||||
import qualified SDL
|
||||
|
||||
class Scene a where
|
||||
|
||||
-- | Perform initialization and output a (possibly empty) data container.
|
||||
initScene :: IO a
|
||||
|
||||
-- | Load actual data into the initialized container.
|
||||
loadScene :: a -> Affection ()
|
||||
|
||||
-- | Query whether loading data is finished.
|
||||
isSceneLoaded :: a -> Affection Bool
|
||||
|
||||
-- | Run updates on the data given the time elapsed since last frame
|
||||
update :: a -> Float -> Affection ()
|
||||
|
||||
-- | Handle input events
|
||||
onEvents :: a -> [SDL.EventPayload] -> Affection ()
|
||||
|
||||
-- | perform the drawing
|
||||
render :: a -> Affection ()
|
Loading…
Reference in a new issue