module FWGL.Backend.IO where
import Control.Concurrent (ThreadId)
import FRP.Yampa
import FWGL.Backend.GLES
import FWGL.Input
class GLES => BackendIO where
type Canvas
type BackendState
loadImage :: FilePath
-> ((Image, Int, Int) -> IO ())
-> IO ()
loadTextFile :: FilePath
-> (Either String String -> IO ())
-> IO ()
initBackend :: IO BackendState
createCanvas :: String -> BackendState -> IO (Canvas, Int, Int)
setCanvasSize :: Int
-> Int
-> Canvas
-> BackendState
-> IO ()
setCanvasTitle :: String -> Canvas -> BackendState -> IO ()
setCanvasResizeCallback :: (Int -> Int -> IO ())
-> Canvas -> BackendState -> IO ()
setCanvasRefreshCallback :: IO () -> Canvas -> BackendState -> IO ()
popInput :: a -> Canvas -> BackendState -> IO (Input a)
getInput :: a -> Canvas -> BackendState -> IO (Input a)
drawCanvas :: (Ctx -> IO a)
-> Bool
-> Canvas
-> BackendState
-> IO a
safeFork :: Ctx -> (IO () -> IO ThreadId) -> IO () -> IO ThreadId
refreshLoop :: Int
-> Canvas
-> BackendState
-> IO ()
getTime :: BackendState -> IO Double
terminateBackend :: BackendState -> IO ()