module Graphics.GPipe.Context.GLFW.Window (
windowShouldClose,
setWindowShouldClose,
setWindowCloseCallback,
getWindowSize,
setWindowSizeCallback,
GPipe.getFrameBufferSize,
) where
import Control.Monad.IO.Class (MonadIO)
import qualified Graphics.GPipe.Context as GPipe (ContextT,
Window,
getFrameBufferSize)
import qualified Graphics.GPipe.Context.GLFW.Calls as Call
import Graphics.GPipe.Context.GLFW.Handler (Handle (..))
import qualified Graphics.GPipe.Context.GLFW.Wrappers as Wrappers
getWindowSize :: MonadIO m => GPipe.Window os c ds -> GPipe.ContextT Handle os m (Maybe (Int, Int))
getWindowSize :: Window os c ds -> ContextT Handle os m (Maybe (Int, Int))
getWindowSize = (OnMain (Int, Int) -> Window -> IO (Int, Int))
-> Window os c ds -> ContextT Handle os m (Maybe (Int, Int))
forall (m :: * -> *) a os c ds.
MonadIO m =>
(OnMain a -> Window -> IO a)
-> Window os c ds -> ContextT Handle os m (Maybe a)
Wrappers.withWindowRPC OnMain (Int, Int) -> Window -> IO (Int, Int)
Call.getWindowSize
setWindowSizeCallback :: MonadIO m => GPipe.Window os c ds -> Maybe (Int -> Int -> IO ()) -> GPipe.ContextT Handle os m (Maybe ())
setWindowSizeCallback :: Window os c ds
-> Maybe (Int -> Int -> IO ()) -> ContextT Handle os m (Maybe ())
setWindowSizeCallback = (OnMain ()
-> Window -> Maybe (Window -> Int -> Int -> IO ()) -> IO ())
-> Window os c ds
-> Maybe (Int -> Int -> IO ())
-> ContextT Handle os m (Maybe ())
forall (m :: * -> *) (g :: * -> *) a b os c ds.
(MonadIO m, Functor g) =>
(OnMain a -> Window -> g (Window -> b) -> IO a)
-> Window os c ds -> g b -> ContextT Handle os m (Maybe a)
Wrappers.wrapCallbackSetter OnMain ()
-> Window -> Maybe (Window -> Int -> Int -> IO ()) -> IO ()
Call.setWindowSizeCallback
windowShouldClose :: MonadIO m => GPipe.Window os c ds -> GPipe.ContextT Handle os m (Maybe Bool)
windowShouldClose :: Window os c ds -> ContextT Handle os m (Maybe Bool)
windowShouldClose = (Window -> IO Bool)
-> Window os c ds -> ContextT Handle os m (Maybe Bool)
forall (m :: * -> *) a os c ds.
MonadIO m =>
(Window -> IO a)
-> Window os c ds -> ContextT Handle os m (Maybe a)
Wrappers.withWindow Window -> IO Bool
Call.windowShouldClose
setWindowShouldClose :: MonadIO m => GPipe.Window os c ds -> Bool -> GPipe.ContextT Handle os m (Maybe ())
setWindowShouldClose :: Window os c ds -> Bool -> ContextT Handle os m (Maybe ())
setWindowShouldClose Window os c ds
w Bool
b = (Window -> IO ())
-> Window os c ds -> ContextT Handle os m (Maybe ())
forall (m :: * -> *) a os c ds.
MonadIO m =>
(Window -> IO a)
-> Window os c ds -> ContextT Handle os m (Maybe a)
Wrappers.withWindow (Window -> Bool -> IO ()
`Call.setWindowShouldClose` Bool
b) Window os c ds
w
setWindowCloseCallback :: MonadIO m => GPipe.Window os c ds -> Maybe (IO ()) -> GPipe.ContextT Handle os m (Maybe ())
setWindowCloseCallback :: Window os c ds -> Maybe (IO ()) -> ContextT Handle os m (Maybe ())
setWindowCloseCallback = (OnMain () -> Window -> Maybe (Window -> IO ()) -> IO ())
-> Window os c ds
-> Maybe (IO ())
-> ContextT Handle os m (Maybe ())
forall (m :: * -> *) (g :: * -> *) a b os c ds.
(MonadIO m, Functor g) =>
(OnMain a -> Window -> g (Window -> b) -> IO a)
-> Window os c ds -> g b -> ContextT Handle os m (Maybe a)
Wrappers.wrapCallbackSetter OnMain () -> Window -> Maybe (Window -> IO ()) -> IO ()
Call.setWindowCloseCallback