module YampaSDL2.AppOutput
(
AppOutput(..)
, Graphics(..)
, Camera(..)
, RenderShape(..)
, Sound(..)
, container
) where
import Linear.V2
import YampaSDL2.Geometry (Shape(..))
data AppOutput = AppOutput
{ graphics :: Graphics
, sound :: [Sound]
, shouldExit :: Bool
}
data Graphics = Graphics
{ camera :: Camera
, objects :: [RenderShape]
} deriving Show
data Camera = Camera
{ cPos :: V2 Double
, cSize :: V2 Double
} deriving Show
container :: V2 Double -> [RenderShape] -> [RenderShape]
container translateV2 children =
fmap (\rs -> rs {shapeCentre=shapeCentre rs + translateV2}) children
data RenderShape
= RS { shapeCentre :: V2 Double
, shape :: Shape
, zIndex :: Int
} deriving (Show, Eq)
data Sound =
NotImplementedYet