packages feed

edge-0.8.2: Animation.hs

module Animation where

import Graphics.Gloss.Data.Picture
import Moving
import Data.WrapAround
import Sound.ALUT
import Common

class Animation a where
  image :: a -> Time -> Picture

class Audible a where
  processAudio :: a -> WrapPoint -> IO a
  terminateAudio :: a -> IO a

{-
  Note to self: I need to terminateAudio for the purpose of stopping sound
  from Audible objects before they vanish (e.g., before a level change).
  However, I am also concerned about the fact that the Sound.OpenAL API
  doesn't seem to have any call for destroying a Source. I wonder if this is
  handled automatically somehow, if I this will lead to a memory leak, with
  Source objects accumulating in whatever system stores them.
-}

audioReferenceDistance = 300.0 :: Float

-- audioMaxDistance = 800.0 :: Float

audioRolloffFactor = 3.0 :: Float

audioDistanceModel = InverseDistanceClamped