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
- animateFieldMassiv :: Display -> (Int, Int) -> (Float -> Point -> ColorMassiv) -> IO ()
- playFieldMassiv :: Display -> (Int, Int) -> Int -> world -> (world -> Point -> ColorMassiv) -> (Event -> world -> world) -> (Float -> world -> world) -> IO ()
- animateFieldMassivIO :: Display -> (Int, Int) -> (Float -> IO (Point -> ColorMassiv)) -> IO ()
- playFieldMassivIO :: Display -> (Int, Int) -> Int -> world -> (world -> IO (Point -> ColorMassiv)) -> (Event -> world -> IO world) -> (Float -> world -> IO world) -> IO ()
- makePicture :: Int -> Int -> Int -> Int -> (Point -> ColorMassiv) -> Picture
- makeFrame :: PrimMonad m => Int -> Int -> (Point -> ColorMassiv) -> m (Array S Ix2 RGBTriplet)
- sizeOfDisplay :: Display -> IO (Int, Int)
Graphics.Gloss.Raster.Field Replacement functions - Display functions
:: Display | Display mode. |
-> (Int, Int) | Number of pixels to draw per point. |
-> (Float -> Point -> ColorMassiv) | Function to compute the color at a particular point. It is passed the time in seconds since the program started, and a point between (-1, -1) and (+1, +1). |
-> IO () |
A more performant replacement of animateField found in Graphics.Gloss.Raster.Field.
Animate a continuous 2D function from a Massiv array.
:: Display | Display mode. |
-> (Int, Int) | Number of pixels to draw per point. |
-> Int | Number of simulation steps to take for each second of real time |
-> world | The initial world. |
-> (world -> Point -> ColorMassiv) | Function to compute the color of the world at the given point. |
-> (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 playField found in Graphics.Gloss.Raster.Field.
Play a game with a continuous 2D function generated from a Massiv array.
:: Display | Display mode. |
-> (Int, Int) | Number of pixels to draw per point. |
-> (Float -> IO (Point -> ColorMassiv)) | Function to compute the color at a particular point. It is passed the time in seconds since the program started, and a point between (-1, -1) and (+1, +1). |
-> IO () |
A more performant replacement of animateFieldIO found in Graphics.Gloss.Raster.Field.
Animate a continuous 2D function from a Massiv array, via the IO monad.
:: Display | Display mode. |
-> (Int, Int) | Number of pixels to draw per point. |
-> Int | Number of simulation steps to take for each second of real time |
-> world | The initial world. |
-> (world -> IO (Point -> ColorMassiv)) | Function to compute the color of the world at the given point. |
-> (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 playFieldIO found in Graphics.Gloss.Raster.Field.
Play a game with a continuous 2D function generated from a Massiv array, via the IO monad.
Graphics.Gloss.Raster.Field Replacement functions - Frame creation
makePicture :: Int -> Int -> Int -> Int -> (Point -> ColorMassiv) -> Picture Source #
A more performant replacement of makePicture found in Graphics.Gloss.Raster.Field.
makeFrame :: PrimMonad m => Int -> Int -> (Point -> ColorMassiv) -> m (Array S Ix2 RGBTriplet) Source #
A more performant replacement of makeFrame found in Graphics.Gloss.Raster.Field.