-- | Display mode is for drawing a static picture.
module Brillo.Interface.Pure.Display (
  module Brillo.Data.Display,
  module Brillo.Data.Picture,
  module Brillo.Data.Color,
  display,
)
where

import Brillo.Data.Color
import Brillo.Data.Display
import Brillo.Data.Picture
import Brillo.Internals.Interface.Backend
import Brillo.Internals.Interface.Display


-- | Open a new window and display the given picture.
display
  :: Display
  -- ^ Display mode.
  -> Color
  -- ^ Background color.
  -> Picture
  -- ^ The picture to draw.
  -> IO ()
display :: Display -> Color -> Picture -> IO ()
display Display
dis Color
backColor Picture
picture =
  GLFWState
-> Display -> Color -> IO Picture -> (Controller -> IO ()) -> IO ()
forall a.
Backend a =>
a
-> Display -> Color -> IO Picture -> (Controller -> IO ()) -> IO ()
displayWithBackend
    GLFWState
defaultBackendState
    Display
dis
    Color
backColor
    (Picture -> IO Picture
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Picture
picture)
    (IO () -> Controller -> IO ()
forall a b. a -> b -> a
const (() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()))