module Main where
import Data.Maybe
import Mischief.ECS
import Mischief.ECS.Components.Spawn
import Mischief.ECS.Systems qualified as Systems
import Mischief.SDL
import Mischief.SDL.Window
main :: IO ()
main = do
app <- newApp
addPlugin @MainPlugin app
runApp app
data MainPlugin = MainPlugin deriving (Eq)
instance Plugin MainPlugin where
init = do
schedule @Update $ systems (pure () :: System ())
schedule @Startup $ systems setup
deps = [dep @SDLPlugin]
setup :: System ()
setup = do
w1 <- spawn (Window, WindowSize 100 300)
w2 <- spawn (Window, WindowTitle "Second Window", WindowSize 1000 40)
w3 <- spawn Window
pure ()