sdl2-2.5.5.0: Both high- and low-level bindings to the SDL library (version 2.0.6+).

Safe Haskell | Safe-Inferred
Language | Haskell2010

SDL.Video.Renderer

Contents

- `Renderer` Configuration
- Drawing Primitives
- `Renderer` State
- `Surface`s
  - Creating and Destroying `Surface`s
  - `Surface` state
  - Accessing `Surface` Data
- `Palette`s and pixel formats
- Textures
  - Creating, Using and Destroying `Texture`s
  - `Texture` State
  - Accessing `Texture` Data
- Available `Renderer`s

Description

SDL.Video.Renderer provides a high-level interface to SDL's accelerated 2D rendering library.

Synopsis

- data Renderer
- data RendererConfig = RendererConfig {
  - rendererType :: RendererType
  - rendererTargetTexture :: Bool
  }
- defaultRenderer :: RendererConfig
- data RendererType
  - = UnacceleratedRenderer
  - | AcceleratedRenderer
  - | AcceleratedVSyncRenderer
  - | SoftwareRenderer
- clear :: (Functor m, MonadIO m) => Renderer -> m ()
- copy :: MonadIO m => Renderer -> Texture -> Maybe (Rectangle CInt) -> Maybe (Rectangle CInt) -> m ()
- copyEx :: MonadIO m => Renderer -> Texture -> Maybe (Rectangle CInt) -> Maybe (Rectangle CInt) -> CDouble -> Maybe (Point V2 CInt) -> V2 Bool -> m ()
- drawLine :: (Functor m, MonadIO m) => Renderer -> Point V2 CInt -> Point V2 CInt -> m ()
- drawLines :: MonadIO m => Renderer -> Vector (Point V2 CInt) -> m ()
- drawPoint :: (Functor m, MonadIO m) => Renderer -> Point V2 CInt -> m ()
- drawPoints :: MonadIO m => Renderer -> Vector (Point V2 CInt) -> m ()
- drawRect :: MonadIO m => Renderer -> Maybe (Rectangle CInt) -> m ()
- drawRects :: MonadIO m => Renderer -> Vector (Rectangle CInt) -> m ()
- fillRect :: MonadIO m => Renderer -> Maybe (Rectangle CInt) -> m ()
- fillRects :: MonadIO m => Renderer -> Vector (Rectangle CInt) -> m ()
- copyF :: MonadIO m => Renderer -> Texture -> Maybe (Rectangle CInt) -> Maybe (Rectangle CFloat) -> m ()
- copyExF :: MonadIO m => Renderer -> Texture -> Maybe (Rectangle CInt) -> Maybe (Rectangle CFloat) -> CDouble -> Maybe (Point V2 CFloat) -> V2 Bool -> m ()
- drawLineF :: MonadIO m => Renderer -> Point V2 CFloat -> Point V2 CFloat -> m ()
- drawLinesF :: MonadIO m => Renderer -> Vector (Point V2 CFloat) -> m ()
- drawPointF :: MonadIO m => Renderer -> Point V2 CFloat -> m ()
- drawPointsF :: MonadIO m => Renderer -> Vector (Point V2 CFloat) -> m ()
- drawRectF :: MonadIO m => Renderer -> Rectangle CFloat -> m ()
- drawRectsF :: MonadIO m => Renderer -> Vector (Rectangle CFloat) -> m ()
- fillRectF :: MonadIO m => Renderer -> Rectangle CFloat -> m ()
- fillRectsF :: MonadIO m => Renderer -> Vector (Rectangle CFloat) -> m ()
- renderGeometry :: MonadIO m => Renderer -> Maybe Texture -> Vector Vertex -> Vector CInt -> m ()
- data Vertex = Vertex {
  - vertexPosition :: !FPoint
  - vertexColor :: !Color
  - vertexTexCoord :: !FPoint
  }
- renderGeometryRaw :: forall ix m. (Storable ix, MonadIO m) => Renderer -> Maybe Texture -> Ptr FPoint -> CInt -> Ptr Color -> CInt -> Ptr FPoint -> CInt -> CInt -> Vector ix -> m ()
- present :: MonadIO m => Renderer -> m ()
- rendererDrawBlendMode :: Renderer -> StateVar BlendMode
- rendererDrawColor :: Renderer -> StateVar (V4 Word8)
- rendererRenderTarget :: Renderer -> StateVar (Maybe Texture)
- rendererClipRect :: Renderer -> StateVar (Maybe (Rectangle CInt))
- rendererLogicalSize :: Renderer -> StateVar (Maybe (V2 CInt))
- rendererScale :: Renderer -> StateVar (V2 CFloat)
- rendererViewport :: Renderer -> StateVar (Maybe (Rectangle CInt))
- renderTargetSupported :: MonadIO m => Renderer -> m Bool
- data Surface = Surface (Ptr Surface) (Maybe (IOVector Word8))
- updateWindowSurface :: (Functor m, MonadIO m) => Window -> m ()
- surfaceBlit :: MonadIO m => Surface -> Maybe (Rectangle CInt) -> Surface -> Maybe (Point V2 CInt) -> m (Maybe (Rectangle CInt))
- surfaceBlitScaled :: MonadIO m => Surface -> Maybe (Rectangle CInt) -> Surface -> Maybe (Rectangle CInt) -> m ()
- surfaceFillRect :: MonadIO m => Surface -> Maybe (Rectangle CInt) -> V4 Word8 -> m ()
- surfaceFillRects :: MonadIO m => Surface -> Vector (Rectangle CInt) -> V4 Word8 -> m ()
- convertSurface :: (Functor m, MonadIO m) => Surface -> SurfacePixelFormat -> m Surface
- createRGBSurface :: (Functor m, MonadIO m) => V2 CInt -> PixelFormat -> m Surface
- createRGBSurfaceFrom :: (Functor m, MonadIO m) => IOVector Word8 -> V2 CInt -> CInt -> PixelFormat -> m Surface
- freeSurface :: MonadIO m => Surface -> m ()
- getWindowSurface :: (Functor m, MonadIO m) => Window -> m Surface
- loadBMP :: MonadIO m => FilePath -> m Surface
- surfaceColorKey :: Surface -> StateVar (Maybe (V4 Word8))
- surfaceBlendMode :: Surface -> StateVar BlendMode
- surfaceDimensions :: MonadIO m => Surface -> m (V2 CInt)
- surfaceFormat :: MonadIO m => Surface -> m SurfacePixelFormat
- surfacePixels :: MonadIO m => Surface -> m (Ptr ())
- lockSurface :: MonadIO m => Surface -> m ()
- unlockSurface :: MonadIO m => Surface -> m ()
- data Palette
- paletteNColors :: MonadIO m => Palette -> m CInt
- paletteColors :: MonadIO m => Palette -> m (Maybe (Vector (V4 Word8)))
- paletteColor :: MonadIO m => Palette -> CInt -> m (Maybe (V4 Word8))
- data PixelFormat
  - = Unknown !Word32
  - | Index1LSB
  - | Index1MSB
  - | Index4LSB
  - | Index4MSB
  - | Index8
  - | RGB332
  - | RGB444
  - | RGB555
  - | BGR555
  - | ARGB4444
  - | RGBA4444
  - | ABGR4444
  - | BGRA4444
  - | ARGB1555
  - | RGBA5551
  - | ABGR1555
  - | BGRA5551
  - | RGB565
  - | BGR565
  - | RGB24
  - | BGR24
  - | RGB888
  - | RGBX8888
  - | BGR888
  - | BGRX8888
  - | ARGB8888
  - | RGBA8888
  - | ABGR8888
  - | BGRA8888
  - | ARGB2101010
  - | YV12
  - | IYUV
  - | YUY2
  - | UYVY
  - | YVYU
- newtype SurfacePixelFormat = SurfacePixelFormat (Ptr PixelFormat)
- formatPalette :: MonadIO m => SurfacePixelFormat -> m (Maybe Palette)
- setPaletteColors :: MonadIO m => Palette -> Vector (V4 Word8) -> CInt -> m ()
- pixelFormatToMasks :: MonadIO m => PixelFormat -> m (CInt, V4 Word32)
- masksToPixelFormat :: MonadIO m => CInt -> V4 Word32 -> m PixelFormat
- data Texture
- createTexture :: (Functor m, MonadIO m) => Renderer -> PixelFormat -> TextureAccess -> V2 CInt -> m Texture
- data TextureAccess
  - = TextureAccessStatic
  - | TextureAccessStreaming
  - | TextureAccessTarget
- createTextureFromSurface :: (Functor m, MonadIO m) => Renderer -> Surface -> m Texture
- updateTexture :: (Functor m, MonadIO m) => Texture -> Maybe (Rectangle CInt) -> ByteString -> CInt -> m ()
- destroyTexture :: MonadIO m => Texture -> m ()
- glBindTexture :: (Functor m, MonadIO m) => Texture -> m ()
- glUnbindTexture :: (Functor m, MonadIO m) => Texture -> m ()
- textureAlphaMod :: Texture -> StateVar Word8
- textureBlendMode :: Texture -> StateVar BlendMode
- data BlendMode
  - = BlendNone
  - | BlendAlphaBlend
  - | BlendAdditive
  - | BlendMod
- textureColorMod :: Texture -> StateVar (V3 Word8)
- lockTexture :: MonadIO m => Texture -> Maybe (Rectangle CInt) -> m (Ptr (), CInt)
- unlockTexture :: MonadIO m => Texture -> m ()
- queryTexture :: MonadIO m => Texture -> m TextureInfo
- data TextureInfo = TextureInfo {
  - texturePixelFormat :: PixelFormat
  - textureAccess :: TextureAccess
  - textureWidth :: CInt
  - textureHeight :: CInt
  }
- data Rectangle a = Rectangle (Point V2 a) (V2 a)
- getRendererInfo :: MonadIO m => Renderer -> m RendererInfo
- data RendererInfo = RendererInfo {
  - rendererInfoName :: Text
  - rendererInfoFlags :: RendererConfig
  - rendererInfoNumTextureFormats :: Word32
  - rendererInfoTextureFormats :: [PixelFormat]
  - rendererInfoMaxTextureWidth :: CInt
  - rendererInfoMaxTextureHeight :: CInt
  }
- getRenderDriverInfo :: MonadIO m => m [RendererInfo]

# Documentation

data Renderer Source #

An SDL rendering device. This can be created with `createRenderer`.

#### Instances

Instances details

Data Renderer Source # |

Instance details

Defined in SDL.Internal.Types

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Renderer -> c Renderer Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Renderer Source #

toConstr :: Renderer -> Constr Source #

dataTypeOf :: Renderer -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Renderer) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Renderer) Source #

gmapT :: (forall b. Data b => b -> b) -> Renderer -> Renderer Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Renderer -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Renderer -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> Renderer -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Renderer -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Renderer -> m Renderer Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Renderer -> m Renderer Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Renderer -> m Renderer Source #

Generic Renderer Source # |
Instance details Defined in SDL.Internal.Types Associated Types type Rep Renderer :: Type -> Type Source # Methods from :: Renderer -> Rep Renderer x Source # to :: Rep Renderer x -> Renderer Source #
Show Renderer Source # |
Instance details Defined in SDL.Internal.Types Methods showsPrec :: Int -> Renderer -> ShowS Source # show :: Renderer -> String Source # showList :: [Renderer] -> ShowS Source #
Eq Renderer Source # |
Instance details Defined in SDL.Internal.Types Methods (==) :: Renderer -> Renderer -> Bool Source # (/=) :: Renderer -> Renderer -> Bool Source #
Ord Renderer Source # |
Instance details Defined in SDL.Internal.Types Methods compare :: Renderer -> Renderer -> Ordering Source # (<) :: Renderer -> Renderer -> Bool Source # (<=) :: Renderer -> Renderer -> Bool Source # (>) :: Renderer -> Renderer -> Bool Source # (>=) :: Renderer -> Renderer -> Bool Source # max :: Renderer -> Renderer -> Renderer Source # min :: Renderer -> Renderer -> Renderer Source #
type Rep Renderer Source # |
Instance details Defined in SDL.Internal.Types type Rep Renderer = D1 ('MetaData "Renderer" "SDL.Internal.Types" "sdl2-2.5.5.0-1rHVQtCfQoNJ4T4oR9opIh" 'True) (C1 ('MetaCons "Renderer" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Renderer)))

# `Renderer` Configuration

These configuration options can be used with `createRenderer` to create `Renderer`s.

data RendererConfig Source #

The configuration data used when creating windows.

Constructors

RendererConfig |

Fields

- rendererType :: RendererType

  The renderer's acceleration mode

- rendererTargetTexture :: Bool

  The renderer supports rendering to texture

#### Instances

Instances details

Data RendererConfig Source # |

Instance details

Defined in SDL.Video.Renderer

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> RendererConfig -> c RendererConfig Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c RendererConfig Source #

toConstr :: RendererConfig -> Constr Source #

dataTypeOf :: RendererConfig -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c RendererConfig) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c RendererConfig) Source #

gmapT :: (forall b. Data b => b -> b) -> RendererConfig -> RendererConfig Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> RendererConfig -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> RendererConfig -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> RendererConfig -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> RendererConfig -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> RendererConfig -> m RendererConfig Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> RendererConfig -> m RendererConfig Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> RendererConfig -> m RendererConfig Source #

Generic RendererConfig Source # |
Instance details Defined in SDL.Video.Renderer Associated Types type Rep RendererConfig :: Type -> Type Source # Methods from :: RendererConfig -> Rep RendererConfig x Source # to :: Rep RendererConfig x -> RendererConfig Source #
Read RendererConfig Source # |
Instance details Defined in SDL.Video.Renderer Methods readsPrec :: Int -> ReadS RendererConfig Source # readList :: ReadS [RendererConfig] Source # readPrec :: ReadPrec RendererConfig Source # readListPrec :: ReadPrec [RendererConfig] Source #
Show RendererConfig Source # |
Instance details Defined in SDL.Video.Renderer Methods showsPrec :: Int -> RendererConfig -> ShowS Source # show :: RendererConfig -> String Source # showList :: [RendererConfig] -> ShowS Source #
Eq RendererConfig Source # |
Instance details Defined in SDL.Video.Renderer Methods (==) :: RendererConfig -> RendererConfig -> Bool Source # (/=) :: RendererConfig -> RendererConfig -> Bool Source #
Ord RendererConfig Source # |

Instance details

Defined in SDL.Video.Renderer

Methods

compare :: RendererConfig -> RendererConfig -> Ordering Source #

(<) :: RendererConfig -> RendererConfig -> Bool Source #

(<=) :: RendererConfig -> RendererConfig -> Bool Source #

(>) :: RendererConfig -> RendererConfig -> Bool Source #

(>=) :: RendererConfig -> RendererConfig -> Bool Source #

max :: RendererConfig -> RendererConfig -> RendererConfig Source #

min :: RendererConfig -> RendererConfig -> RendererConfig Source #

FromNumber RendererConfig Word32 Source # |
Instance details Defined in SDL.Video.Renderer Methods fromNumber :: Word32 -> RendererConfig Source #
ToNumber RendererConfig Word32 Source # |
Instance details Defined in SDL.Video.Renderer Methods toNumber :: RendererConfig -> Word32 Source #
type Rep RendererConfig Source # |

Instance details

Defined in SDL.Video.Renderer

type Rep RendererConfig = D1 ('MetaData "RendererConfig" "SDL.Video.Renderer" "sdl2-2.5.5.0-1rHVQtCfQoNJ4T4oR9opIh" 'False) (C1 ('MetaCons "RendererConfig" 'PrefixI 'True) (S1 ('MetaSel ('Just "rendererType") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 RendererType) :*: S1 ('MetaSel ('Just "rendererTargetTexture") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool)))

defaultRenderer :: RendererConfig Source #

Default options for `RendererConfig`.

    defaultRenderer = RendererConfig
      { rendererType          = AcceleratedRenderer
      , rendererTargetTexture = False
      }

data RendererType Source #

Renderer acceleration mode

Constructors

UnacceleratedRenderer | The renderer does not use hardware acceleration
AcceleratedRenderer | The renderer uses hardware acceleration and refresh rate is ignored
AcceleratedVSyncRenderer | The renderer uses hardware acceleration and present is synchronized with the refresh rate
SoftwareRenderer | The renderer is a software fallback

#### Instances

Instances details

Data RendererType Source # |

Instance details

Defined in SDL.Video.Renderer

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> RendererType -> c RendererType Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c RendererType Source #

toConstr :: RendererType -> Constr Source #

dataTypeOf :: RendererType -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c RendererType) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c RendererType) Source #

gmapT :: (forall b. Data b => b -> b) -> RendererType -> RendererType Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> RendererType -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> RendererType -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> RendererType -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> RendererType -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> RendererType -> m RendererType Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> RendererType -> m RendererType Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> RendererType -> m RendererType Source #

Bounded RendererType Source # |
Instance details Defined in SDL.Video.Renderer Methods minBound :: RendererType Source # maxBound :: RendererType Source #
Enum RendererType Source # |

Instance details

Defined in SDL.Video.Renderer

Methods

succ :: RendererType -> RendererType Source #

pred :: RendererType -> RendererType Source #

toEnum :: Int -> RendererType Source #

fromEnum :: RendererType -> Int Source #

enumFrom :: RendererType -> [RendererType] Source #

enumFromThen :: RendererType -> RendererType -> [RendererType] Source #

enumFromTo :: RendererType -> RendererType -> [RendererType] Source #

enumFromThenTo :: RendererType -> RendererType -> RendererType -> [RendererType] Source #

Generic RendererType Source # |
Instance details Defined in SDL.Video.Renderer Associated Types type Rep RendererType :: Type -> Type Source # Methods from :: RendererType -> Rep RendererType x Source # to :: Rep RendererType x -> RendererType Source #
Read RendererType Source # |
Instance details Defined in SDL.Video.Renderer Methods readsPrec :: Int -> ReadS RendererType Source # readList :: ReadS [RendererType] Source # readPrec :: ReadPrec RendererType Source # readListPrec :: ReadPrec [RendererType] Source #
Show RendererType Source # |
Instance details Defined in SDL.Video.Renderer Methods showsPrec :: Int -> RendererType -> ShowS Source # show :: RendererType -> String Source # showList :: [RendererType] -> ShowS Source #
Eq RendererType Source # |
Instance details Defined in SDL.Video.Renderer Methods (==) :: RendererType -> RendererType -> Bool Source # (/=) :: RendererType -> RendererType -> Bool Source #
Ord RendererType Source # |

Instance details

Defined in SDL.Video.Renderer

Methods

compare :: RendererType -> RendererType -> Ordering Source #

(<) :: RendererType -> RendererType -> Bool Source #

(<=) :: RendererType -> RendererType -> Bool Source #

(>) :: RendererType -> RendererType -> Bool Source #

(>=) :: RendererType -> RendererType -> Bool Source #

max :: RendererType -> RendererType -> RendererType Source #

min :: RendererType -> RendererType -> RendererType Source #

type Rep RendererType Source # |

Instance details

Defined in SDL.Video.Renderer

type Rep RendererType = D1 ('MetaData "RendererType" "SDL.Video.Renderer" "sdl2-2.5.5.0-1rHVQtCfQoNJ4T4oR9opIh" 'False) ((C1 ('MetaCons "UnacceleratedRenderer" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "AcceleratedRenderer" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "AcceleratedVSyncRenderer" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "SoftwareRenderer" 'PrefixI 'False) (U1 :: Type -> Type)))

# Drawing Primitives

clear :: (Functor m, MonadIO m) => Renderer -> m () Source #

Clear the current rendering target with the drawing color.

See `SDL_RenderClear` for C documentation.

copy Source #

Arguments

:: MonadIO m |
=> Renderer | The rendering context
-> Texture | The source texture
-> Maybe (Rectangle CInt) | The source rectangle to copy, or `Nothing` for the whole texture
-> Maybe (Rectangle CInt) | The destination rectangle to copy to, or `Nothing` for the whole rendering target. The texture will be stretched to fill the given rectangle.
-> m () |

Copy a portion of the texture to the current rendering target.

See `SDL_RenderCopy` for C documentation.

copyEx Source #

Arguments

:: MonadIO m |
=> Renderer | The rendering context
-> Texture | The source texture
-> Maybe (Rectangle CInt) | The source rectangle to copy, or `Nothing` for the whole texture
-> Maybe (Rectangle CInt) | The destination rectangle to copy to, or `Nothing` for the whole rendering target. The texture will be stretched to fill the given rectangle.
-> CDouble | The angle of rotation in degrees. The rotation will be performed clockwise.
-> Maybe (Point V2 CInt) | The point indicating the center of the rotation, or `Nothing` to rotate around the center of the destination rectangle
-> V2 Bool | Whether to flip the texture on the X and/or Y axis
-> m () |

Copy a portion of the texture to the current rendering target, optionally rotating it by angle around the given center and also flipping it top-bottom and/or left-right.

See `SDL_RenderCopyEx` for C documentation.

drawLine Source #

Arguments

:: (Functor m, MonadIO m) |
=> Renderer |
-> Point V2 CInt | The start point of the line
-> Point V2 CInt | The end point of the line
-> m () |

Draw a line on the current rendering target.

See `SDL_RenderDrawLine` for C documentation.

drawLines Source #

Arguments

:: MonadIO m |
=> Renderer |
-> Vector (Point V2 CInt) | A `Vector` of points along the line. SDL will draw lines between these points.
-> m () |

Draw a series of connected lines on the current rendering target.

See `SDL_RenderDrawLines` for C documentation.

drawPoint :: (Functor m, MonadIO m) => Renderer -> Point V2 CInt -> m () Source #

Draw a point on the current rendering target.

See `SDL_RenderDrawPoint` for C documentation.

drawPoints :: MonadIO m => Renderer -> Vector (Point V2 CInt) -> m () Source #

Draw multiple points on the current rendering target.

See `SDL_RenderDrawPoints` for C documentation.

drawRect Source #

Arguments

:: MonadIO m |
=> Renderer |
-> Maybe (Rectangle CInt) | The rectangle outline to draw. `Nothing` for the entire rendering context.
-> m () |

Draw a rectangle outline on the current rendering target.

See `SDL_RenderDrawRect` for C documentation.

drawRects :: MonadIO m => Renderer -> Vector (Rectangle CInt) -> m () Source #

Draw some number of rectangles on the current rendering target.

See `SDL_RenderDrawRects` for C documentation.

fillRect Source #

Arguments

:: MonadIO m |
=> Renderer |
-> Maybe (Rectangle CInt) | The rectangle to fill.
-> m () |

Fill a rectangle on the current rendering target with the drawing color.

See `SDL_RenderFillRect` for C documentation.

fillRects :: MonadIO m => Renderer -> Vector (Rectangle CInt) -> m () Source #

Fill some number of rectangles on the current rendering target with the drawing color.

See `SDL_RenderFillRects` for C documentation.

copyF :: MonadIO m => Renderer -> Texture -> Maybe (Rectangle CInt) -> Maybe (Rectangle CFloat) -> m () Source #

Copy a portion of the texture to the current rendering target.

copyExF Source #

Arguments

:: MonadIO m |
=> Renderer | The rendering context
-> Texture | The source texture
-> Maybe (Rectangle CInt) | The source rectangle to copy, or `Nothing` for the whole texture
-> Maybe (Rectangle CFloat) | The destination rectangle to copy to, or `Nothing` for the whole rendering target. The texture will be stretched to fill the given rectangle.
-> CDouble | The angle of rotation in degrees. The rotation will be performed clockwise.
-> Maybe (Point V2 CFloat) | The point indicating the center of the rotation, or `Nothing` to rotate around the center of the destination rectangle
-> V2 Bool | Whether to flip the texture on the X and/or Y axis
-> m () |

Copy a portion of the texture to the current rendering target, optionally rotating it by angle around the given center and also flipping it top-bottom and/or left-right.

drawLineF :: MonadIO m => Renderer -> Point V2 CFloat -> Point V2 CFloat -> m () Source #

Draw a line between two points on the current rendering target.

drawLinesF :: MonadIO m => Renderer -> Vector (Point V2 CFloat) -> m () Source #

Draw a series of connected lines on the current rendering target.

drawPointF :: MonadIO m => Renderer -> Point V2 CFloat -> m () Source #

Draw a point on the current rendering target.

drawPointsF :: MonadIO m => Renderer -> Vector (Point V2 CFloat) -> m () Source #

Draw a collection of points on the current rendering target.

drawRectF :: MonadIO m => Renderer -> Rectangle CFloat -> m () Source #

Draw the outline of a rectangle on the current rendering target.

drawRectsF :: MonadIO m => Renderer -> Vector (Rectangle CFloat) -> m () Source #

Draw a series of rectangle outlines on the current rendering target.

fillRectF :: MonadIO m => Renderer -> Rectangle CFloat -> m () Source #

Draw a filled rectangle on the current rendering target.

fillRectsF :: MonadIO m => Renderer -> Vector (Rectangle CFloat) -> m () Source #

Draw a series of filled rectangles on the current rendering target.

renderGeometry :: MonadIO m => Renderer -> Maybe Texture -> Vector Vertex -> Vector CInt -> m () Source #

Render a list of triangles, optionally using a texture and indices into the vertex array Color and alpha modulation is done per vertex (SDL_SetTextureColorMod and SDL_SetTextureAlphaMod are ignored).

data Vertex Source #

Constructors

Vertex |

Fields

- vertexPosition :: !FPoint
- vertexColor :: !Color
- vertexTexCoord :: !FPoint

#### Instances

Instances details

Storable Vertex Source # |

Instance details

Defined in SDL.Raw.Types

Methods

sizeOf :: Vertex -> Int Source #

alignment :: Vertex -> Int Source #

peekElemOff :: Ptr Vertex -> Int -> IO Vertex Source #

pokeElemOff :: Ptr Vertex -> Int -> Vertex -> IO () Source #

peekByteOff :: Ptr b -> Int -> IO Vertex Source #

pokeByteOff :: Ptr b -> Int -> Vertex -> IO () Source #

peek :: Ptr Vertex -> IO Vertex Source #

poke :: Ptr Vertex -> Vertex -> IO () Source #

Show Vertex Source # |
Instance details Defined in SDL.Raw.Types Methods showsPrec :: Int -> Vertex -> ShowS Source # show :: Vertex -> String Source # showList :: [Vertex] -> ShowS Source #
Eq Vertex Source # |
Instance details Defined in SDL.Raw.Types Methods (==) :: Vertex -> Vertex -> Bool Source # (/=) :: Vertex -> Vertex -> Bool Source #

renderGeometryRaw :: forall ix m. (Storable ix, MonadIO m) => Renderer -> Maybe Texture -> Ptr FPoint -> CInt -> Ptr Color -> CInt -> Ptr FPoint -> CInt -> CInt -> Vector ix -> m () Source #

Render a list of triangles, optionally using a texture and indices into the vertex array Color and alpha modulation is done per vertex (SDL_SetTextureColorMod and SDL_SetTextureAlphaMod are ignored).

This version allows storeing vertex data in arbitrary types, but you have to provide pointers and strides yourself.

present :: MonadIO m => Renderer -> m () Source #

Update the screen with any rendering performed since the previous call.

SDL's rendering functions operate on a backbuffer; that is, calling a rendering function such as `drawLine` does not directly put a line on the screen, but rather updates the backbuffer. As such, you compose your entire scene and present the composed backbuffer to the screen as a complete picture.

Therefore, when using SDL's rendering API, one does all drawing intended for the frame, and then calls this function once per frame to present the final drawing to the user.

The backbuffer should be considered invalidated after each present; do not assume that previous contents will exist between frames. You are strongly encouraged to call `clear` to initialize the backbuffer before starting each new frame's drawing, even if you plan to overwrite every pixel.

See `SDL_RenderPresent` for C documentation.

# `Renderer` State

SDL exposes a stateful interface to `Renderer`s - the above primitives drawing routines will change their output depending on the value of these state variables.

rendererDrawBlendMode :: Renderer -> StateVar BlendMode Source #

Get or set the blend mode used for drawing operations (fill and line).

This `StateVar` can be modified using `$=` and the current value retrieved with `get`.

See `SDL_SetRenderDrawBlendMode` and `SDL_GetRenderDrawBlendMode` for C documentation.

rendererDrawColor :: Renderer -> StateVar (V4 Word8) Source #

Get or set the color used for drawing operations (rect, line and clear).

This `StateVar` can be modified using `$=` and the current value retrieved with `get`.

See `SDL_SetRenderDrawColor` and `SDL_GetRenderDrawColor` for C documentation.

rendererRenderTarget :: Renderer -> StateVar (Maybe Texture) Source #

Get or set the current render target. `Nothing` corresponds to the default render target.

This `StateVar` can be modified using `$=` and the current value retrieved with `get`.

See `SDL_SetRenderTarget` and `SDL_GetRenderTarget` for C documentation.

rendererClipRect :: Renderer -> StateVar (Maybe (Rectangle CInt)) Source #

Get or set the clip rectangle for rendering on the specified target.

This `StateVar` can be modified using `$=` and the current value retrieved with `get`.

See `SDL_RenderSetClipRect` and `SDL_RenderGetClipRect` for C documentation.

rendererLogicalSize :: Renderer -> StateVar (Maybe (V2 CInt)) Source #

Get or set the device independent resolution for rendering.

This `StateVar` can be modified using `$=` and the current value retrieved with `get`.

See `SDL_RenderSetLogicalSize` and `SDL_RenderGetLogicalSize` for C documentation.

rendererScale :: Renderer -> StateVar (V2 CFloat) Source #

Get or set the drawing scale for rendering on the current target.

The drawing coordinates are scaled by the x/y scaling factors before they are used by the renderer. This allows resolution independent drawing with a single coordinate system.

If this results in scaling or subpixel drawing by the rendering backend, it will be handled using the appropriate quality hints. For best results use integer scaling factors.

See `SDL_RenderSetScale` and `SDL_RenderGetScale` for C documentation.

rendererViewport :: Renderer -> StateVar (Maybe (Rectangle CInt)) Source #

Get or set the drawing area for rendering on the current target.

This `StateVar` can be modified using `$=` and the current value retrieved with `get`.

See `SDL_RenderSetViewport` and `SDL_RenderGetViewport` for C documentation.

renderTargetSupported :: MonadIO m => Renderer -> m Bool Source #

Determine whether a window supports the use of render targets.

See `SDL_RenderTargetSupported` for C documentation.

# `Surface`s

data Surface Source #

Constructors

Surface (Ptr Surface) (Maybe (IOVector Word8)) |

updateWindowSurface :: (Functor m, MonadIO m) => Window -> m () Source #

Copy the window surface to the screen.

This is the function you use to reflect any changes to the surface on the screen.

See `SDL_UpdateWindowSurface` for C documentation.

surfaceBlit Source #

Arguments

:: MonadIO m |
=> Surface | The `Surface` to be copied from
-> Maybe (Rectangle CInt) | The rectangle to be copied, or `Nothing` to copy the entire surface
-> Surface | The `Surface` that is the blit target
-> Maybe (Point V2 CInt) | The position to blit to
-> m (Maybe (Rectangle CInt)) |

Perform a fast surface copy to a destination surface.

See `SDL_BlitSurface` for C documentation.

surfaceBlitScaled Source #

Arguments

:: MonadIO m |
=> Surface | The `Surface` to be copied from
-> Maybe (Rectangle CInt) | The rectangle to be copied, or `Nothing` to copy the entire surface
-> Surface | The `Surface` that is the blit target
-> Maybe (Rectangle CInt) | The rectangle that is copied into, or `Nothing` to copy into the entire surface
-> m () |

Perform a scaled surface copy to a destination surface.

See `SDL_BlitScaled` for C documentation.

surfaceFillRect Source #

Arguments

:: MonadIO m |
=> Surface | The `Surface` that is the drawing target.
-> Maybe (Rectangle CInt) | The rectangle to fill, or `Nothing` to fill the entire surface.
-> V4 Word8 | The color to fill with. If the color value contains an alpha component then the destination is simply filled with that alpha information, no blending takes place. This colour will be implictly mapped to the closest approximation that matches the surface's pixel format.
-> m () |

Perform a fast fill of a rectangle with a specific color.

If there is a clip rectangle set on the destination (set via `clipRect`), then this function will fill based on the intersection of the clip rectangle and the given `Rectangle`.

See `SDL_FillRect` for C documentation.

surfaceFillRects Source #

Arguments

:: MonadIO m |
=> Surface | The `Surface` that is the drawing target.
-> Vector (Rectangle CInt) | A `Vector` of `Rectangle`s to be filled.
-> V4 Word8 | The color to fill with. If the color value contains an alpha component then the destination is simply filled with that alpha information, no blending takes place. This colour will be implictly mapped to the closest approximation that matches the surface's pixel format.
-> m () |

Perform a fast fill of a set of rectangles with a specific color.

If there is a clip rectangle set on any of the destinations (set via `clipRect`), then this function will fill based on the intersection of the clip rectangle and the given `Rectangle`s.

See `SDL_FillRects` for C documentation.

## Creating and Destroying `Surface`s

convertSurface Source #

Arguments

:: (Functor m, MonadIO m) |
=> Surface | The `Surface` to convert
-> SurfacePixelFormat | The pixel format that the new surface is optimized for
-> m Surface |

Copy an existing surface into a new one that is optimized for blitting to a surface of a specified pixel format.

This function is used to optimize images for faster repeat blitting. This is accomplished by converting the original and storing the result as a new surface. The new, optimized surface can then be used as the source for future blits, making them faster.

See `SDL_ConvertSurface` for C documentation.

createRGBSurface Source #

Arguments

:: (Functor m, MonadIO m) |
=> V2 CInt | The size of the surface
-> PixelFormat | The bit depth, red, green, blue and alpha mask for the pixels
-> m Surface |

Allocate a new RGB surface.

See `SDL_CreateRGBSurface` for C documentation.

createRGBSurfaceFrom Source #

Arguments

:: (Functor m, MonadIO m) |
=> IOVector Word8 | The existing pixel data
-> V2 CInt | The size of the surface
-> CInt | The pitch - the length of a row of pixels in bytes
-> PixelFormat | The bit depth, red, green, blue and alpha mask for the pixels
-> m Surface |

Allocate a new RGB surface with existing pixel data.

See `SDL_CreateRGBSurfaceFrom` for C documentation.

freeSurface :: MonadIO m => Surface -> m () Source #

Free an RGB surface.

If the surface was created using `createRGBSurfaceFrom` then the pixel data is not freed.

See `SDL_FreeSurface` for the C documentation.

getWindowSurface :: (Functor m, MonadIO m) => Window -> m Surface Source #

Get the SDL surface associated with the window.

See `SDL_GetWindowSurface` for C documentation.

loadBMP :: MonadIO m => FilePath -> m Surface Source #

Load a surface from a BMP file.

See `SDL_LoadBMP` for C documentation.

## `Surface` state

surfaceColorKey :: Surface -> StateVar (Maybe (V4 Word8)) Source #

Get or set the color key (transparent pixel color) for a surface.

This `StateVar` can be modified using `$=` and the current value retrieved with `get`.

See `SDL_SetColorKey` and `SDL_GetColorKey` for C documentation.

surfaceBlendMode :: Surface -> StateVar BlendMode Source #

Get or set the blend mode used for blit operations.

This `StateVar` can be modified using `$=` and the current value retrieved with `get`.

See `SDL_SetSurfaceBlendMode` and `SDL_GetSurfaceBlendMode` for C documentation.

surfaceDimensions :: MonadIO m => Surface -> m (V2 CInt) Source #

Retrive the width and height of a `Surface`.

surfaceFormat :: MonadIO m => Surface -> m SurfacePixelFormat Source #

Inspect the pixel format under a surface.

surfacePixels :: MonadIO m => Surface -> m (Ptr ()) Source #

Obtain the pointer to the underlying pixels in a surface. You should bracket this call with `lockSurface` and `unlockSurface`, respectively.

## Accessing `Surface` Data

lockSurface :: MonadIO m => Surface -> m () Source #

Set up a surface for directly accessing the pixels.

See `SDL_LockSurface` for C documentation.

unlockSurface :: MonadIO m => Surface -> m () Source #

Release a surface after directly accessing the pixels.

See `SDL_UnlockSurface` for C documentation.

# `Palette`s and pixel formats

data Palette Source #

#### Instances

Instances details

Eq Palette Source # |
Instance details Defined in SDL.Video.Renderer Methods (==) :: Palette -> Palette -> Bool Source # (/=) :: Palette -> Palette -> Bool Source #

paletteNColors :: MonadIO m => Palette -> m CInt Source #

paletteColors :: MonadIO m => Palette -> m (Maybe (Vector (V4 Word8))) Source #

paletteColor :: MonadIO m => Palette -> CInt -> m (Maybe (V4 Word8)) Source #

data PixelFormat Source #

Constructors

Unknown !Word32 |
Index1LSB |
Index1MSB |
Index4LSB |
Index4MSB |
Index8 |
RGB332 |
RGB444 |
RGB555 |
BGR555 |
ARGB4444 |
RGBA4444 |
ABGR4444 |
BGRA4444 |
ARGB1555 |
RGBA5551 |
ABGR1555 |
BGRA5551 |
RGB565 |
BGR565 |
RGB24 |
BGR24 |
RGB888 |
RGBX8888 |
BGR888 |
BGRX8888 |
ARGB8888 |
RGBA8888 |
ABGR8888 |
BGRA8888 |
ARGB2101010 |
YV12 |
IYUV |
YUY2 |
UYVY |
YVYU |

#### Instances

Instances details

Data PixelFormat Source # |

Instance details

Defined in SDL.Video.Renderer

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> PixelFormat -> c PixelFormat Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c PixelFormat Source #

toConstr :: PixelFormat -> Constr Source #

dataTypeOf :: PixelFormat -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c PixelFormat) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c PixelFormat) Source #

gmapT :: (forall b. Data b => b -> b) -> PixelFormat -> PixelFormat Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> PixelFormat -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> PixelFormat -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> PixelFormat -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> PixelFormat -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> PixelFormat -> m PixelFormat Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> PixelFormat -> m PixelFormat Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> PixelFormat -> m PixelFormat Source #

Generic PixelFormat Source # |
Instance details Defined in SDL.Video.Renderer Associated Types type Rep PixelFormat :: Type -> Type Source # Methods from :: PixelFormat -> Rep PixelFormat x Source # to :: Rep PixelFormat x -> PixelFormat Source #
Read PixelFormat Source # |
Instance details Defined in SDL.Video.Renderer Methods readsPrec :: Int -> ReadS PixelFormat Source # readList :: ReadS [PixelFormat] Source # readPrec :: ReadPrec PixelFormat Source # readListPrec :: ReadPrec [PixelFormat] Source #
Show PixelFormat Source # |
Instance details Defined in SDL.Video.Renderer Methods showsPrec :: Int -> PixelFormat -> ShowS Source # show :: PixelFormat -> String Source # showList :: [PixelFormat] -> ShowS Source #
Eq PixelFormat Source # |
Instance details Defined in SDL.Video.Renderer Methods (==) :: PixelFormat -> PixelFormat -> Bool Source # (/=) :: PixelFormat -> PixelFormat -> Bool Source #
Ord PixelFormat Source # |

Instance details

Defined in SDL.Video.Renderer

Methods

compare :: PixelFormat -> PixelFormat -> Ordering Source #

(<) :: PixelFormat -> PixelFormat -> Bool Source #

(<=) :: PixelFormat -> PixelFormat -> Bool Source #

(>) :: PixelFormat -> PixelFormat -> Bool Source #

(>=) :: PixelFormat -> PixelFormat -> Bool Source #

max :: PixelFormat -> PixelFormat -> PixelFormat Source #

min :: PixelFormat -> PixelFormat -> PixelFormat Source #

FromNumber PixelFormat Word32 Source # |
Instance details Defined in SDL.Video.Renderer Methods fromNumber :: Word32 -> PixelFormat Source #
ToNumber PixelFormat Word32 Source # |
Instance details Defined in SDL.Video.Renderer Methods toNumber :: PixelFormat -> Word32 Source #
type Rep PixelFormat Source # |

Instance details

Defined in SDL.Video.Renderer

type Rep PixelFormat = D1 ('MetaData "PixelFormat" "SDL.Video.Renderer" "sdl2-2.5.5.0-1rHVQtCfQoNJ4T4oR9opIh" 'False) (((((C1 ('MetaCons "Unknown" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Word32)) :+: C1 ('MetaCons "Index1LSB" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "Index1MSB" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Index4LSB" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "Index4MSB" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Index8" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "RGB332" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "RGB444" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "RGB555" 'PrefixI 'False) (U1 :: Type -> Type))))) :+: (((C1 ('MetaCons "BGR555" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ARGB4444" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "RGBA4444" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ABGR4444" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "BGRA4444" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ARGB1555" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "RGBA5551" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "ABGR1555" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "BGRA5551" 'PrefixI 'False) (U1 :: Type -> Type)))))) :+: ((((C1 ('MetaCons "RGB565" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "BGR565" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "RGB24" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "BGR24" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "RGB888" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "RGBX8888" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "BGR888" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "BGRX8888" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ARGB8888" 'PrefixI 'False) (U1 :: Type -> Type))))) :+: (((C1 ('MetaCons "RGBA8888" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ABGR8888" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "BGRA8888" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ARGB2101010" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "YV12" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "IYUV" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "YUY2" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "UYVY" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "YVYU" 'PrefixI 'False) (U1 :: Type -> Type)))))))

newtype SurfacePixelFormat Source #

Constructors

SurfacePixelFormat (Ptr PixelFormat) |

#### Instances

Instances details

Eq SurfacePixelFormat Source # |
Instance details Defined in SDL.Video.Renderer Methods (==) :: SurfacePixelFormat -> SurfacePixelFormat -> Bool Source # (/=) :: SurfacePixelFormat -> SurfacePixelFormat -> Bool Source #

formatPalette :: MonadIO m => SurfacePixelFormat -> m (Maybe Palette) Source #

setPaletteColors Source #

Arguments

:: MonadIO m |
=> Palette | The `Palette` to modify
-> Vector (V4 Word8) | A `Vector` of colours to copy into the palette
-> CInt | The index of the first palette entry to modify
-> m () |

Set a range of colors in a palette.

See `SDL_SetPaletteColors` for C documentation.

pixelFormatToMasks :: MonadIO m => PixelFormat -> m (CInt, V4 Word32) Source #

Convert the given the enumerated pixel format to a bpp value and RGBA masks.

See `SDL_PixelFormatEnumToMasks` for C documentation.

masksToPixelFormat :: MonadIO m => CInt -> V4 Word32 -> m PixelFormat Source #

Convert a bpp value and RGBA masks to an enumerated pixel format.

See `SDL_MasksToPixelFormatEnum` for C documentation.

# Textures

data Texture Source #

#### Instances

Instances details

Eq Texture Source # |
Instance details Defined in SDL.Video.Renderer Methods (==) :: Texture -> Texture -> Bool Source # (/=) :: Texture -> Texture -> Bool Source #

## Creating, Using and Destroying `Texture`s

createTexture Source #

Arguments

:: (Functor m, MonadIO m) |
=> Renderer | The rendering context.
-> PixelFormat |
-> TextureAccess |
-> V2 CInt | The size of the texture.
-> m Texture |

Create a texture for a rendering context.

See `SDL_CreateTexture` for C documentation.

data TextureAccess Source #

Information to the GPU about how you will use a texture.

Constructors

TextureAccessStatic | Changes rarely, cannot be locked
TextureAccessStreaming | changes frequently, can be locked
TextureAccessTarget | Can be used as a render target

#### Instances

Instances details

Data TextureAccess Source # |

Instance details

Defined in SDL.Video.Renderer

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> TextureAccess -> c TextureAccess Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c TextureAccess Source #

toConstr :: TextureAccess -> Constr Source #

dataTypeOf :: TextureAccess -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c TextureAccess) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c TextureAccess) Source #

gmapT :: (forall b. Data b => b -> b) -> TextureAccess -> TextureAccess Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> TextureAccess -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> TextureAccess -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> TextureAccess -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> TextureAccess -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> TextureAccess -> m TextureAccess Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> TextureAccess -> m TextureAccess Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> TextureAccess -> m TextureAccess Source #

Bounded TextureAccess Source # |
Instance details Defined in SDL.Video.Renderer Methods minBound :: TextureAccess Source # maxBound :: TextureAccess Source #
Enum TextureAccess Source # |

Instance details

Defined in SDL.Video.Renderer

Methods

succ :: TextureAccess -> TextureAccess Source #

pred :: TextureAccess -> TextureAccess Source #

toEnum :: Int -> TextureAccess Source #

fromEnum :: TextureAccess -> Int Source #

enumFrom :: TextureAccess -> [TextureAccess] Source #

enumFromThen :: TextureAccess -> TextureAccess -> [TextureAccess] Source #

enumFromTo :: TextureAccess -> TextureAccess -> [TextureAccess] Source #

enumFromThenTo :: TextureAccess -> TextureAccess -> TextureAccess -> [TextureAccess] Source #

Generic TextureAccess Source # |
Instance details Defined in SDL.Video.Renderer Associated Types type Rep TextureAccess :: Type -> Type Source # Methods from :: TextureAccess -> Rep TextureAccess x Source # to :: Rep TextureAccess x -> TextureAccess Source #
Read TextureAccess Source # |
Instance details Defined in SDL.Video.Renderer Methods readsPrec :: Int -> ReadS TextureAccess Source # readList :: ReadS [TextureAccess] Source # readPrec :: ReadPrec TextureAccess Source # readListPrec :: ReadPrec [TextureAccess] Source #
Show TextureAccess Source # |
Instance details Defined in SDL.Video.Renderer Methods showsPrec :: Int -> TextureAccess -> ShowS Source # show :: TextureAccess -> String Source # showList :: [TextureAccess] -> ShowS Source #
Eq TextureAccess Source # |
Instance details Defined in SDL.Video.Renderer Methods (==) :: TextureAccess -> TextureAccess -> Bool Source # (/=) :: TextureAccess -> TextureAccess -> Bool Source #
Ord TextureAccess Source # |

Instance details

Defined in SDL.Video.Renderer

Methods

compare :: TextureAccess -> TextureAccess -> Ordering Source #

(<) :: TextureAccess -> TextureAccess -> Bool Source #

(<=) :: TextureAccess -> TextureAccess -> Bool Source #

(>) :: TextureAccess -> TextureAccess -> Bool Source #

(>=) :: TextureAccess -> TextureAccess -> Bool Source #

max :: TextureAccess -> TextureAccess -> TextureAccess Source #

min :: TextureAccess -> TextureAccess -> TextureAccess Source #

FromNumber TextureAccess CInt Source # |
Instance details Defined in SDL.Video.Renderer Methods fromNumber :: CInt -> TextureAccess Source #
ToNumber TextureAccess CInt Source # |
Instance details Defined in SDL.Video.Renderer Methods toNumber :: TextureAccess -> CInt Source #
type Rep TextureAccess Source # |

Instance details

Defined in SDL.Video.Renderer

type Rep TextureAccess = D1 ('MetaData "TextureAccess" "SDL.Video.Renderer" "sdl2-2.5.5.0-1rHVQtCfQoNJ4T4oR9opIh" 'False) (C1 ('MetaCons "TextureAccessStatic" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "TextureAccessStreaming" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "TextureAccessTarget" 'PrefixI 'False) (U1 :: Type -> Type)))

createTextureFromSurface Source #

Arguments

:: (Functor m, MonadIO m) |
=> Renderer | The rendering context
-> Surface | The surface containing pixel data used to fill the texture
-> m Texture |

Create a texture from an existing surface.

See `SDL_CreateTextureFromSurface` for C documentation.

updateTexture Source #

Arguments

:: (Functor m, MonadIO m) |
=> Texture | The `Texture` to be updated
-> Maybe (Rectangle CInt) | The area to update, Nothing for entire texture
-> ByteString | The raw pixel data
-> CInt | The number of bytes in a row of pixel data, including padding between lines
-> m () |

Updates texture rectangle with new pixel data.

See `SDL_UpdateTexture` for C documentation.

destroyTexture :: MonadIO m => Texture -> m () Source #

Destroy the specified texture.

See `SDL_DestroyTexture` for the C documentation.

glBindTexture Source #

Arguments

:: (Functor m, MonadIO m) |
=> Texture | The texture to bind to the current OpenGL/ES/ES2 context
-> m () |

Bind an OpenGL/ES/ES2 texture to the current context for use with when rendering OpenGL primitives directly.

See `SDL_GL_BindTexture` for C documentation.

glUnbindTexture Source #

Arguments

:: (Functor m, MonadIO m) |
=> Texture | The texture to unbind from the current OpenGL/ES/ES2 context
-> m () |

Unbind an OpenGL/ES/ES2 texture from the current context.

See `SDL_GL_UnbindTexture` for C documentation.

## `Texture` State

textureAlphaMod :: Texture -> StateVar Word8 Source #

Get or set the additional alpha value multiplied into render copy operations.

This `StateVar` can be modified using `$=` and the current value retrieved with `get`.

See `SDL_SetTextureAlphaMod` and `SDL_GetTextureAlphaMod` for C documentation.

textureBlendMode :: Texture -> StateVar BlendMode Source #

Get or set the blend mode used for texture copy operations.

This `StateVar` can be modified using `$=` and the current value retrieved with `get`.

See `SDL_SetTextureBlendMode` and `SDL_GetTextureBlendMode` for C documentation.

data BlendMode Source #

Blend modes used in `copy` and drawing operations.

Constructors

BlendNone | No blending

BlendAlphaBlend

Alpha blending.

    dstRGB = (srcRGB * srcA) + (dstRGB * (1-srcA))
    dstA = srcA + (dstA * (1-srcA))

BlendAdditive

Additive blending

    dstRGB = (srcRGB * srcA) + dstRGB
    dstA = dstA

BlendMod | Color modulate @ dstRGB = srcRGB * dstRGB dstA = dstA

#### Instances

Instances details

Data BlendMode Source # |

Instance details

Defined in SDL.Video.Renderer

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> BlendMode -> c BlendMode Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c BlendMode Source #

toConstr :: BlendMode -> Constr Source #

dataTypeOf :: BlendMode -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c BlendMode) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c BlendMode) Source #

gmapT :: (forall b. Data b => b -> b) -> BlendMode -> BlendMode Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> BlendMode -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> BlendMode -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> BlendMode -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> BlendMode -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> BlendMode -> m BlendMode Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> BlendMode -> m BlendMode Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> BlendMode -> m BlendMode Source #

Bounded BlendMode Source # |
Instance details Defined in SDL.Video.Renderer Methods minBound :: BlendMode Source # maxBound :: BlendMode Source #
Enum BlendMode Source # |

Instance details

Defined in SDL.Video.Renderer

Methods

succ :: BlendMode -> BlendMode Source #

pred :: BlendMode -> BlendMode Source #

toEnum :: Int -> BlendMode Source #

fromEnum :: BlendMode -> Int Source #

enumFrom :: BlendMode -> [BlendMode] Source #

enumFromThen :: BlendMode -> BlendMode -> [BlendMode] Source #

enumFromTo :: BlendMode -> BlendMode -> [BlendMode] Source #

enumFromThenTo :: BlendMode -> BlendMode -> BlendMode -> [BlendMode] Source #

Generic BlendMode Source # |
Instance details Defined in SDL.Video.Renderer Associated Types type Rep BlendMode :: Type -> Type Source # Methods from :: BlendMode -> Rep BlendMode x Source # to :: Rep BlendMode x -> BlendMode Source #
Read BlendMode Source # |
Instance details Defined in SDL.Video.Renderer Methods readsPrec :: Int -> ReadS BlendMode Source # readList :: ReadS [BlendMode] Source # readPrec :: ReadPrec BlendMode Source # readListPrec :: ReadPrec [BlendMode] Source #
Show BlendMode Source # |
Instance details Defined in SDL.Video.Renderer Methods showsPrec :: Int -> BlendMode -> ShowS Source # show :: BlendMode -> String Source # showList :: [BlendMode] -> ShowS Source #
Eq BlendMode Source # |
Instance details Defined in SDL.Video.Renderer Methods (==) :: BlendMode -> BlendMode -> Bool Source # (/=) :: BlendMode -> BlendMode -> Bool Source #
Ord BlendMode Source # |

Instance details

Defined in SDL.Video.Renderer

Methods

compare :: BlendMode -> BlendMode -> Ordering Source #

(<) :: BlendMode -> BlendMode -> Bool Source #

(<=) :: BlendMode -> BlendMode -> Bool Source #

(>) :: BlendMode -> BlendMode -> Bool Source #

(>=) :: BlendMode -> BlendMode -> Bool Source #

max :: BlendMode -> BlendMode -> BlendMode Source #

min :: BlendMode -> BlendMode -> BlendMode Source #

FromNumber BlendMode Word32 Source # |
Instance details Defined in SDL.Video.Renderer Methods fromNumber :: Word32 -> BlendMode Source #
ToNumber BlendMode Word32 Source # |
Instance details Defined in SDL.Video.Renderer Methods toNumber :: BlendMode -> Word32 Source #
type Rep BlendMode Source # |

Instance details

Defined in SDL.Video.Renderer

type Rep BlendMode = D1 ('MetaData "BlendMode" "SDL.Video.Renderer" "sdl2-2.5.5.0-1rHVQtCfQoNJ4T4oR9opIh" 'False) ((C1 ('MetaCons "BlendNone" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "BlendAlphaBlend" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "BlendAdditive" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "BlendMod" 'PrefixI 'False) (U1 :: Type -> Type)))

textureColorMod :: Texture -> StateVar (V3 Word8) Source #

Get or set the additional color value multiplied into render copy operations.

This `StateVar` can be modified using `$=` and the current value retrieved with `get`.

See `SDL_SetTextureColorMod` and `SDL_GetTextureColorMod` for C documentation.

## Accessing `Texture` Data

lockTexture Source #

Arguments

:: MonadIO m |
=> Texture | The `Texture` to lock for access, which must have been created with `TextureAccessStreaming`
-> Maybe (Rectangle CInt) | The area to lock for access; `Nothing` to lock the entire texture
-> m (Ptr (), CInt) | A pointer to the locked pixels, appropriately offset by the locked area, and the pitch of the locked pixels (the pitch is the length of one row in bytes).

Lock a portion of the texture for *write-only* pixel access.

See `SDL_LockTexture` for C documentation.

unlockTexture :: MonadIO m => Texture -> m () Source #

Unlock a texture, uploading the changes to video memory, if needed.

Warning: See Bug No. 1586 before using this function!

See `SDL_UnlockTexture` for C documentation.

queryTexture :: MonadIO m => Texture -> m TextureInfo Source #

Query the attributes of a texture.

See `SDL_QueryTexture` for C documentation.

data TextureInfo Source #

Constructors

TextureInfo |

Fields

- texturePixelFormat :: PixelFormat

  Raw format of the texture; the actual format may differ, but pixel transfers will use this format

- textureAccess :: TextureAccess

  The access available to the texture

- textureWidth :: CInt

  The width of the texture

- textureHeight :: CInt

  The height of the texture

#### Instances

Instances details

Generic TextureInfo Source # |
Instance details Defined in SDL.Video.Renderer Associated Types type Rep TextureInfo :: Type -> Type Source # Methods from :: TextureInfo -> Rep TextureInfo x Source # to :: Rep TextureInfo x -> TextureInfo Source #
Read TextureInfo Source # |
Instance details Defined in SDL.Video.Renderer Methods readsPrec :: Int -> ReadS TextureInfo Source # readList :: ReadS [TextureInfo] Source # readPrec :: ReadPrec TextureInfo Source # readListPrec :: ReadPrec [TextureInfo] Source #
Show TextureInfo Source # |
Instance details Defined in SDL.Video.Renderer Methods showsPrec :: Int -> TextureInfo -> ShowS Source # show :: TextureInfo -> String Source # showList :: [TextureInfo] -> ShowS Source #
Eq TextureInfo Source # |
Instance details Defined in SDL.Video.Renderer Methods (==) :: TextureInfo -> TextureInfo -> Bool Source # (/=) :: TextureInfo -> TextureInfo -> Bool Source #
Ord TextureInfo Source # |

Instance details

Defined in SDL.Video.Renderer

Methods

compare :: TextureInfo -> TextureInfo -> Ordering Source #

(<) :: TextureInfo -> TextureInfo -> Bool Source #

(<=) :: TextureInfo -> TextureInfo -> Bool Source #

(>) :: TextureInfo -> TextureInfo -> Bool Source #

(>=) :: TextureInfo -> TextureInfo -> Bool Source #

max :: TextureInfo -> TextureInfo -> TextureInfo Source #

min :: TextureInfo -> TextureInfo -> TextureInfo Source #

type Rep TextureInfo Source # |

Instance details

Defined in SDL.Video.Renderer

type Rep TextureInfo = D1 ('MetaData "TextureInfo" "SDL.Video.Renderer" "sdl2-2.5.5.0-1rHVQtCfQoNJ4T4oR9opIh" 'False) (C1 ('MetaCons "TextureInfo" 'PrefixI 'True) ((S1 ('MetaSel ('Just "texturePixelFormat") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PixelFormat) :*: S1 ('MetaSel ('Just "textureAccess") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 TextureAccess)) :*: (S1 ('MetaSel ('Just "textureWidth") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 CInt) :*: S1 ('MetaSel ('Just "textureHeight") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 CInt))))

data Rectangle a Source #

Constructors

Rectangle (Point V2 a) (V2 a) |

#### Instances

Instances details

Functor Rectangle Source # |
Instance details Defined in SDL.Video.Renderer Methods fmap :: (a -> b) -> Rectangle a -> Rectangle b Source # (<$) :: a -> Rectangle b -> Rectangle a Source #
Storable a => Storable (Rectangle a) Source # |

Instance details

Defined in SDL.Video.Renderer

Methods

sizeOf :: Rectangle a -> Int Source #

alignment :: Rectangle a -> Int Source #

peekElemOff :: Ptr (Rectangle a) -> Int -> IO (Rectangle a) Source #

pokeElemOff :: Ptr (Rectangle a) -> Int -> Rectangle a -> IO () Source #

peekByteOff :: Ptr b -> Int -> IO (Rectangle a) Source #

pokeByteOff :: Ptr b -> Int -> Rectangle a -> IO () Source #

peek :: Ptr (Rectangle a) -> IO (Rectangle a) Source #

poke :: Ptr (Rectangle a) -> Rectangle a -> IO () Source #

Generic (Rectangle a) Source # |
Instance details Defined in SDL.Video.Renderer Associated Types type Rep (Rectangle a) :: Type -> Type Source # Methods from :: Rectangle a -> Rep (Rectangle a) x Source # to :: Rep (Rectangle a) x -> Rectangle a Source #
Read a => Read (Rectangle a) Source # |
Instance details Defined in SDL.Video.Renderer Methods readsPrec :: Int -> ReadS (Rectangle a) Source # readList :: ReadS [Rectangle a] Source # readPrec :: ReadPrec (Rectangle a) Source # readListPrec :: ReadPrec [Rectangle a] Source #
Show a => Show (Rectangle a) Source # |
Instance details Defined in SDL.Video.Renderer Methods showsPrec :: Int -> Rectangle a -> ShowS Source # show :: Rectangle a -> String Source # showList :: [Rectangle a] -> ShowS Source #
Eq a => Eq (Rectangle a) Source # |
Instance details Defined in SDL.Video.Renderer Methods (==) :: Rectangle a -> Rectangle a -> Bool Source # (/=) :: Rectangle a -> Rectangle a -> Bool Source #
Ord a => Ord (Rectangle a) Source # |

Instance details

Defined in SDL.Video.Renderer

Methods

compare :: Rectangle a -> Rectangle a -> Ordering Source #

(<) :: Rectangle a -> Rectangle a -> Bool Source #

(<=) :: Rectangle a -> Rectangle a -> Bool Source #

(>) :: Rectangle a -> Rectangle a -> Bool Source #

(>=) :: Rectangle a -> Rectangle a -> Bool Source #

max :: Rectangle a -> Rectangle a -> Rectangle a Source #

min :: Rectangle a -> Rectangle a -> Rectangle a Source #

type Rep (Rectangle a) Source # |

Instance details

Defined in SDL.Video.Renderer

type Rep (Rectangle a) = D1 ('MetaData "Rectangle" "SDL.Video.Renderer" "sdl2-2.5.5.0-1rHVQtCfQoNJ4T4oR9opIh" 'False) (C1 ('MetaCons "Rectangle" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Point V2 a)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (V2 a))))

# Available `Renderer`s

These functions allow you to query the current system for available `Renderer`s that can be created with `createRenderer`.

getRendererInfo :: MonadIO m => Renderer -> m RendererInfo Source #

Get information about a rendering context.

See `SDL_GetRendererInfo` for C documentation.

data RendererInfo Source #

Information about an instantiated `Renderer`.

Constructors

RendererInfo |

Fields

- rendererInfoName :: Text

  The name of the renderer

- rendererInfoFlags :: RendererConfig

  Supported renderer features

- rendererInfoNumTextureFormats :: Word32

  The number of available texture formats

- rendererInfoTextureFormats :: [PixelFormat]

  The available texture formats

- rendererInfoMaxTextureWidth :: CInt

  The maximum texture width

- rendererInfoMaxTextureHeight :: CInt

  The maximum texture height

#### Instances

Instances details

Generic RendererInfo Source # |
Instance details Defined in SDL.Video.Renderer Associated Types type Rep RendererInfo :: Type -> Type Source # Methods from :: RendererInfo -> Rep RendererInfo x Source # to :: Rep RendererInfo x -> RendererInfo Source #
Read RendererInfo Source # |
Instance details Defined in SDL.Video.Renderer Methods readsPrec :: Int -> ReadS RendererInfo Source # readList :: ReadS [RendererInfo] Source # readPrec :: ReadPrec RendererInfo Source # readListPrec :: ReadPrec [RendererInfo] Source #
Show RendererInfo Source # |
Instance details Defined in SDL.Video.Renderer Methods showsPrec :: Int -> RendererInfo -> ShowS Source # show :: RendererInfo -> String Source # showList :: [RendererInfo] -> ShowS Source #
Eq RendererInfo Source # |
Instance details Defined in SDL.Video.Renderer Methods (==) :: RendererInfo -> RendererInfo -> Bool Source # (/=) :: RendererInfo -> RendererInfo -> Bool Source #
Ord RendererInfo Source # |

Instance details

Defined in SDL.Video.Renderer

Methods

compare :: RendererInfo -> RendererInfo -> Ordering Source #

(<) :: RendererInfo -> RendererInfo -> Bool Source #

(<=) :: RendererInfo -> RendererInfo -> Bool Source #

(>) :: RendererInfo -> RendererInfo -> Bool Source #

(>=) :: RendererInfo -> RendererInfo -> Bool Source #

max :: RendererInfo -> RendererInfo -> RendererInfo Source #

min :: RendererInfo -> RendererInfo -> RendererInfo Source #

type Rep RendererInfo Source # |

Instance details

Defined in SDL.Video.Renderer

type Rep RendererInfo = D1 ('MetaData "RendererInfo" "SDL.Video.Renderer" "sdl2-2.5.5.0-1rHVQtCfQoNJ4T4oR9opIh" 'False) (C1 ('MetaCons "RendererInfo" 'PrefixI 'True) ((S1 ('MetaSel ('Just "rendererInfoName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: (S1 ('MetaSel ('Just "rendererInfoFlags") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 RendererConfig) :*: S1 ('MetaSel ('Just "rendererInfoNumTextureFormats") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word32))) :*: (S1 ('MetaSel ('Just "rendererInfoTextureFormats") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [PixelFormat]) :*: (S1 ('MetaSel ('Just "rendererInfoMaxTextureWidth") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 CInt) :*: S1 ('MetaSel ('Just "rendererInfoMaxTextureHeight") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 CInt)))))

getRenderDriverInfo :: MonadIO m => m [RendererInfo] Source #

Enumerate all known render drivers on the system, and determine their supported features.

See `SDL_GetRenderDriverInfo` for C documentation.