gloss-raster-massiv-0.1.1.5: Massiv-based alternative for gloss-raster
Copyright(c) Matthew Mosior 2023
LicenseBSD-style
Maintainermattm.github@gmail.com
Portabilityportable
Safe HaskellSafe-Inferred
LanguageHaskell2010

Graphics.Gloss.Raster.Field

Description

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

Graphics.Gloss.Raster.Field Replacement functions - Display functions

animateFieldMassiv Source #

Arguments

:: 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.

playFieldMassiv Source #

Arguments

:: 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.

animateFieldMassivIO Source #

Arguments

:: 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.

playFieldMassivIO Source #

Arguments

:: 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.

Graphics.Gloss.Raster.Field Replacement functions - Size of Display

sizeOfDisplay :: Display -> IO (Int, Int) Source #

Function that takes a display and returns a tuple of the x and y scale.