Copyright | (c) Matthew Mosior 2023 |
---|---|
License | BSD-style |
Maintainer | mattm.github@gmail.com |
Portability | portable |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Massiv-based alternative for gloss-raster
This library utilizes massiv's superb performance characteristics to supply alternative rasterization functionality to that which is provided by the gloss-raster package.
Synopsis
- animateArrayMassiv :: Display -> (Int, Int) -> (Float -> Array S Ix2 ColorMassiv) -> IO ()
- playArrayMassiv :: Display -> (Int, Int) -> Int -> world -> (world -> Array S Ix2 ColorMassiv) -> (Event -> world -> world) -> (Float -> world -> world) -> IO ()
- animateArrayMassivIO :: Display -> (Int, Int) -> (Float -> IO (Array S Ix2 ColorMassiv)) -> IO ()
- playArrayMassivIO :: Display -> (Int, Int) -> Int -> world -> (world -> IO (Array S Ix2 ColorMassiv)) -> (Event -> world -> IO world) -> (Float -> world -> IO world) -> IO ()
- makeFrame :: (Int, Int) -> Array S Ix2 ColorMassiv -> Picture
- sizeOfDisplay :: Display -> IO (Int, Int)
Graphics.Gloss.Raster.Array Replacement functions - Display functions
:: Display | Display mode. |
-> (Int, Int) | Number of pixels to draw per element. |
-> (Float -> Array S Ix2 ColorMassiv) | A function to construct a delayed array for the given time. The function should return an array of the same extent each time it is applied. It is passed the time in seconds since the program started. |
-> IO () |
A more performant replacement of animateArray found in Graphics.Gloss.Raster.Array.
Animate a bitmap generated from a Massiv array.
:: Display | Display mode. |
-> (Int, Int) | Number of pixels to draw per element. |
-> Int | Number of simulation steps to take for each second of real time |
-> world | The initial world. |
-> (world -> Array S Ix2 ColorMassiv) | Function to convert the world to an array. |
-> (Event -> world -> world) | Function to handle input events. |
-> (Float -> world -> world) | Function to step the world one iteration. It is passed the time in seconds since the program started. |
-> IO () |
A more performant replacement of playArray found in Graphics.Gloss.Raster.Array.
Play with a bitmap generated from a Massiv array.
:: Display | Display mode. |
-> (Int, Int) | Number of pixels to draw per element. |
-> (Float -> IO (Array S Ix2 ColorMassiv)) | A function to construct a delayed array for the given time. The function should return an array of the same extent each time it is applied. It is passed the time in seconds since the program started. |
-> IO () |
A more performant replacement of animateArrayIO found in Graphics.Gloss.Raster.Array.
Animate a bitmap generated from a Massiv array, via the IO monad.
:: Display | Display mode. |
-> (Int, Int) | Number of pixels to draw per element. |
-> Int | Number of simulation steps to take for each second of real time |
-> world | The initial world. |
-> (world -> IO (Array S Ix2 ColorMassiv)) | Function to convert the world to an array. |
-> (Event -> world -> IO world) | Function to handle input events. |
-> (Float -> world -> IO world) | Function to step the world one iteration. It is passed the time in seconds since the program started. |
-> IO () |
A more performant replacement of playArrayIO found in Graphics.Gloss.Raster.Array.
Play with a bitmap generated from a Massiv array, via the IO monad.