fwgl-javascript 0.1.0.2 → 0.1.0.3
raw patch · 2 files changed
+8/−6 lines, 2 filesdep ~base
Dependency ranges changed: base
Files
- FWGL/Backend/JavaScript.hs +5/−3
- fwgl-javascript.cabal +3/−3
FWGL/Backend/JavaScript.hs view
@@ -48,7 +48,7 @@ (Just h) <- getProp "height" img >>= fromJSRef f (img, w, h) - setup initState draw sigf =+ setup initState draw customInp sigf = do element <- query $ toJSString "canvas" eventSrc <- source handledEvents element ctx <- JS.getCtx element@@ -56,17 +56,19 @@ (Just h) <- getProp "clientHeight" element >>= fromJSRef focus element -- ... no drawStateRef <- initState w h ctx >>= newIORef- reactStateRef <- reactInit (return $ initInput w h)+ initCustom <- customInp+ reactStateRef <- reactInit (return $ initInput w h initCustom) (\ _ _ -> actuate ctx drawStateRef) sigf onFrame $ frame reactStateRef eventSrc Nothing where frame rsf src last crf = do events <- clear src+ custom <- customInp (Just cur) <- fromJSRef crf let tm = case last of Just l -> cur - l Nothing -> 0- react rsf (tm, Just $ Input events)+ react rsf (tm, Just $ Input events custom) onFrame $ frame rsf src (Just cur) onFrame handler = asyncCallback1 NeverRetain handler
fwgl-javascript.cabal view
@@ -1,12 +1,12 @@ name: fwgl-javascript-version: 0.1.0.2+version: 0.1.0.3 synopsis: FWGL GHCJS backend description: FWGL GHCJS backend-homepage: https://github.com/ZioCrocifisso/FWGL+homepage: https://github.com/ziocroc/FWGL stability: experimental license: BSD3 license-file: LICENSE-author: Luca "ZioCrocifisso" Prezzavento+author: Luca "ziocroc" Prezzavento maintainer: ziocroc@gmail.com category: Game, Game Engine, Javascript build-type: Simple