fwgl-0.1.3.1: Game engine

Safe HaskellNone
LanguageHaskell2010

FWGL.Backend.IO

Documentation

class GLES => BackendIO where Source

Associated Types

type Canvas Source

Where to draw (e.g. a window, a HTML5 canvas).

type BackendState Source

Methods

loadImage Source

Arguments

:: FilePath

Path or URL.

-> ((Image, Int, Int) -> IO ())

Callback.

-> IO () 

loadTextFile Source

Arguments

:: FilePath

Path or URL.

-> (Either String String -> IO ())

Callback

-> IO () 

initBackend :: IO BackendState Source

createCanvas :: String -> BackendState -> IO (Canvas, Int, Int) Source

setCanvasSize Source

Arguments

:: Int

Width

-> Int

Height

-> Canvas 
-> BackendState 
-> IO () 

Set the size of the canvas/window.

setCanvasTitle :: String -> Canvas -> BackendState -> IO () Source

Set the title of the window.

setCanvasResizeCallback :: (Int -> Int -> IO ()) -> Canvas -> BackendState -> IO () Source

setCanvasRefreshCallback :: IO () -> Canvas -> BackendState -> IO () Source

popInput :: a -> Canvas -> BackendState -> IO (Input a) Source

getInput :: a -> Canvas -> BackendState -> IO (Input a) Source

drawCanvas Source

Arguments

:: (Ctx -> IO a)

Draw action.

-> Bool

Swap buffers.

-> Canvas 
-> BackendState 
-> IO a 

safeFork :: Ctx -> (IO () -> IO ThreadId) -> IO () -> IO ThreadId Source

refreshLoop Source

Arguments

:: Int

FPS (not necessarily used).

-> Canvas 
-> BackendState 
-> IO () 

getTime :: BackendState -> IO Double Source

Time, in seconds.

terminateBackend :: BackendState -> IO () Source