Window shows fps-count + proc-tex-shader

- added fps to window-name
- hsSDL2 needs update (as i changed functions in there which got merged)
- wrote simplistic procedural texture shader
This commit is contained in:
Stefan Dresselhaus
2014-01-22 14:04:18 +01:00
parent 080776b25c
commit 5f313c4495
7 changed files with 447 additions and 19 deletions

View File

@ -315,6 +315,8 @@ run = do
mt <- liftIO $ do
now <- getCurrentTime
diff <- return $ diffUTCTime now (stateClock state) -- get time-diffs
title <- return $ unwords ["Pioneers @ ",show $ ((round .fromRational.toRational $ 1/diff)::Int),"fps"]
setWindowTitle win $ title
sleepAmount <- return $ floor (max 0 (0.04 - diff))*1000000 -- get time until next frame in microseconds
threadDelay sleepAmount
return now
@ -447,5 +449,4 @@ processEvent e = do
}
Quit -> modify $ \s -> s {stateWinClose = True}
-- there is more (joystic, touchInterface, ...), but currently ignored
_ -> return ()
liftIO $ putStrLn $ unwords ["Processing Event:",(show e)]
_ -> liftIO $ putStrLn $ unwords ["Not processing Event:",(show e)]