    {-# LANGUAGE ScopedTypeVariables #-}
    {-# LANGUAGE CPP #-}
    {-# LANGUAGE DeriveDataTypeable #-}
    {-# LANGUAGE DeriveFunctor #-}
    {-# LANGUAGE DeriveGeneric #-}
    {-# LANGUAGE FlexibleContexts #-}
    {-# LANGUAGE MultiParamTypeClasses #-}
    {-# LANGUAGE OverloadedStrings #-}
    {-# LANGUAGE PatternSynonyms #-}

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

    module SDL.Video.Renderer
      ( Renderer

        -- * 'Renderer' Configuration
        -- | These configuration options can be used with 'SDL.Video.createRenderer' to create 'Renderer's.
      , RendererConfig(..)
      , defaultRenderer
      , RendererType(..)

      -- * Drawing Primitives
      , clear
      , copy
      , copyEx
      , drawLine
      , drawLines
      , drawPoint
      , drawPoints
      , drawRect
      , drawRects
      , fillRect
      , fillRects
    #ifdef RECENT_ISH
      , copyF
      , copyExF
      , drawLineF
      , drawLinesF
      , drawPointF
      , drawPointsF
      , drawRectF
      , drawRectsF
      , fillRectF
      , fillRectsF
      , renderGeometry
      , Raw.Vertex(..)
      , renderGeometryRaw
    #endif
      , present

      -- * '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
      , rendererDrawColor
      , rendererRenderTarget
      , rendererClipRect
      , rendererLogicalSize
      , rendererScale
      , rendererViewport
      , renderTargetSupported

      -- * 'Surface's
      , Surface(..)
      , updateWindowSurface
      , surfaceBlit
      , surfaceBlitScaled
      , surfaceFillRect
      , surfaceFillRects

      -- ** Creating and Destroying 'Surface's
      , convertSurface
      , createRGBSurface
      , createRGBSurfaceFrom
      , freeSurface
      , getWindowSurface
      , loadBMP

      -- ** 'Surface' state
      , surfaceColorKey
      , surfaceBlendMode
      , surfaceDimensions
      , surfaceFormat
      , surfacePixels

      -- ** Accessing 'Surface' Data
      , lockSurface
      , unlockSurface

      -- * 'Palette's and pixel formats
      , Palette
      , paletteNColors
      , paletteColors
      , paletteColor
      , PixelFormat(..)
      , SurfacePixelFormat(..)
      , formatPalette
      , setPaletteColors
      , pixelFormatToMasks
      , masksToPixelFormat

      -- * Textures
      , Texture

      -- ** Creating, Using and Destroying 'Texture's
      , createTexture
      , TextureAccess(..)
      , createTextureFromSurface
      , updateTexture
      , destroyTexture
      , glBindTexture
      , glUnbindTexture

      -- ** 'Texture' State
      , textureAlphaMod
      , textureBlendMode
      , BlendMode(..)
      , textureColorMod

      -- ** Accessing 'Texture' Data
      , lockTexture
      , unlockTexture
      , queryTexture
      , TextureInfo(..)

      , Rectangle(..)

      -- * Available 'Renderer's
      -- | These functions allow you to query the current system for available 'Renderer's that can be created
      -- with 'SDL.Video.createRenderer'.
      , getRendererInfo
      , RendererInfo(..)
      , getRenderDriverInfo
      ) where

    import Control.Monad.IO.Class (MonadIO, liftIO)
    import Data.Bits
    import Data.Data (Data)
    import Data.Foldable
    import Data.StateVar
    import Data.Text (Text)
    import Data.Typeable
    import Data.Word
    import Foreign.C.String
    import Foreign.C.Types
    import Foreign.ForeignPtr
    import Foreign.Marshal.Alloc
    import Foreign.Marshal.Utils
    import Foreign.Ptr
    import Foreign.Storable
    import GHC.Generics (Generic)
    import Prelude hiding (foldr)
    import SDL.Vect
    import SDL.Internal.Exception
    import SDL.Internal.Numbered
    import SDL.Internal.Types
    import qualified Data.ByteString as BS
    import qualified Data.ByteString.Internal as BSI
    import qualified Data.Text.Encoding as Text
    import qualified Data.Vector.Storable as SV
    import qualified Data.Vector.Storable.Mutable as MSV
    import qualified SDL.Raw as Raw

    #if !MIN_VERSION_base(4,8,0)
    import Control.Applicative
    import Data.Traversable
    #endif

    -- | Perform a fast surface copy to a destination surface.
    --
    -- See @<https://wiki.libsdl.org/SDL_BlitSurface SDL_BlitSurface>@ for C documentation.
    surfaceBlit :: 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))
    surfaceBlit :: forall (m :: Type -> Type).
    MonadIO m =>
    Surface
    -> Maybe (Rectangle CInt)
    -> Surface
    -> Maybe (Point V2 CInt)
    -> m (Maybe (Rectangle CInt))
    surfaceBlit (Surface Ptr Surface
    src Maybe (IOVector Word8)
    _) Maybe (Rectangle CInt)
    srcRect (Surface Ptr Surface
    dst Maybe (IOVector Word8)
    _) Maybe (Point V2 CInt)
    dstLoc = IO (Maybe (Rectangle CInt)) -> m (Maybe (Rectangle CInt))
    forall a. IO a -> m a
    forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
    liftIO (IO (Maybe (Rectangle CInt)) -> m (Maybe (Rectangle CInt)))
    -> IO (Maybe (Rectangle CInt)) -> m (Maybe (Rectangle CInt))
    forall a b. (a -> b) -> a -> b
    $
      (Rectangle CInt
     -> (Ptr (Rectangle CInt) -> IO (Maybe (Rectangle CInt)))
     -> IO (Maybe (Rectangle CInt)))
    -> Maybe (Rectangle CInt)
    -> (Ptr (Rectangle CInt) -> IO (Maybe (Rectangle CInt)))
    -> IO (Maybe (Rectangle CInt))
    forall a b c.
    (a -> (Ptr b -> IO c) -> IO c)
    -> Maybe a -> (Ptr b -> IO c) -> IO c
    maybeWith Rectangle CInt
    -> (Ptr (Rectangle CInt) -> IO (Maybe (Rectangle CInt)))
    -> IO (Maybe (Rectangle CInt))
    forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
    with Maybe (Rectangle CInt)
    srcRect ((Ptr (Rectangle CInt) -> IO (Maybe (Rectangle CInt)))
     -> IO (Maybe (Rectangle CInt)))
    -> (Ptr (Rectangle CInt) -> IO (Maybe (Rectangle CInt)))
    -> IO (Maybe (Rectangle CInt))
    forall a b. (a -> b) -> a -> b
    $ \Ptr (Rectangle CInt)
    srcPtr ->
      (Rectangle CInt
     -> (Ptr (Rectangle CInt) -> IO (Maybe (Rectangle CInt)))
     -> IO (Maybe (Rectangle CInt)))
    -> Maybe (Rectangle CInt)
    -> (Ptr (Rectangle CInt) -> IO (Maybe (Rectangle CInt)))
    -> IO (Maybe (Rectangle CInt))
    forall a b c.
    (a -> (Ptr b -> IO c) -> IO c)
    -> Maybe a -> (Ptr b -> IO c) -> IO c
    maybeWith Rectangle CInt
    -> (Ptr (Rectangle CInt) -> IO (Maybe (Rectangle CInt)))
    -> IO (Maybe (Rectangle CInt))
    forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
    with ((Point V2 CInt -> Rectangle CInt)
    -> Maybe (Point V2 CInt) -> Maybe (Rectangle CInt)
    forall a b. (a -> b) -> Maybe a -> Maybe b
    forall (f :: Type -> Type) a b. Functor f => (a -> b) -> f a -> f b
    fmap ((Point V2 CInt -> V2 CInt -> Rectangle CInt)
    -> V2 CInt -> Point V2 CInt -> Rectangle CInt
    forall a b c. (a -> b -> c) -> b -> a -> c
    flip Point V2 CInt -> V2 CInt -> Rectangle CInt
    forall a. Point V2 a -> V2 a -> Rectangle a
    Rectangle V2 CInt
    0) Maybe (Point V2 CInt)
    dstLoc) ((Ptr (Rectangle CInt) -> IO (Maybe (Rectangle CInt)))
     -> IO (Maybe (Rectangle CInt)))
    -> (Ptr (Rectangle CInt) -> IO (Maybe (Rectangle CInt)))
    -> IO (Maybe (Rectangle CInt))
    forall a b. (a -> b) -> a -> b
    $ \Ptr (Rectangle CInt)
    dstPtr -> do
          CInt
    _ <- Text -> Text -> IO CInt -> IO CInt
    forall (m :: Type -> Type) a.
    (MonadIO m, Num a, Ord a) =>
    Text -> Text -> m a -> m a
    throwIfNeg Text
    "SDL.Video.blitSurface" Text
    "SDL_BlitSurface" (IO CInt -> IO CInt) -> IO CInt -> IO CInt
    forall a b. (a -> b) -> a -> b
    $
               Ptr Surface -> Ptr Rect -> Ptr Surface -> Ptr Rect -> IO CInt
    forall (m :: Type -> Type).
    MonadIO m =>
    Ptr Surface -> Ptr Rect -> Ptr Surface -> Ptr Rect -> m CInt
    Raw.blitSurface Ptr Surface
    src (Ptr (Rectangle CInt) -> Ptr Rect
    forall a b. Ptr a -> Ptr b
    castPtr Ptr (Rectangle CInt)
    srcPtr) Ptr Surface
    dst (Ptr (Rectangle CInt) -> Ptr Rect
    forall a b. Ptr a -> Ptr b
    castPtr Ptr (Rectangle CInt)
    dstPtr)
          IO (Maybe (Rectangle CInt))
    -> (Point V2 CInt -> IO (Maybe (Rectangle CInt)))
    -> Maybe (Point V2 CInt)
    -> IO (Maybe (Rectangle CInt))
    forall b a. b -> (a -> b) -> Maybe a -> b
    maybe (Maybe (Rectangle CInt) -> IO (Maybe (Rectangle CInt))
    forall a. a -> IO a
    forall (f :: Type -> Type) a. Applicative f => a -> f a
    pure Maybe (Rectangle CInt)
    forall a. Maybe a
    Nothing) (\Point V2 CInt
    _ -> Rectangle CInt -> Maybe (Rectangle CInt)
    forall a. a -> Maybe a
    Just (Rectangle CInt -> Maybe (Rectangle CInt))
    -> IO (Rectangle CInt) -> IO (Maybe (Rectangle CInt))
    forall (f :: Type -> Type) a b. Functor f => (a -> b) -> f a -> f b
    <$> Ptr (Rectangle CInt) -> IO (Rectangle CInt)
    forall a. Storable a => Ptr a -> IO a
    peek Ptr (Rectangle CInt)
    dstPtr) Maybe (Point V2 CInt)
    dstLoc

    -- | Create a texture for a rendering context.
    --
    -- See @<https://wiki.libsdl.org/SDL_CreateTexture SDL_CreateTexture>@ for C documentation.
    createTexture :: (Functor m,MonadIO m)
                  => Renderer -- ^ The rendering context.
                  -> PixelFormat
                  -> TextureAccess
                  -> V2 CInt -- ^ The size of the texture.
                  -> m Texture
    createTexture :: forall (m :: Type -> Type).
    (Functor m, MonadIO m) =>
    Renderer -> PixelFormat -> TextureAccess -> V2 CInt -> m Texture
    createTexture (Renderer Renderer
    r) PixelFormat
    fmt TextureAccess
    access (V2 CInt
    w CInt
    h) =
      (Renderer -> Texture) -> m Renderer -> m Texture
    forall a b. (a -> b) -> m a -> m b
    forall (f :: Type -> Type) a b. Functor f => (a -> b) -> f a -> f b
    fmap Renderer -> Texture
    Texture (m Renderer -> m Texture) -> m Renderer -> m Texture
    forall a b. (a -> b) -> a -> b
    $
      Text -> Text -> m Renderer -> m Renderer
    forall (m :: Type -> Type) a.
    MonadIO m =>
    Text -> Text -> m (Ptr a) -> m (Ptr a)
    throwIfNull Text
    "SDL.Video.Renderer.createTexture" Text
    "SDL_CreateTexture" (m Renderer -> m Renderer) -> m Renderer -> m Renderer
    forall a b. (a -> b) -> a -> b
    $
      Renderer -> BlendMode -> CInt -> CInt -> CInt -> m Renderer
    forall (m :: Type -> Type).
    MonadIO m =>
    Renderer -> BlendMode -> CInt -> CInt -> CInt -> m Renderer
    Raw.createTexture Renderer
    r (PixelFormat -> BlendMode
    forall a b. ToNumber a b => a -> b
    toNumber PixelFormat
    fmt) (TextureAccess -> CInt
    forall a b. ToNumber a b => a -> b
    toNumber TextureAccess
    access) CInt
    w CInt
    h

    -- | Create a texture from an existing surface.
    --
    -- See @<https://wiki.libsdl.org/SDL_CreateTextureFromSurface SDL_CreateTextureFromSurface>@ for C documentation.
    createTextureFromSurface :: (Functor m,MonadIO m)
                             => Renderer -- ^ The rendering context
                             -> Surface -- ^ The surface containing pixel data used to fill the texture
                             -> m Texture
    createTextureFromSurface :: forall (m :: Type -> Type).
    (Functor m, MonadIO m) =>
    Renderer -> Surface -> m Texture
    createTextureFromSurface (Renderer Renderer
    r) (Surface Ptr Surface
    s Maybe (IOVector Word8)
    _) =
      (Renderer -> Texture) -> m Renderer -> m Texture
    forall a b. (a -> b) -> m a -> m b
    forall (f :: Type -> Type) a b. Functor f => (a -> b) -> f a -> f b
    fmap Renderer -> Texture
    Texture (m Renderer -> m Texture) -> m Renderer -> m Texture
    forall a b. (a -> b) -> a -> b
    $
      Text -> Text -> m Renderer -> m Renderer
    forall (m :: Type -> Type) a.
    MonadIO m =>
    Text -> Text -> m (Ptr a) -> m (Ptr a)
    throwIfNull Text
    "SDL.Video.createTextureFromSurface" Text
    "SDL_CreateTextureFromSurface" (m Renderer -> m Renderer) -> m Renderer -> m Renderer
    forall a b. (a -> b) -> a -> b
    $
      Renderer -> Ptr Surface -> m Renderer
    forall (m :: Type -> Type).
    MonadIO m =>
    Renderer -> Ptr Surface -> m Renderer
    Raw.createTextureFromSurface Renderer
    r Ptr Surface
    s

    -- | Bind an OpenGL\/ES\/ES2 texture to the current context for use with when rendering OpenGL primitives directly.
    --
    -- See @<https://wiki.libsdl.org/SDL_GL_BindTexture SDL_GL_BindTexture>@ for C documentation.
    glBindTexture :: (Functor m,MonadIO m)
                  => Texture -- ^ The texture to bind to the current OpenGL\/ES\/ES2 context
                  -> m ()
    glBindTexture :: forall (m :: Type -> Type).
    (Functor m, MonadIO m) =>
    Texture -> m ()
    glBindTexture (Texture Renderer
    t) =
      Text -> Text -> m CInt -> m ()
    forall (m :: Type -> Type) a.
    (MonadIO m, Num a, Ord a) =>
    Text -> Text -> m a -> m ()
    throwIfNeg_ Text
    "SDL.Video.Renderer.glBindTexture" Text
    "SDL_GL_BindTexture" (m CInt -> m ()) -> m CInt -> m ()
    forall a b. (a -> b) -> a -> b
    $
      Renderer -> Ptr CFloat -> Ptr CFloat -> m CInt
    forall (m :: Type -> Type).
    MonadIO m =>
    Renderer -> Ptr CFloat -> Ptr CFloat -> m CInt
    Raw.glBindTexture Renderer
    t Ptr CFloat
    forall a. Ptr a
    nullPtr Ptr CFloat
    forall a. Ptr a
    nullPtr

    -- | Unbind an OpenGL\/ES\/ES2 texture from the current context.
    --
    -- See @<https://wiki.libsdl.org/SDL_GL_UnbindTexture SDL_GL_UnbindTexture>@ for C documentation.
    glUnbindTexture :: (Functor m,MonadIO m)
                    => Texture -- ^ The texture to unbind from the current OpenGL\/ES\/ES2 context
                    -> m ()
    glUnbindTexture :: forall (m :: Type -> Type).
    (Functor m, MonadIO m) =>
    Texture -> m ()
    glUnbindTexture (Texture Renderer
    t) =
      Text -> Text -> m CInt -> m ()
    forall (m :: Type -> Type) a.
    (MonadIO m, Num a, Ord a) =>
    Text -> Text -> m a -> m ()
    throwIfNeg_ Text
    "SDL.Video.Renderer.glUnindTexture" Text
    "SDL_GL_UnbindTexture" (m CInt -> m ()) -> m CInt -> m ()
    forall a b. (a -> b) -> a -> b
    $
      Renderer -> m CInt
    forall (m :: Type -> Type). MonadIO m => Renderer -> m CInt
    Raw.glUnbindTexture Renderer
    t

    -- | Updates texture rectangle with new pixel data.
    --
    -- See @<https://wiki.libsdl.org/SDL_UpdateTexture SDL_UpdateTexture>@ for C documentation.
    updateTexture :: (Functor m, MonadIO m)
                  => Texture -- ^ The 'Texture' to be updated
                  -> Maybe (Rectangle CInt) -- ^ The area to update, Nothing for entire texture
                  -> BS.ByteString -- ^ The raw pixel data
                  -> CInt -- ^ The number of bytes in a row of pixel data, including padding between lines
                  -> m ()
    updateTexture :: forall (m :: Type -> Type).
    (Functor m, MonadIO m) =>
    Texture -> Maybe (Rectangle CInt) -> ByteString -> CInt -> m ()
    updateTexture (Texture Renderer
    t) Maybe (Rectangle CInt)
    rect ByteString
    pixels CInt
    pitch = do
      IO () -> m ()
    forall a. IO a -> m a
    forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
    liftIO (IO () -> m ()) -> IO () -> m ()
    forall a b. (a -> b) -> a -> b
    $ Text -> Text -> IO CInt -> IO ()
    forall (m :: Type -> Type) a.
    (MonadIO m, Num a, Ord a) =>
    Text -> Text -> m a -> m ()
    throwIfNeg_ Text
    "SDL.Video.updateTexture" Text
    "SDL_UpdateTexture" (IO CInt -> IO ()) -> IO CInt -> IO ()
    forall a b. (a -> b) -> a -> b
    $
        (Rectangle CInt -> (Ptr (Rectangle CInt) -> IO CInt) -> IO CInt)
    -> Maybe (Rectangle CInt)
    -> (Ptr (Rectangle CInt) -> IO CInt)
    -> IO CInt
    forall a b c.
    (a -> (Ptr b -> IO c) -> IO c)
    -> Maybe a -> (Ptr b -> IO c) -> IO c
    maybeWith Rectangle CInt -> (Ptr (Rectangle CInt) -> IO CInt) -> IO CInt
    forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
    with Maybe (Rectangle CInt)
    rect ((Ptr (Rectangle CInt) -> IO CInt) -> IO CInt)
    -> (Ptr (Rectangle CInt) -> IO CInt) -> IO CInt
    forall a b. (a -> b) -> a -> b
    $ \Ptr (Rectangle CInt)
    rectPtr ->
          let (ForeignPtr Word8
    pixelForeign, Int
    _, Int
    _) = ByteString -> (ForeignPtr Word8, Int, Int)
    BSI.toForeignPtr ByteString
    pixels
          in ForeignPtr Word8 -> (Ptr Word8 -> IO CInt) -> IO CInt
    forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
    withForeignPtr ForeignPtr Word8
    pixelForeign ((Ptr Word8 -> IO CInt) -> IO CInt)
    -> (Ptr Word8 -> IO CInt) -> IO CInt
    forall a b. (a -> b) -> a -> b
    $ \Ptr Word8
    pixelsPtr ->
            Renderer -> Ptr Rect -> Renderer -> CInt -> IO CInt
    forall (m :: Type -> Type).
    MonadIO m =>
    Renderer -> Ptr Rect -> Renderer -> CInt -> m CInt
    Raw.updateTexture Renderer
    t (Ptr (Rectangle CInt) -> Ptr Rect
    forall a b. Ptr a -> Ptr b
    castPtr Ptr (Rectangle CInt)
    rectPtr) (Ptr Word8 -> Renderer
    forall a b. Ptr a -> Ptr b
    castPtr Ptr Word8
    pixelsPtr) CInt
    pitch

    -- | Destroy the specified texture.
    --
    -- See @<https://wiki.libsdl.org/SDL_DestroyTexture SDL_DestroyTexture>@ for the C documentation.
    destroyTexture :: MonadIO m => Texture -> m ()
    destroyTexture :: forall (m :: Type -> Type). MonadIO m => Texture -> m ()
    destroyTexture (Texture Renderer
    t) = Renderer -> m ()
    forall (m :: Type -> Type). MonadIO m => Renderer -> m ()
    Raw.destroyTexture Renderer
    t

    -- | Lock a portion of the texture for *write-only* pixel access.
    --
    -- See @<https://wiki.libsdl.org/SDL_LockTexture SDL_LockTexture>@ for C documentation.
    lockTexture :: 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).
    lockTexture :: forall (m :: Type -> Type).
    MonadIO m =>
    Texture -> Maybe (Rectangle CInt) -> m (Renderer, CInt)
    lockTexture (Texture Renderer
    t) Maybe (Rectangle CInt)
    rect = IO (Renderer, CInt) -> m (Renderer, CInt)
    forall a. IO a -> m a
    forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
    liftIO (IO (Renderer, CInt) -> m (Renderer, CInt))
    -> IO (Renderer, CInt) -> m (Renderer, CInt)
    forall a b. (a -> b) -> a -> b
    $
      (Ptr Renderer -> IO (Renderer, CInt)) -> IO (Renderer, CInt)
    forall a b. Storable a => (Ptr a -> IO b) -> IO b
    alloca ((Ptr Renderer -> IO (Renderer, CInt)) -> IO (Renderer, CInt))
    -> (Ptr Renderer -> IO (Renderer, CInt)) -> IO (Renderer, CInt)
    forall a b. (a -> b) -> a -> b
    $ \Ptr Renderer
    pixelsPtr ->
      (Ptr CInt -> IO (Renderer, CInt)) -> IO (Renderer, CInt)
    forall a b. Storable a => (Ptr a -> IO b) -> IO b
    alloca ((Ptr CInt -> IO (Renderer, CInt)) -> IO (Renderer, CInt))
    -> (Ptr CInt -> IO (Renderer, CInt)) -> IO (Renderer, CInt)
    forall a b. (a -> b) -> a -> b
    $ \Ptr CInt
    pitchPtr ->
      (Rectangle CInt
     -> (Ptr (Rectangle CInt) -> IO (Renderer, CInt))
     -> IO (Renderer, CInt))
    -> Maybe (Rectangle CInt)
    -> (Ptr (Rectangle CInt) -> IO (Renderer, CInt))
    -> IO (Renderer, CInt)
    forall a b c.
    (a -> (Ptr b -> IO c) -> IO c)
    -> Maybe a -> (Ptr b -> IO c) -> IO c
    maybeWith Rectangle CInt
    -> (Ptr (Rectangle CInt) -> IO (Renderer, CInt))
    -> IO (Renderer, CInt)
    forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
    with Maybe (Rectangle CInt)
    rect ((Ptr (Rectangle CInt) -> IO (Renderer, CInt))
     -> IO (Renderer, CInt))
    -> (Ptr (Rectangle CInt) -> IO (Renderer, CInt))
    -> IO (Renderer, CInt)
    forall a b. (a -> b) -> a -> b
    $ \Ptr (Rectangle CInt)
    rectPtr -> do
        Text -> Text -> IO CInt -> IO ()
    forall (m :: Type -> Type) a.
    (MonadIO m, Num a, Ord a) =>
    Text -> Text -> m a -> m ()
    throwIfNeg_ Text
    "lockTexture" Text
    "SDL_LockTexture" (IO CInt -> IO ()) -> IO CInt -> IO ()
    forall a b. (a -> b) -> a -> b
    $
          Renderer -> Ptr Rect -> Ptr Renderer -> Ptr CInt -> IO CInt
    forall (m :: Type -> Type).
    MonadIO m =>
    Renderer -> Ptr Rect -> Ptr Renderer -> Ptr CInt -> m CInt
    Raw.lockTexture Renderer
    t (Ptr (Rectangle CInt) -> Ptr Rect
    forall a b. Ptr a -> Ptr b
    castPtr Ptr (Rectangle CInt)
    rectPtr) Ptr Renderer
    pixelsPtr Ptr CInt
    pitchPtr
        Renderer
    pixels <- Ptr Renderer -> IO Renderer
    forall a. Storable a => Ptr a -> IO a
    peek Ptr Renderer
    pixelsPtr
        CInt
    pitch <- Ptr CInt -> IO CInt
    forall a. Storable a => Ptr a -> IO a
    peek Ptr CInt
    pitchPtr
        (Renderer, CInt) -> IO (Renderer, CInt)
    forall a. a -> IO a
    forall (m :: Type -> Type) a. Monad m => a -> m a
    return (Renderer
    pixels, CInt
    pitch)

    -- | Unlock a texture, uploading the changes to video memory, if needed.
    --
    -- /Warning/: See <https://bugzilla.libsdl.org/show_bug.cgi?id=1586 Bug No. 1586> before using this function!
    --
    -- See @<https://wiki.libsdl.org/SDL_UnlockTexture SDL_UnlockTexture>@ for C documentation.
    unlockTexture :: MonadIO m => Texture -> m ()
    unlockTexture :: forall (m :: Type -> Type). MonadIO m => Texture -> m ()
    unlockTexture (Texture Renderer
    t) = Renderer -> m ()
    forall (m :: Type -> Type). MonadIO m => Renderer -> m ()
    Raw.unlockTexture Renderer
    t

    -- | Set up a surface for directly accessing the pixels.
    --
    -- See @<https://wiki.libsdl.org/SDL_LockSurface SDL_LockSurface>@ for C documentation.
    lockSurface :: MonadIO m => Surface -> m ()
    lockSurface :: forall (m :: Type -> Type). MonadIO m => Surface -> m ()
    lockSurface (Surface Ptr Surface
    s Maybe (IOVector Word8)
    _) =
      Text -> Text -> m CInt -> m ()
    forall (m :: Type -> Type) a.
    (MonadIO m, Num a, Ord a) =>
    Text -> Text -> m a -> m ()
    throwIfNeg_ Text
    "lockSurface" Text
    "SDL_LockSurface" (m CInt -> m ()) -> m CInt -> m ()
    forall a b. (a -> b) -> a -> b
    $
        Ptr Surface -> m CInt
    forall (m :: Type -> Type). MonadIO m => Ptr Surface -> m CInt
    Raw.lockSurface Ptr Surface
    s

    -- | Release a surface after directly accessing the pixels.
    --
    -- See @<https://wiki.libsdl.org/SDL_UnlockSurface SDL_UnlockSurface>@ for C documentation.
    unlockSurface :: MonadIO m => Surface -> m ()
    unlockSurface :: forall (m :: Type -> Type). MonadIO m => Surface -> m ()
    unlockSurface (Surface Ptr Surface
    s Maybe (IOVector Word8)
    _) = Ptr Surface -> m ()
    forall (m :: Type -> Type). MonadIO m => Ptr Surface -> m ()
    Raw.unlockSurface Ptr Surface
    s

    -- | Information to the GPU about how you will use a texture.
    data TextureAccess
      = TextureAccessStatic
        -- ^ Changes rarely, cannot be locked
      | TextureAccessStreaming
        -- ^ changes frequently, can be locked
      | TextureAccessTarget
        -- ^ Can be used as a render target
      deriving (TextureAccess
    TextureAccess -> TextureAccess -> Bounded TextureAccess
    forall a. a -> a -> Bounded a
    $cminBound :: TextureAccess
    minBound :: TextureAccess
    $cmaxBound :: TextureAccess
    maxBound :: TextureAccess
    Bounded, Typeable TextureAccess
    Typeable TextureAccess
    -> (forall (c :: Type -> Type).
        (forall d b. Data d => c (d -> b) -> d -> c b)
        -> (forall g. g -> c g) -> TextureAccess -> c TextureAccess)
    -> (forall (c :: Type -> Type).
        (forall b r. Data b => c (b -> r) -> c r)
        -> (forall r. r -> c r) -> Constr -> c TextureAccess)
    -> (TextureAccess -> Constr)
    -> (TextureAccess -> DataType)
    -> (forall (t :: Type -> Type) (c :: Type -> Type).
        Typeable t =>
        (forall d. Data d => c (t d)) -> Maybe (c TextureAccess))
    -> (forall (t :: Type -> Type -> Type) (c :: Type -> Type).
        Typeable t =>
        (forall d e. (Data d, Data e) => c (t d e))
        -> Maybe (c TextureAccess))
    -> ((forall b. Data b => b -> b) -> TextureAccess -> TextureAccess)
    -> (forall r r'.
        (r -> r' -> r)
        -> r -> (forall d. Data d => d -> r') -> TextureAccess -> r)
    -> (forall r r'.
        (r' -> r -> r)
        -> r -> (forall d. Data d => d -> r') -> TextureAccess -> r)
    -> (forall u. (forall d. Data d => d -> u) -> TextureAccess -> [u])
    -> (forall u.
        Int -> (forall d. Data d => d -> u) -> TextureAccess -> u)
    -> (forall (m :: Type -> Type).
        Monad m =>
        (forall d. Data d => d -> m d) -> TextureAccess -> m TextureAccess)
    -> (forall (m :: Type -> Type).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> TextureAccess -> m TextureAccess)
    -> (forall (m :: Type -> Type).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> TextureAccess -> m TextureAccess)
    -> Data TextureAccess
    TextureAccess -> Constr
    TextureAccess -> DataType
    (forall b. Data b => b -> b) -> TextureAccess -> TextureAccess
    forall a.
    Typeable a
    -> (forall (c :: Type -> Type).
        (forall d b. Data d => c (d -> b) -> d -> c b)
        -> (forall g. g -> c g) -> a -> c a)
    -> (forall (c :: Type -> Type).
        (forall b r. Data b => c (b -> r) -> c r)
        -> (forall r. r -> c r) -> Constr -> c a)
    -> (a -> Constr)
    -> (a -> DataType)
    -> (forall (t :: Type -> Type) (c :: Type -> Type).
        Typeable t =>
        (forall d. Data d => c (t d)) -> Maybe (c a))
    -> (forall (t :: Type -> Type -> Type) (c :: Type -> Type).
        Typeable t =>
        (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
    -> ((forall b. Data b => b -> b) -> a -> a)
    -> (forall r r'.
        (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
    -> (forall r r'.
        (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
    -> (forall u. (forall d. Data d => d -> u) -> a -> [u])
    -> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
    -> (forall (m :: Type -> Type).
        Monad m =>
        (forall d. Data d => d -> m d) -> a -> m a)
    -> (forall (m :: Type -> Type).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> a -> m a)
    -> (forall (m :: Type -> Type).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> a -> m a)
    -> Data a
    forall u. Int -> (forall d. Data d => d -> u) -> TextureAccess -> u
    forall u. (forall d. Data d => d -> u) -> TextureAccess -> [u]
    forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> TextureAccess -> r
    forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> TextureAccess -> r
    forall (m :: Type -> Type).
    Monad m =>
    (forall d. Data d => d -> m d) -> TextureAccess -> m TextureAccess
    forall (m :: Type -> Type).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> TextureAccess -> m TextureAccess
    forall (c :: Type -> Type).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c TextureAccess
    forall (c :: Type -> Type).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> TextureAccess -> c TextureAccess
    forall (t :: Type -> Type) (c :: Type -> Type).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c TextureAccess)
    forall (t :: Type -> Type -> Type) (c :: Type -> Type).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c TextureAccess)
    $cgfoldl :: forall (c :: Type -> Type).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> TextureAccess -> c TextureAccess
    gfoldl :: forall (c :: Type -> Type).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> TextureAccess -> c TextureAccess
    $cgunfold :: forall (c :: Type -> Type).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c TextureAccess
    gunfold :: forall (c :: Type -> Type).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c TextureAccess
    $ctoConstr :: TextureAccess -> Constr
    toConstr :: TextureAccess -> Constr
    $cdataTypeOf :: TextureAccess -> DataType
    dataTypeOf :: TextureAccess -> DataType
    $cdataCast1 :: forall (t :: Type -> Type) (c :: Type -> Type).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c TextureAccess)
    dataCast1 :: forall (t :: Type -> Type) (c :: Type -> Type).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c TextureAccess)
    $cdataCast2 :: forall (t :: Type -> Type -> Type) (c :: Type -> Type).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c TextureAccess)
    dataCast2 :: forall (t :: Type -> Type -> Type) (c :: Type -> Type).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c TextureAccess)
    $cgmapT :: (forall b. Data b => b -> b) -> TextureAccess -> TextureAccess
    gmapT :: (forall b. Data b => b -> b) -> TextureAccess -> TextureAccess
    $cgmapQl :: forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> TextureAccess -> r
    gmapQl :: forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> TextureAccess -> r
    $cgmapQr :: forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> TextureAccess -> r
    gmapQr :: forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> TextureAccess -> r
    $cgmapQ :: forall u. (forall d. Data d => d -> u) -> TextureAccess -> [u]
    gmapQ :: forall u. (forall d. Data d => d -> u) -> TextureAccess -> [u]
    $cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> TextureAccess -> u
    gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> TextureAccess -> u
    $cgmapM :: forall (m :: Type -> Type).
    Monad m =>
    (forall d. Data d => d -> m d) -> TextureAccess -> m TextureAccess
    gmapM :: forall (m :: Type -> Type).
    Monad m =>
    (forall d. Data d => d -> m d) -> TextureAccess -> m TextureAccess
    $cgmapMp :: forall (m :: Type -> Type).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> TextureAccess -> m TextureAccess
    gmapMp :: forall (m :: Type -> Type).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> TextureAccess -> m TextureAccess
    $cgmapMo :: forall (m :: Type -> Type).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> TextureAccess -> m TextureAccess
    gmapMo :: forall (m :: Type -> Type).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> TextureAccess -> m TextureAccess
    Data, Int -> TextureAccess
    TextureAccess -> Int
    TextureAccess -> [TextureAccess]
    TextureAccess -> TextureAccess
    TextureAccess -> TextureAccess -> [TextureAccess]
    TextureAccess -> TextureAccess -> TextureAccess -> [TextureAccess]
    (TextureAccess -> TextureAccess)
    -> (TextureAccess -> TextureAccess)
    -> (Int -> TextureAccess)
    -> (TextureAccess -> Int)
    -> (TextureAccess -> [TextureAccess])
    -> (TextureAccess -> TextureAccess -> [TextureAccess])
    -> (TextureAccess -> TextureAccess -> [TextureAccess])
    -> (TextureAccess
        -> TextureAccess -> TextureAccess -> [TextureAccess])
    -> Enum TextureAccess
    forall a.
    (a -> a)
    -> (a -> a)
    -> (Int -> a)
    -> (a -> Int)
    -> (a -> [a])
    -> (a -> a -> [a])
    -> (a -> a -> [a])
    -> (a -> a -> a -> [a])
    -> Enum a
    $csucc :: TextureAccess -> TextureAccess
    succ :: TextureAccess -> TextureAccess
    $cpred :: TextureAccess -> TextureAccess
    pred :: TextureAccess -> TextureAccess
    $ctoEnum :: Int -> TextureAccess
    toEnum :: Int -> TextureAccess
    $cfromEnum :: TextureAccess -> Int
    fromEnum :: TextureAccess -> Int
    $cenumFrom :: TextureAccess -> [TextureAccess]
    enumFrom :: TextureAccess -> [TextureAccess]
    $cenumFromThen :: TextureAccess -> TextureAccess -> [TextureAccess]
    enumFromThen :: TextureAccess -> TextureAccess -> [TextureAccess]
    $cenumFromTo :: TextureAccess -> TextureAccess -> [TextureAccess]
    enumFromTo :: TextureAccess -> TextureAccess -> [TextureAccess]
    $cenumFromThenTo :: TextureAccess -> TextureAccess -> TextureAccess -> [TextureAccess]
    enumFromThenTo :: TextureAccess -> TextureAccess -> TextureAccess -> [TextureAccess]
    Enum, TextureAccess -> TextureAccess -> Bool
    (TextureAccess -> TextureAccess -> Bool)
    -> (TextureAccess -> TextureAccess -> Bool) -> Eq TextureAccess
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: TextureAccess -> TextureAccess -> Bool
    == :: TextureAccess -> TextureAccess -> Bool
    $c/= :: TextureAccess -> TextureAccess -> Bool
    /= :: TextureAccess -> TextureAccess -> Bool
    Eq, (forall x. TextureAccess -> Rep TextureAccess x)
    -> (forall x. Rep TextureAccess x -> TextureAccess)
    -> Generic TextureAccess
    forall x. Rep TextureAccess x -> TextureAccess
    forall x. TextureAccess -> Rep TextureAccess x
    forall a.
    (forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
    $cfrom :: forall x. TextureAccess -> Rep TextureAccess x
    from :: forall x. TextureAccess -> Rep TextureAccess x
    $cto :: forall x. Rep TextureAccess x -> TextureAccess
    to :: forall x. Rep TextureAccess x -> TextureAccess
    Generic, Eq TextureAccess
    Eq TextureAccess
    -> (TextureAccess -> TextureAccess -> Ordering)
    -> (TextureAccess -> TextureAccess -> Bool)
    -> (TextureAccess -> TextureAccess -> Bool)
    -> (TextureAccess -> TextureAccess -> Bool)
    -> (TextureAccess -> TextureAccess -> Bool)
    -> (TextureAccess -> TextureAccess -> TextureAccess)
    -> (TextureAccess -> TextureAccess -> TextureAccess)
    -> Ord TextureAccess
    TextureAccess -> TextureAccess -> Bool
    TextureAccess -> TextureAccess -> Ordering
    TextureAccess -> TextureAccess -> TextureAccess
    forall a.
    Eq a
    -> (a -> a -> Ordering)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> a)
    -> (a -> a -> a)
    -> Ord a
    $ccompare :: TextureAccess -> TextureAccess -> Ordering
    compare :: TextureAccess -> TextureAccess -> Ordering
    $c< :: TextureAccess -> TextureAccess -> Bool
    < :: TextureAccess -> TextureAccess -> Bool
    $c<= :: TextureAccess -> TextureAccess -> Bool
    <= :: TextureAccess -> TextureAccess -> Bool
    $c> :: TextureAccess -> TextureAccess -> Bool
    > :: TextureAccess -> TextureAccess -> Bool
    $c>= :: TextureAccess -> TextureAccess -> Bool
    >= :: TextureAccess -> TextureAccess -> Bool
    $cmax :: TextureAccess -> TextureAccess -> TextureAccess
    max :: TextureAccess -> TextureAccess -> TextureAccess
    $cmin :: TextureAccess -> TextureAccess -> TextureAccess
    min :: TextureAccess -> TextureAccess -> TextureAccess
    Ord, ReadPrec [TextureAccess]
    ReadPrec TextureAccess
    Int -> ReadS TextureAccess
    ReadS [TextureAccess]
    (Int -> ReadS TextureAccess)
    -> ReadS [TextureAccess]
    -> ReadPrec TextureAccess
    -> ReadPrec [TextureAccess]
    -> Read TextureAccess
    forall a.
    (Int -> ReadS a)
    -> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
    $creadsPrec :: Int -> ReadS TextureAccess
    readsPrec :: Int -> ReadS TextureAccess
    $creadList :: ReadS [TextureAccess]
    readList :: ReadS [TextureAccess]
    $creadPrec :: ReadPrec TextureAccess
    readPrec :: ReadPrec TextureAccess
    $creadListPrec :: ReadPrec [TextureAccess]
    readListPrec :: ReadPrec [TextureAccess]
    Read, Int -> TextureAccess -> ShowS
    [TextureAccess] -> ShowS
    TextureAccess -> [Char]
    (Int -> TextureAccess -> ShowS)
    -> (TextureAccess -> [Char])
    -> ([TextureAccess] -> ShowS)
    -> Show TextureAccess
    forall a.
    (Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> TextureAccess -> ShowS
    showsPrec :: Int -> TextureAccess -> ShowS
    $cshow :: TextureAccess -> [Char]
    show :: TextureAccess -> [Char]
    $cshowList :: [TextureAccess] -> ShowS
    showList :: [TextureAccess] -> ShowS
    Show, Typeable)

    instance FromNumber TextureAccess CInt where
      fromNumber :: CInt -> TextureAccess
    fromNumber CInt
    n' = case CInt
    n' of
        CInt
    Raw.SDL_TEXTUREACCESS_STATIC -> TextureAccess
    TextureAccessStatic
        CInt
    Raw.SDL_TEXTUREACCESS_STREAMING -> TextureAccess
    TextureAccessStreaming
        CInt
    Raw.SDL_TEXTUREACCESS_TARGET -> TextureAccess
    TextureAccessTarget
        CInt
    _ -> [Char] -> TextureAccess
    forall a. HasCallStack => [Char] -> a
    error [Char]
    "Unknown value"

    instance ToNumber TextureAccess CInt where
      toNumber :: TextureAccess -> CInt
    toNumber TextureAccess
    t = case TextureAccess
    t of
        TextureAccess
    TextureAccessStatic -> CInt
    forall {a}. (Eq a, Num a) => a
    Raw.SDL_TEXTUREACCESS_STATIC
        TextureAccess
    TextureAccessStreaming -> CInt
    forall {a}. (Eq a, Num a) => a
    Raw.SDL_TEXTUREACCESS_STREAMING
        TextureAccess
    TextureAccessTarget -> CInt
    forall {a}. (Eq a, Num a) => a
    Raw.SDL_TEXTUREACCESS_TARGET

    data TextureInfo = TextureInfo
      { TextureInfo -> PixelFormat
    texturePixelFormat :: PixelFormat
        -- ^ Raw format of the texture; the actual format may differ, but pixel transfers will use this format
      , TextureInfo -> TextureAccess
    textureAccess      :: TextureAccess
        -- ^ The access available to the texture
      , TextureInfo -> CInt
    textureWidth       :: CInt
        -- ^ The width of the texture
      , TextureInfo -> CInt
    textureHeight      :: CInt
        -- ^ The height of the texture
      } deriving (TextureInfo -> TextureInfo -> Bool
    (TextureInfo -> TextureInfo -> Bool)
    -> (TextureInfo -> TextureInfo -> Bool) -> Eq TextureInfo
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: TextureInfo -> TextureInfo -> Bool
    == :: TextureInfo -> TextureInfo -> Bool
    $c/= :: TextureInfo -> TextureInfo -> Bool
    /= :: TextureInfo -> TextureInfo -> Bool
    Eq, (forall x. TextureInfo -> Rep TextureInfo x)
    -> (forall x. Rep TextureInfo x -> TextureInfo)
    -> Generic TextureInfo
    forall x. Rep TextureInfo x -> TextureInfo
    forall x. TextureInfo -> Rep TextureInfo x
    forall a.
    (forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
    $cfrom :: forall x. TextureInfo -> Rep TextureInfo x
    from :: forall x. TextureInfo -> Rep TextureInfo x
    $cto :: forall x. Rep TextureInfo x -> TextureInfo
    to :: forall x. Rep TextureInfo x -> TextureInfo
    Generic, Eq TextureInfo
    Eq TextureInfo
    -> (TextureInfo -> TextureInfo -> Ordering)
    -> (TextureInfo -> TextureInfo -> Bool)
    -> (TextureInfo -> TextureInfo -> Bool)
    -> (TextureInfo -> TextureInfo -> Bool)
    -> (TextureInfo -> TextureInfo -> Bool)
    -> (TextureInfo -> TextureInfo -> TextureInfo)
    -> (TextureInfo -> TextureInfo -> TextureInfo)
    -> Ord TextureInfo
    TextureInfo -> TextureInfo -> Bool
    TextureInfo -> TextureInfo -> Ordering
    TextureInfo -> TextureInfo -> TextureInfo
    forall a.
    Eq a
    -> (a -> a -> Ordering)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> a)
    -> (a -> a -> a)
    -> Ord a
    $ccompare :: TextureInfo -> TextureInfo -> Ordering
    compare :: TextureInfo -> TextureInfo -> Ordering
    $c< :: TextureInfo -> TextureInfo -> Bool
    < :: TextureInfo -> TextureInfo -> Bool
    $c<= :: TextureInfo -> TextureInfo -> Bool
    <= :: TextureInfo -> TextureInfo -> Bool
    $c> :: TextureInfo -> TextureInfo -> Bool
    > :: TextureInfo -> TextureInfo -> Bool
    $c>= :: TextureInfo -> TextureInfo -> Bool
    >= :: TextureInfo -> TextureInfo -> Bool
    $cmax :: TextureInfo -> TextureInfo -> TextureInfo
    max :: TextureInfo -> TextureInfo -> TextureInfo
    $cmin :: TextureInfo -> TextureInfo -> TextureInfo
    min :: TextureInfo -> TextureInfo -> TextureInfo
    Ord, ReadPrec [TextureInfo]
    ReadPrec TextureInfo
    Int -> ReadS TextureInfo
    ReadS [TextureInfo]
    (Int -> ReadS TextureInfo)
    -> ReadS [TextureInfo]
    -> ReadPrec TextureInfo
    -> ReadPrec [TextureInfo]
    -> Read TextureInfo
    forall a.
    (Int -> ReadS a)
    -> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
    $creadsPrec :: Int -> ReadS TextureInfo
    readsPrec :: Int -> ReadS TextureInfo
    $creadList :: ReadS [TextureInfo]
    readList :: ReadS [TextureInfo]
    $creadPrec :: ReadPrec TextureInfo
    readPrec :: ReadPrec TextureInfo
    $creadListPrec :: ReadPrec [TextureInfo]
    readListPrec :: ReadPrec [TextureInfo]
    Read, Int -> TextureInfo -> ShowS
    [TextureInfo] -> ShowS
    TextureInfo -> [Char]
    (Int -> TextureInfo -> ShowS)
    -> (TextureInfo -> [Char])
    -> ([TextureInfo] -> ShowS)
    -> Show TextureInfo
    forall a.
    (Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> TextureInfo -> ShowS
    showsPrec :: Int -> TextureInfo -> ShowS
    $cshow :: TextureInfo -> [Char]
    show :: TextureInfo -> [Char]
    $cshowList :: [TextureInfo] -> ShowS
    showList :: [TextureInfo] -> ShowS
    Show, Typeable)

    -- | Query the attributes of a texture.
    --
    -- See @<https://wiki.libsdl.org/SDL_QueryTexture SDL_QueryTexture>@ for C documentation.
    queryTexture :: MonadIO m => Texture -> m TextureInfo
    queryTexture :: forall (m :: Type -> Type). MonadIO m => Texture -> m TextureInfo
    queryTexture (Texture Renderer
    tex) = IO TextureInfo -> m TextureInfo
    forall a. IO a -> m a
    forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
    liftIO (IO TextureInfo -> m TextureInfo)
    -> IO TextureInfo -> m TextureInfo
    forall a b. (a -> b) -> a -> b
    $
      (Ptr BlendMode -> IO TextureInfo) -> IO TextureInfo
    forall a b. Storable a => (Ptr a -> IO b) -> IO b
    alloca ((Ptr BlendMode -> IO TextureInfo) -> IO TextureInfo)
    -> (Ptr BlendMode -> IO TextureInfo) -> IO TextureInfo
    forall a b. (a -> b) -> a -> b
    $ \Ptr BlendMode
    pfPtr ->
      (Ptr CInt -> IO TextureInfo) -> IO TextureInfo
    forall a b. Storable a => (Ptr a -> IO b) -> IO b
    alloca ((Ptr CInt -> IO TextureInfo) -> IO TextureInfo)
    -> (Ptr CInt -> IO TextureInfo) -> IO TextureInfo
    forall a b. (a -> b) -> a -> b
    $ \Ptr CInt
    acPtr ->
      (Ptr CInt -> IO TextureInfo) -> IO TextureInfo
    forall a b. Storable a => (Ptr a -> IO b) -> IO b
    alloca ((Ptr CInt -> IO TextureInfo) -> IO TextureInfo)
    -> (Ptr CInt -> IO TextureInfo) -> IO TextureInfo
    forall a b. (a -> b) -> a -> b
    $ \Ptr CInt
    wPtr ->
      (Ptr CInt -> IO TextureInfo) -> IO TextureInfo
    forall a b. Storable a => (Ptr a -> IO b) -> IO b
    alloca ((Ptr CInt -> IO TextureInfo) -> IO TextureInfo)
    -> (Ptr CInt -> IO TextureInfo) -> IO TextureInfo
    forall a b. (a -> b) -> a -> b
    $ \Ptr CInt
    hPtr -> do
        Text -> Text -> IO CInt -> IO ()
    forall (m :: Type -> Type) a.
    (MonadIO m, Num a, Ord a) =>
    Text -> Text -> m a -> m ()
    throwIfNeg_ Text
    "SDL.Video.queryTexture" Text
    "SDL_QueryTexture" (IO CInt -> IO ()) -> IO CInt -> IO ()
    forall a b. (a -> b) -> a -> b
    $
          Renderer
    -> Ptr BlendMode -> Ptr CInt -> Ptr CInt -> Ptr CInt -> IO CInt
    forall (m :: Type -> Type).
    MonadIO m =>
    Renderer
    -> Ptr BlendMode -> Ptr CInt -> Ptr CInt -> Ptr CInt -> m CInt
    Raw.queryTexture Renderer
    tex Ptr BlendMode
    pfPtr Ptr CInt
    acPtr Ptr CInt
    wPtr Ptr CInt
    hPtr
        PixelFormat -> TextureAccess -> CInt -> CInt -> TextureInfo
    TextureInfo (PixelFormat -> TextureAccess -> CInt -> CInt -> TextureInfo)
    -> IO PixelFormat
    -> IO (TextureAccess -> CInt -> CInt -> TextureInfo)
    forall (f :: Type -> Type) a b. Functor f => (a -> b) -> f a -> f b
    <$>
          (BlendMode -> PixelFormat) -> IO BlendMode -> IO PixelFormat
    forall a b. (a -> b) -> IO a -> IO b
    forall (f :: Type -> Type) a b. Functor f => (a -> b) -> f a -> f b
    fmap BlendMode -> PixelFormat
    forall a b. FromNumber a b => b -> a
    fromNumber (Ptr BlendMode -> IO BlendMode
    forall a. Storable a => Ptr a -> IO a
    peek Ptr BlendMode
    pfPtr) IO (TextureAccess -> CInt -> CInt -> TextureInfo)
    -> IO TextureAccess -> IO (CInt -> CInt -> TextureInfo)
    forall a b. IO (a -> b) -> IO a -> IO b
    forall (f :: Type -> Type) a b.
    Applicative f =>
    f (a -> b) -> f a -> f b
    <*>
          (CInt -> TextureAccess) -> IO CInt -> IO TextureAccess
    forall a b. (a -> b) -> IO a -> IO b
    forall (f :: Type -> Type) a b. Functor f => (a -> b) -> f a -> f b
    fmap CInt -> TextureAccess
    forall a b. FromNumber a b => b -> a
    fromNumber (Ptr CInt -> IO CInt
    forall a. Storable a => Ptr a -> IO a
    peek Ptr CInt
    acPtr) IO (CInt -> CInt -> TextureInfo)
    -> IO CInt -> IO (CInt -> TextureInfo)
    forall a b. IO (a -> b) -> IO a -> IO b
    forall (f :: Type -> Type) a b.
    Applicative f =>
    f (a -> b) -> f a -> f b
    <*>
          Ptr CInt -> IO CInt
    forall a. Storable a => Ptr a -> IO a
    peek Ptr CInt
    wPtr IO (CInt -> TextureInfo) -> IO CInt -> IO TextureInfo
    forall a b. IO (a -> b) -> IO a -> IO b
    forall (f :: Type -> Type) a b.
    Applicative f =>
    f (a -> b) -> f a -> f b
    <*>
          Ptr CInt -> IO CInt
    forall a. Storable a => Ptr a -> IO a
    peek Ptr CInt
    hPtr

    -- | Allocate a new RGB surface.
    --
    -- See @<https://wiki.libsdl.org/SDL_CreateRGBSurface SDL_CreateRGBSurface>@ for C documentation.
    createRGBSurface :: (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
    createRGBSurface :: forall (m :: Type -> Type).
    (Functor m, MonadIO m) =>
    V2 CInt -> PixelFormat -> m Surface
    createRGBSurface (V2 CInt
    w CInt
    h) PixelFormat
    pf =
      (Ptr Surface -> Surface) -> m (Ptr Surface) -> m Surface
    forall a b. (a -> b) -> m a -> m b
    forall (f :: Type -> Type) a b. Functor f => (a -> b) -> f a -> f b
    fmap Ptr Surface -> Surface
    unmanagedSurface (m (Ptr Surface) -> m Surface) -> m (Ptr Surface) -> m Surface
    forall a b. (a -> b) -> a -> b
    $
        Text -> Text -> m (Ptr Surface) -> m (Ptr Surface)
    forall (m :: Type -> Type) a.
    MonadIO m =>
    Text -> Text -> m (Ptr a) -> m (Ptr a)
    throwIfNull Text
    "SDL.Video.createRGBSurface" Text
    "SDL_CreateRGBSurface" (m (Ptr Surface) -> m (Ptr Surface))
    -> m (Ptr Surface) -> m (Ptr Surface)
    forall a b. (a -> b) -> a -> b
    $ do
          (CInt
    bpp, V4 BlendMode
    r BlendMode
    g BlendMode
    b BlendMode
    a) <- PixelFormat -> m (CInt, V4 BlendMode)
    forall (m :: Type -> Type).
    MonadIO m =>
    PixelFormat -> m (CInt, V4 BlendMode)
    pixelFormatToMasks PixelFormat
    pf
          BlendMode
    -> CInt
    -> CInt
    -> CInt
    -> BlendMode
    -> BlendMode
    -> BlendMode
    -> BlendMode
    -> m (Ptr Surface)
    forall (m :: Type -> Type).
    MonadIO m =>
    BlendMode
    -> CInt
    -> CInt
    -> CInt
    -> BlendMode
    -> BlendMode
    -> BlendMode
    -> BlendMode
    -> m (Ptr Surface)
    Raw.createRGBSurface BlendMode
    0 CInt
    w CInt
    h CInt
    bpp BlendMode
    r BlendMode
    g BlendMode
    b BlendMode
    a

    -- | Allocate a new RGB surface with existing pixel data.
    --
    -- See @<https://wiki.libsdl.org/SDL_CreateRGBSurfaceFrom SDL_CreateRGBSurfaceFrom>@ for C documentation.
    createRGBSurfaceFrom :: (Functor m, MonadIO m)
                         => MSV.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
    createRGBSurfaceFrom :: forall (m :: Type -> Type).
    (Functor m, MonadIO m) =>
    IOVector Word8 -> V2 CInt -> CInt -> PixelFormat -> m Surface
    createRGBSurfaceFrom IOVector Word8
    pixels (V2 CInt
    w CInt
    h) CInt
    p PixelFormat
    pf = IO Surface -> m Surface
    forall a. IO a -> m a
    forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
    liftIO (IO Surface -> m Surface) -> IO Surface -> m Surface
    forall a b. (a -> b) -> a -> b
    $
      (Ptr Surface -> Surface) -> IO (Ptr Surface) -> IO Surface
    forall a b. (a -> b) -> IO a -> IO b
    forall (f :: Type -> Type) a b. Functor f => (a -> b) -> f a -> f b
    fmap (IOVector Word8 -> Ptr Surface -> Surface
    managedSurface IOVector Word8
    pixels) (IO (Ptr Surface) -> IO Surface) -> IO (Ptr Surface) -> IO Surface
    forall a b. (a -> b) -> a -> b
    $
        Text -> Text -> IO (Ptr Surface) -> IO (Ptr Surface)
    forall (m :: Type -> Type) a.
    MonadIO m =>
    Text -> Text -> m (Ptr a) -> m (Ptr a)
    throwIfNull Text
    "SDL.Video.createRGBSurfaceFrom" Text
    "SDL_CreateRGBSurfaceFrom" (IO (Ptr Surface) -> IO (Ptr Surface))
    -> IO (Ptr Surface) -> IO (Ptr Surface)
    forall a b. (a -> b) -> a -> b
    $ do
          (CInt
    bpp, V4 BlendMode
    r BlendMode
    g BlendMode
    b BlendMode
    a) <- PixelFormat -> IO (CInt, V4 BlendMode)
    forall (m :: Type -> Type).
    MonadIO m =>
    PixelFormat -> m (CInt, V4 BlendMode)
    pixelFormatToMasks PixelFormat
    pf
          IOVector Word8
    -> (Ptr Word8 -> IO (Ptr Surface)) -> IO (Ptr Surface)
    forall a b. Storable a => IOVector a -> (Ptr a -> IO b) -> IO b
    MSV.unsafeWith IOVector Word8
    pixels ((Ptr Word8 -> IO (Ptr Surface)) -> IO (Ptr Surface))
    -> (Ptr Word8 -> IO (Ptr Surface)) -> IO (Ptr Surface)
    forall a b. (a -> b) -> a -> b
    $ \Ptr Word8
    pixelPtr ->
            Renderer
    -> CInt
    -> CInt
    -> CInt
    -> CInt
    -> BlendMode
    -> BlendMode
    -> BlendMode
    -> BlendMode
    -> IO (Ptr Surface)
    forall (m :: Type -> Type).
    MonadIO m =>
    Renderer
    -> CInt
    -> CInt
    -> CInt
    -> CInt
    -> BlendMode
    -> BlendMode
    -> BlendMode
    -> BlendMode
    -> m (Ptr Surface)
    Raw.createRGBSurfaceFrom (Ptr Word8 -> Renderer
    forall a b. Ptr a -> Ptr b
    castPtr Ptr Word8
    pixelPtr) CInt
    w CInt
    h CInt
    bpp CInt
    p BlendMode
    r BlendMode
    g BlendMode
    b BlendMode
    a

    -- | 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 @<https://wiki.libsdl.org/SDL_FillRect SDL_FillRect>@ for C documentation.
    surfaceFillRect :: 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 ()
    surfaceFillRect :: forall (m :: Type -> Type).
    MonadIO m =>
    Surface -> Maybe (Rectangle CInt) -> V4 Word8 -> m ()
    surfaceFillRect (Surface Ptr Surface
    s Maybe (IOVector Word8)
    _) Maybe (Rectangle CInt)
    rect (V4 Word8
    r Word8
    g Word8
    b Word8
    a) = IO () -> m ()
    forall a. IO a -> m a
    forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
    liftIO (IO () -> m ()) -> IO () -> m ()
    forall a b. (a -> b) -> a -> b
    $
      Text -> Text -> IO CInt -> IO ()
    forall (m :: Type -> Type) a.
    (MonadIO m, Num a, Ord a) =>
    Text -> Text -> m a -> m ()
    throwIfNeg_ Text
    "SDL.Video.fillRect" Text
    "SDL_FillRect" (IO CInt -> IO ()) -> IO CInt -> IO ()
    forall a b. (a -> b) -> a -> b
    $
      (Rectangle CInt -> (Ptr (Rectangle CInt) -> IO CInt) -> IO CInt)
    -> Maybe (Rectangle CInt)
    -> (Ptr (Rectangle CInt) -> IO CInt)
    -> IO CInt
    forall a b c.
    (a -> (Ptr b -> IO c) -> IO c)
    -> Maybe a -> (Ptr b -> IO c) -> IO c
    maybeWith Rectangle CInt -> (Ptr (Rectangle CInt) -> IO CInt) -> IO CInt
    forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
    with Maybe (Rectangle CInt)
    rect ((Ptr (Rectangle CInt) -> IO CInt) -> IO CInt)
    -> (Ptr (Rectangle CInt) -> IO CInt) -> IO CInt
    forall a b. (a -> b) -> a -> b
    $ \Ptr (Rectangle CInt)
    rectPtr -> do
        Ptr PixelFormat
    format <- Surface -> Ptr PixelFormat
    Raw.surfaceFormat (Surface -> Ptr PixelFormat) -> IO Surface -> IO (Ptr PixelFormat)
    forall (f :: Type -> Type) a b. Functor f => (a -> b) -> f a -> f b
    <$> Ptr Surface -> IO Surface
    forall a. Storable a => Ptr a -> IO a
    peek Ptr Surface
    s
        Ptr PixelFormat -> Word8 -> Word8 -> Word8 -> Word8 -> IO BlendMode
    forall (m :: Type -> Type).
    MonadIO m =>
    Ptr PixelFormat -> Word8 -> Word8 -> Word8 -> Word8 -> m BlendMode
    Raw.mapRGBA Ptr PixelFormat
    format Word8
    r Word8
    g Word8
    b Word8
    a IO BlendMode -> (BlendMode -> IO CInt) -> IO CInt
    forall a b. IO a -> (a -> IO b) -> IO b
    forall (m :: Type -> Type) a b. Monad m => m a -> (a -> m b) -> m b
    >>= Ptr Surface -> Ptr Rect -> BlendMode -> IO CInt
    forall (m :: Type -> Type).
    MonadIO m =>
    Ptr Surface -> Ptr Rect -> BlendMode -> m CInt
    Raw.fillRect Ptr Surface
    s (Ptr (Rectangle CInt) -> Ptr Rect
    forall a b. Ptr a -> Ptr b
    castPtr Ptr (Rectangle CInt)
    rectPtr)

    -- | 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 @<https://wiki.libsdl.org/SDL_FillRect SDL_FillRects>@ for C documentation.
    surfaceFillRects :: MonadIO m
                     => Surface -- ^ The 'Surface' that is the drawing target.
                     -> SV.Vector (Rectangle CInt) -- ^ A 'SV.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 ()
    surfaceFillRects :: forall (m :: Type -> Type).
    MonadIO m =>
    Surface -> Vector (Rectangle CInt) -> V4 Word8 -> m ()
    surfaceFillRects (Surface Ptr Surface
    s Maybe (IOVector Word8)
    _) Vector (Rectangle CInt)
    rects (V4 Word8
    r Word8
    g Word8
    b Word8
    a) = IO () -> m ()
    forall a. IO a -> m a
    forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
    liftIO (IO () -> m ()) -> IO () -> m ()
    forall a b. (a -> b) -> a -> b
    $ do
      Text -> Text -> IO CInt -> IO ()
    forall (m :: Type -> Type) a.
    (MonadIO m, Num a, Ord a) =>
    Text -> Text -> m a -> m ()
    throwIfNeg_ Text
    "SDL.Video.fillRects" Text
    "SDL_FillRects" (IO CInt -> IO ()) -> IO CInt -> IO ()
    forall a b. (a -> b) -> a -> b
    $
        Vector (Rectangle CInt)
    -> (Ptr (Rectangle CInt) -> IO CInt) -> IO CInt
    forall a b. Storable a => Vector a -> (Ptr a -> IO b) -> IO b
    SV.unsafeWith Vector (Rectangle CInt)
    rects ((Ptr (Rectangle CInt) -> IO CInt) -> IO CInt)
    -> (Ptr (Rectangle CInt) -> IO CInt) -> IO CInt
    forall a b. (a -> b) -> a -> b
    $ \Ptr (Rectangle CInt)
    rp -> do
          Ptr PixelFormat
    format <- Surface -> Ptr PixelFormat
    Raw.surfaceFormat (Surface -> Ptr PixelFormat) -> IO Surface -> IO (Ptr PixelFormat)
    forall (f :: Type -> Type) a b. Functor f => (a -> b) -> f a -> f b
    <$> Ptr Surface -> IO Surface
    forall a. Storable a => Ptr a -> IO a
    peek Ptr Surface
    s
          Ptr Surface -> Ptr Rect -> CInt -> BlendMode -> IO CInt
    forall (m :: Type -> Type).
    MonadIO m =>
    Ptr Surface -> Ptr Rect -> CInt -> BlendMode -> m CInt
    Raw.fillRects Ptr Surface
    s
                        (Ptr (Rectangle CInt) -> Ptr Rect
    forall a b. Ptr a -> Ptr b
    castPtr Ptr (Rectangle CInt)
    rp)
                        (Int -> CInt
    forall a b. (Integral a, Num b) => a -> b
    fromIntegral (Vector (Rectangle CInt) -> Int
    forall a. Storable a => Vector a -> Int
    SV.length Vector (Rectangle CInt)
    rects))
                        (BlendMode -> IO CInt) -> IO BlendMode -> IO CInt
    forall (m :: Type -> Type) a b. Monad m => (a -> m b) -> m a -> m b
    =<< Ptr PixelFormat -> Word8 -> Word8 -> Word8 -> Word8 -> IO BlendMode
    forall (m :: Type -> Type).
    MonadIO m =>
    Ptr PixelFormat -> Word8 -> Word8 -> Word8 -> Word8 -> m BlendMode
    Raw.mapRGBA Ptr PixelFormat
    format Word8
    r Word8
    g Word8
    b Word8
    a

    -- | Free an RGB surface.
    --
    -- If the surface was created using 'createRGBSurfaceFrom' then the pixel data is not freed.
    --
    -- See @<https://wiki.libsdl.org/SDL_FreeSurface SDL_FreeSurface>@ for the C documentation.
    freeSurface :: MonadIO m => Surface -> m ()
    freeSurface :: forall (m :: Type -> Type). MonadIO m => Surface -> m ()
    freeSurface (Surface Ptr Surface
    s Maybe (IOVector Word8)
    _) = Ptr Surface -> m ()
    forall (m :: Type -> Type). MonadIO m => Ptr Surface -> m ()
    Raw.freeSurface Ptr Surface
    s

    -- | Load a surface from a BMP file.
    --
    -- See @<https://wiki.libsdl.org/SDL_LoadBMP SDL_LoadBMP>@ for C documentation.
    loadBMP :: MonadIO m => FilePath -> m Surface
    loadBMP :: forall (m :: Type -> Type). MonadIO m => [Char] -> m Surface
    loadBMP [Char]
    filePath = IO Surface -> m Surface
    forall a. IO a -> m a
    forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
    liftIO (IO Surface -> m Surface) -> IO Surface -> m Surface
    forall a b. (a -> b) -> a -> b
    $
      (Ptr Surface -> Surface) -> IO (Ptr Surface) -> IO Surface
    forall a b. (a -> b) -> IO a -> IO b
    forall (f :: Type -> Type) a b. Functor f => (a -> b) -> f a -> f b
    fmap Ptr Surface -> Surface
    unmanagedSurface (IO (Ptr Surface) -> IO Surface) -> IO (Ptr Surface) -> IO Surface
    forall a b. (a -> b) -> a -> b
    $
      Text -> Text -> IO (Ptr Surface) -> IO (Ptr Surface)
    forall (m :: Type -> Type) a.
    MonadIO m =>
    Text -> Text -> m (Ptr a) -> m (Ptr a)
    throwIfNull Text
    "SDL.Video.loadBMP" Text
    "SDL_LoadBMP" (IO (Ptr Surface) -> IO (Ptr Surface))
    -> IO (Ptr Surface) -> IO (Ptr Surface)
    forall a b. (a -> b) -> a -> b
    $
      [Char] -> (CString -> IO (Ptr Surface)) -> IO (Ptr Surface)
    forall a. [Char] -> (CString -> IO a) -> IO a
    withCString [Char]
    filePath ((CString -> IO (Ptr Surface)) -> IO (Ptr Surface))
    -> (CString -> IO (Ptr Surface)) -> IO (Ptr Surface)
    forall a b. (a -> b) -> a -> b
    $ CString -> IO (Ptr Surface)
    forall (m :: Type -> Type). MonadIO m => CString -> m (Ptr Surface)
    Raw.loadBMP

    newtype SurfacePixelFormat = SurfacePixelFormat (Ptr Raw.PixelFormat)
      deriving (SurfacePixelFormat -> SurfacePixelFormat -> Bool
    (SurfacePixelFormat -> SurfacePixelFormat -> Bool)
    -> (SurfacePixelFormat -> SurfacePixelFormat -> Bool)
    -> Eq SurfacePixelFormat
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: SurfacePixelFormat -> SurfacePixelFormat -> Bool
    == :: SurfacePixelFormat -> SurfacePixelFormat -> Bool
    $c/= :: SurfacePixelFormat -> SurfacePixelFormat -> Bool
    /= :: SurfacePixelFormat -> SurfacePixelFormat -> Bool
    Eq, Typeable)

    -- It's possible we could use unsafePerformIO here, but I'm not
    -- sure. surface->{w,h} are immutable, but do we need to guarantee that pointers
    -- aren't reused by *different* surfaces.
    -- | Retrive the width and height of a 'Surface'.
    surfaceDimensions :: MonadIO m => Surface -> m (V2 CInt)
    surfaceDimensions :: forall (m :: Type -> Type). MonadIO m => Surface -> m (V2 CInt)
    surfaceDimensions (Surface Ptr Surface
    s Maybe (IOVector Word8)
    _) = IO (V2 CInt) -> m (V2 CInt)
    forall a. IO a -> m a
    forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
    liftIO (IO (V2 CInt) -> m (V2 CInt)) -> IO (V2 CInt) -> m (V2 CInt)
    forall a b. (a -> b) -> a -> b
    $ (CInt -> CInt -> V2 CInt
    forall a. a -> a -> V2 a
    V2 (CInt -> CInt -> V2 CInt)
    -> (Surface -> CInt) -> Surface -> CInt -> V2 CInt
    forall (f :: Type -> Type) a b. Functor f => (a -> b) -> f a -> f b
    <$> Surface -> CInt
    Raw.surfaceW (Surface -> CInt -> V2 CInt)
    -> (Surface -> CInt) -> Surface -> V2 CInt
    forall a b. (Surface -> a -> b) -> (Surface -> a) -> Surface -> b
    forall (f :: Type -> Type) a b.
    Applicative f =>
    f (a -> b) -> f a -> f b
    <*> Surface -> CInt
    Raw.surfaceH) (Surface -> V2 CInt) -> IO Surface -> IO (V2 CInt)
    forall (f :: Type -> Type) a b. Functor f => (a -> b) -> f a -> f b
    <$> Ptr Surface -> IO Surface
    forall a. Storable a => Ptr a -> IO a
    peek Ptr Surface
    s

    -- | Obtain the pointer to the underlying pixels in a surface. You should bracket
    -- this call with 'lockSurface' and 'unlockSurface', respectively.
    surfacePixels :: MonadIO m => Surface -> m (Ptr ())
    surfacePixels :: forall (m :: Type -> Type). MonadIO m => Surface -> m Renderer
    surfacePixels (Surface Ptr Surface
    s Maybe (IOVector Word8)
    _) = IO Renderer -> m Renderer
    forall a. IO a -> m a
    forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
    liftIO (IO Renderer -> m Renderer) -> IO Renderer -> m Renderer
    forall a b. (a -> b) -> a -> b
    $ Surface -> Renderer
    Raw.surfacePixels (Surface -> Renderer) -> IO Surface -> IO Renderer
    forall (f :: Type -> Type) a b. Functor f => (a -> b) -> f a -> f b
    <$> Ptr Surface -> IO Surface
    forall a. Storable a => Ptr a -> IO a
    peek Ptr Surface
    s

    -- It's possible we could use unsafePerformIO here, but I'm not
    -- sure. surface->format is immutable, but do we need to guarantee that pointers
    -- aren't reused by *different* surfaces?
    -- | Inspect the pixel format under a surface.
    surfaceFormat :: MonadIO m => Surface -> m SurfacePixelFormat
    surfaceFormat :: forall (m :: Type -> Type).
    MonadIO m =>
    Surface -> m SurfacePixelFormat
    surfaceFormat (Surface Ptr Surface
    s Maybe (IOVector Word8)
    _) = IO SurfacePixelFormat -> m SurfacePixelFormat
    forall a. IO a -> m a
    forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
    liftIO (IO SurfacePixelFormat -> m SurfacePixelFormat)
    -> IO SurfacePixelFormat -> m SurfacePixelFormat
    forall a b. (a -> b) -> a -> b
    $ Ptr PixelFormat -> SurfacePixelFormat
    SurfacePixelFormat (Ptr PixelFormat -> SurfacePixelFormat)
    -> (Surface -> Ptr PixelFormat) -> Surface -> SurfacePixelFormat
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Surface -> Ptr PixelFormat
    Raw.surfaceFormat (Surface -> SurfacePixelFormat)
    -> IO Surface -> IO SurfacePixelFormat
    forall (f :: Type -> Type) a b. Functor f => (a -> b) -> f a -> f b
    <$> Ptr Surface -> IO Surface
    forall a. Storable a => Ptr a -> IO a
    peek Ptr Surface
    s

    newtype Palette = Palette (Ptr Raw.Palette)
      deriving (Palette -> Palette -> Bool
    (Palette -> Palette -> Bool)
    -> (Palette -> Palette -> Bool) -> Eq Palette
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: Palette -> Palette -> Bool
    == :: Palette -> Palette -> Bool
    $c/= :: Palette -> Palette -> Bool
    /= :: Palette -> Palette -> Bool
    Eq, Typeable)

    formatPalette :: MonadIO m => SurfacePixelFormat -> m (Maybe Palette)
    formatPalette :: forall (m :: Type -> Type).
    MonadIO m =>
    SurfacePixelFormat -> m (Maybe Palette)
    formatPalette (SurfacePixelFormat Ptr PixelFormat
    f) = IO (Maybe Palette) -> m (Maybe Palette)
    forall a. IO a -> m a
    forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
    liftIO (IO (Maybe Palette) -> m (Maybe Palette))
    -> IO (Maybe Palette) -> m (Maybe Palette)
    forall a b. (a -> b) -> a -> b
    $ Ptr Palette -> Maybe Palette
    wrap (Ptr Palette -> Maybe Palette)
    -> (PixelFormat -> Ptr Palette) -> PixelFormat -> Maybe Palette
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . PixelFormat -> Ptr Palette
    Raw.pixelFormatPalette (PixelFormat -> Maybe Palette)
    -> IO PixelFormat -> IO (Maybe Palette)
    forall (f :: Type -> Type) a b. Functor f => (a -> b) -> f a -> f b
    <$> Ptr PixelFormat -> IO PixelFormat
    forall a. Storable a => Ptr a -> IO a
    peek Ptr PixelFormat
    f
      where wrap :: Ptr Palette -> Maybe Palette
    wrap Ptr Palette
    p
              | Ptr Palette
    p Ptr Palette -> Ptr Palette -> Bool
    forall a. Eq a => a -> a -> Bool
    == Ptr Palette
    forall a. Ptr a
    nullPtr = Maybe Palette
    forall a. Maybe a
    Nothing
              | Bool
    otherwise = Palette -> Maybe Palette
    forall a. a -> Maybe a
    Just (Ptr Palette -> Palette
    Palette Ptr Palette
    p)

    paletteNColors :: MonadIO m => Palette -> m CInt
    paletteNColors :: forall (m :: Type -> Type). MonadIO m => Palette -> m CInt
    paletteNColors (Palette Ptr Palette
    p) = IO CInt -> m CInt
    forall a. IO a -> m a
    forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
    liftIO (IO CInt -> m CInt) -> IO CInt -> m CInt
    forall a b. (a -> b) -> a -> b
    $ Palette -> CInt
    Raw.paletteNColors (Palette -> CInt) -> IO Palette -> IO CInt
    forall (f :: Type -> Type) a b. Functor f => (a -> b) -> f a -> f b
    <$> Ptr Palette -> IO Palette
    forall a. Storable a => Ptr a -> IO a
    peek Ptr Palette
    p

    paletteColors :: MonadIO m => Palette -> m (Maybe (SV.Vector (V4 Word8)))
    paletteColors :: forall (m :: Type -> Type).
    MonadIO m =>
    Palette -> m (Maybe (Vector (V4 Word8)))
    paletteColors q :: Palette
    q@(Palette Ptr Palette
    p) = do
      Int
    n <- IO Int -> m Int
    forall a. IO a -> m a
    forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
    liftIO (IO Int -> m Int) -> IO Int -> m Int
    forall a b. (a -> b) -> a -> b
    $ CInt -> Int
    forall a b. (Integral a, Num b) => a -> b
    fromIntegral (CInt -> Int) -> IO CInt -> IO Int
    forall (f :: Type -> Type) a b. Functor f => (a -> b) -> f a -> f b
    <$> Palette -> IO CInt
    forall (m :: Type -> Type). MonadIO m => Palette -> m CInt
    paletteNColors Palette
    q
      let wrap :: Ptr a -> Maybe (Ptr a)
    wrap Ptr a
    p' | Ptr a
    p' Ptr a -> Ptr a -> Bool
    forall a. Eq a => a -> a -> Bool
    == Ptr a
    forall a. Ptr a
    nullPtr = Maybe (Ptr a)
    forall a. Maybe a
    Nothing
                  | Bool
    otherwise     = Ptr a -> Maybe (Ptr a)
    forall a. a -> Maybe a
    forall (m :: Type -> Type) a. Monad m => a -> m a
    return Ptr a
    p'
      Maybe (Ptr (V4 Word8))
    mv <- IO (Maybe (Ptr (V4 Word8))) -> m (Maybe (Ptr (V4 Word8)))
    forall a. IO a -> m a
    forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
    liftIO (IO (Maybe (Ptr (V4 Word8))) -> m (Maybe (Ptr (V4 Word8))))
    -> IO (Maybe (Ptr (V4 Word8))) -> m (Maybe (Ptr (V4 Word8)))
    forall a b. (a -> b) -> a -> b
    $ Ptr (V4 Word8) -> Maybe (Ptr (V4 Word8))
    forall {a}. Ptr a -> Maybe (Ptr a)
    wrap (Ptr (V4 Word8) -> Maybe (Ptr (V4 Word8)))
    -> (Palette -> Ptr (V4 Word8)) -> Palette -> Maybe (Ptr (V4 Word8))
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Ptr Color -> Ptr (V4 Word8)
    forall a b. Ptr a -> Ptr b
    castPtr (Ptr Color -> Ptr (V4 Word8))
    -> (Palette -> Ptr Color) -> Palette -> Ptr (V4 Word8)
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Palette -> Ptr Color
    Raw.paletteColors (Palette -> Maybe (Ptr (V4 Word8)))
    -> IO Palette -> IO (Maybe (Ptr (V4 Word8)))
    forall (f :: Type -> Type) a b. Functor f => (a -> b) -> f a -> f b
    <$> Ptr Palette -> IO Palette
    forall a. Storable a => Ptr a -> IO a
    peek Ptr Palette
    p
      Maybe (ForeignPtr (V4 Word8))
    mColor <- IO (Maybe (ForeignPtr (V4 Word8)))
    -> m (Maybe (ForeignPtr (V4 Word8)))
    forall a. IO a -> m a
    forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
    liftIO (IO (Maybe (ForeignPtr (V4 Word8)))
     -> m (Maybe (ForeignPtr (V4 Word8))))
    -> IO (Maybe (ForeignPtr (V4 Word8)))
    -> m (Maybe (ForeignPtr (V4 Word8)))
    forall a b. (a -> b) -> a -> b
    $ (Ptr (V4 Word8) -> IO (ForeignPtr (V4 Word8)))
    -> Maybe (Ptr (V4 Word8)) -> IO (Maybe (ForeignPtr (V4 Word8)))
    forall (t :: Type -> Type) (f :: Type -> Type) a b.
    (Traversable t, Applicative f) =>
    (a -> f b) -> t a -> f (t b)
    forall (f :: Type -> Type) a b.
    Applicative f =>
    (a -> f b) -> Maybe a -> f (Maybe b)
    traverse Ptr (V4 Word8) -> IO (ForeignPtr (V4 Word8))
    forall a. Ptr a -> IO (ForeignPtr a)
    newForeignPtr_ Maybe (Ptr (V4 Word8))
    mv
      Maybe (Vector (V4 Word8)) -> m (Maybe (Vector (V4 Word8)))
    forall a. a -> m a
    forall (m :: Type -> Type) a. Monad m => a -> m a
    return (Maybe (Vector (V4 Word8)) -> m (Maybe (Vector (V4 Word8))))
    -> Maybe (Vector (V4 Word8)) -> m (Maybe (Vector (V4 Word8)))
    forall a b. (a -> b) -> a -> b
    $ (ForeignPtr (V4 Word8) -> Int -> Vector (V4 Word8))
    -> Int -> ForeignPtr (V4 Word8) -> Vector (V4 Word8)
    forall a b c. (a -> b -> c) -> b -> a -> c
    flip ForeignPtr (V4 Word8) -> Int -> Vector (V4 Word8)
    forall a. ForeignPtr a -> Int -> Vector a
    SV.unsafeFromForeignPtr0 Int
    n (ForeignPtr (V4 Word8) -> Vector (V4 Word8))
    -> Maybe (ForeignPtr (V4 Word8)) -> Maybe (Vector (V4 Word8))
    forall (f :: Type -> Type) a b. Functor f => (a -> b) -> f a -> f b
    <$> Maybe (ForeignPtr (V4 Word8))
    mColor

    paletteColor :: MonadIO m => Palette -> CInt -> m (Maybe (V4 Word8))
    paletteColor :: forall (m :: Type -> Type).
    MonadIO m =>
    Palette -> CInt -> m (Maybe (V4 Word8))
    paletteColor q :: Palette
    q@(Palette Ptr Palette
    p) CInt
    i = do
        Palette
    rp <- IO Palette -> m Palette
    forall a. IO a -> m a
    forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
    liftIO (IO Palette -> m Palette) -> IO Palette -> m Palette
    forall a b. (a -> b) -> a -> b
    $ Ptr Palette -> IO Palette
    forall a. Storable a => Ptr a -> IO a
    peek Ptr Palette
    p
        CInt
    m <- Palette -> m CInt
    forall (m :: Type -> Type). MonadIO m => Palette -> m CInt
    paletteNColors Palette
    q
        if CInt
    m CInt -> CInt -> Bool
    forall a. Ord a => a -> a -> Bool
    > CInt
    i Bool -> Bool -> Bool
    && CInt
    i CInt -> CInt -> Bool
    forall a. Ord a => a -> a -> Bool
    >= CInt
    0 then
          IO (Maybe (V4 Word8)) -> m (Maybe (V4 Word8))
    forall a. IO a -> m a
    forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
    liftIO (IO (Maybe (V4 Word8)) -> m (Maybe (V4 Word8)))
    -> IO (Maybe (V4 Word8)) -> m (Maybe (V4 Word8))
    forall a b. (a -> b) -> a -> b
    $ (V4 Word8 -> Maybe (V4 Word8))
    -> IO (V4 Word8) -> IO (Maybe (V4 Word8))
    forall a b. (a -> b) -> IO a -> IO b
    forall (f :: Type -> Type) a b. Functor f => (a -> b) -> f a -> f b
    fmap V4 Word8 -> Maybe (V4 Word8)
    forall a. a -> Maybe a
    forall (m :: Type -> Type) a. Monad m => a -> m a
    return (IO (V4 Word8) -> IO (Maybe (V4 Word8)))
    -> (Palette -> IO (V4 Word8)) -> Palette -> IO (Maybe (V4 Word8))
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . (Ptr (V4 Word8) -> Int -> IO (V4 Word8))
    -> Int -> Ptr (V4 Word8) -> IO (V4 Word8)
    forall a b c. (a -> b -> c) -> b -> a -> c
    flip Ptr (V4 Word8) -> Int -> IO (V4 Word8)
    forall a. Storable a => Ptr a -> Int -> IO a
    peekElemOff (CInt -> Int
    forall a b. (Integral a, Num b) => a -> b
    fromIntegral CInt
    i) (Ptr (V4 Word8) -> IO (V4 Word8))
    -> (Palette -> Ptr (V4 Word8)) -> Palette -> IO (V4 Word8)
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Ptr Color -> Ptr (V4 Word8)
    forall a b. Ptr a -> Ptr b
    castPtr (Ptr Color -> Ptr (V4 Word8))
    -> (Palette -> Ptr Color) -> Palette -> Ptr (V4 Word8)
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Palette -> Ptr Color
    Raw.paletteColors (Palette -> IO (Maybe (V4 Word8)))
    -> Palette -> IO (Maybe (V4 Word8))
    forall a b. (a -> b) -> a -> b
    $ Palette
    rp
        else
          Maybe (V4 Word8) -> m (Maybe (V4 Word8))
    forall a. a -> m a
    forall (m :: Type -> Type) a. Monad m => a -> m a
    return Maybe (V4 Word8)
    forall a. Maybe a
    Nothing

    -- | Set a range of colors in a palette.
    --
    -- See @<https://wiki.libsdl.org/SDL_SetPaletteColors SDL_SetPaletteColors>@ for C documentation.
    setPaletteColors :: MonadIO m
                     => Palette -- ^ The 'Palette' to modify
                     -> (SV.Vector (V4 Word8)) -- ^ A 'SV.Vector' of colours to copy into the palette
                     -> CInt -- ^ The index of the first palette entry to modify
                     -> m ()
    setPaletteColors :: forall (m :: Type -> Type).
    MonadIO m =>
    Palette -> Vector (V4 Word8) -> CInt -> m ()
    setPaletteColors (Palette Ptr Palette
    p) Vector (V4 Word8)
    colors CInt
    first = IO () -> m ()
    forall a. IO a -> m a
    forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
    liftIO (IO () -> m ()) -> IO () -> m ()
    forall a b. (a -> b) -> a -> b
    $
      Text -> Text -> IO CInt -> IO ()
    forall (m :: Type -> Type) a.
    (MonadIO m, Num a, Ord a) =>
    Text -> Text -> m a -> m ()
    throwIfNeg_ Text
    "SDL.Video.setPaletteColors" Text
    "SDL_SetPaletteColors" (IO CInt -> IO ()) -> IO CInt -> IO ()
    forall a b. (a -> b) -> a -> b
    $
      Vector (V4 Word8) -> (Ptr (V4 Word8) -> IO CInt) -> IO CInt
    forall a b. Storable a => Vector a -> (Ptr a -> IO b) -> IO b
    SV.unsafeWith Vector (V4 Word8)
    colors ((Ptr (V4 Word8) -> IO CInt) -> IO CInt)
    -> (Ptr (V4 Word8) -> IO CInt) -> IO CInt
    forall a b. (a -> b) -> a -> b
    $ \Ptr (V4 Word8)
    cp ->
        Ptr Palette -> Ptr Color -> CInt -> CInt -> IO CInt
    forall (m :: Type -> Type).
    MonadIO m =>
    Ptr Palette -> Ptr Color -> CInt -> CInt -> m CInt
    Raw.setPaletteColors Ptr Palette
    p (Ptr (V4 Word8) -> Ptr Color
    forall a b. Ptr a -> Ptr b
    castPtr Ptr (V4 Word8)
    cp) CInt
    first CInt
    n
      where
        n :: CInt
    n = Int -> CInt
    forall a b. (Integral a, Num b) => a -> b
    fromIntegral (Int -> CInt) -> Int -> CInt
    forall a b. (a -> b) -> a -> b
    $ Vector (V4 Word8) -> Int
    forall a. Storable a => Vector a -> Int
    SV.length Vector (V4 Word8)
    colors

    -- | Get the SDL surface associated with the window.
    --
    -- See @<https://wiki.libsdl.org/SDL_GetWindowSurface SDL_GetWindowSurface>@ for C documentation.
    getWindowSurface :: (Functor m, MonadIO m) => Window -> m Surface
    getWindowSurface :: forall (m :: Type -> Type).
    (Functor m, MonadIO m) =>
    Window -> m Surface
    getWindowSurface (Window Renderer
    w) =
      (Ptr Surface -> Surface) -> m (Ptr Surface) -> m Surface
    forall a b. (a -> b) -> m a -> m b
    forall (f :: Type -> Type) a b. Functor f => (a -> b) -> f a -> f b
    fmap Ptr Surface -> Surface
    unmanagedSurface (m (Ptr Surface) -> m Surface) -> m (Ptr Surface) -> m Surface
    forall a b. (a -> b) -> a -> b
    $
      Text -> Text -> m (Ptr Surface) -> m (Ptr Surface)
    forall (m :: Type -> Type) a.
    MonadIO m =>
    Text -> Text -> m (Ptr a) -> m (Ptr a)
    throwIfNull Text
    "SDL.Video.getWindowSurface" Text
    "SDL_GetWindowSurface" (m (Ptr Surface) -> m (Ptr Surface))
    -> m (Ptr Surface) -> m (Ptr Surface)
    forall a b. (a -> b) -> a -> b
    $
      Renderer -> m (Ptr Surface)
    forall (m :: Type -> Type).
    MonadIO m =>
    Renderer -> m (Ptr Surface)
    Raw.getWindowSurface Renderer
    w

    -- | 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 @<https://wiki.libsdl.org/SDL_SetRenderDrawBlendMode SDL_SetRenderDrawBlendMode>@ and @<https://wiki.libsdl.org/SDL_GetRenderDrawBlendMode SDL_GetRenderDrawBlendMode>@ for C documentation.
    rendererDrawBlendMode :: Renderer -> StateVar BlendMode
    rendererDrawBlendMode :: Renderer -> StateVar BlendMode
    rendererDrawBlendMode (Renderer Renderer
    r) = IO BlendMode -> (BlendMode -> IO ()) -> StateVar BlendMode
    forall a. IO a -> (a -> IO ()) -> StateVar a
    makeStateVar IO BlendMode
    getRenderDrawBlendMode BlendMode -> IO ()
    forall {m :: Type -> Type} {a}.
    (MonadIO m, ToNumber a BlendMode) =>
    a -> m ()
    setRenderDrawBlendMode
      where
      getRenderDrawBlendMode :: IO BlendMode
    getRenderDrawBlendMode = IO BlendMode -> IO BlendMode
    forall a. IO a -> IO a
    forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
    liftIO (IO BlendMode -> IO BlendMode) -> IO BlendMode -> IO BlendMode
    forall a b. (a -> b) -> a -> b
    $
        (Ptr BlendMode -> IO BlendMode) -> IO BlendMode
    forall a b. Storable a => (Ptr a -> IO b) -> IO b
    alloca ((Ptr BlendMode -> IO BlendMode) -> IO BlendMode)
    -> (Ptr BlendMode -> IO BlendMode) -> IO BlendMode
    forall a b. (a -> b) -> a -> b
    $ \Ptr BlendMode
    bmPtr -> do
          Text -> Text -> IO Int -> IO ()
    forall (m :: Type -> Type) a.
    (MonadIO m, Num a, Ord a) =>
    Text -> Text -> m a -> m ()
    throwIfNeg_ Text
    "SDL.Video.Renderer.getRenderDrawBlendMode" Text
    "SDL_GetRenderDrawBlendMode" (IO Int -> IO ()) -> IO Int -> IO ()
    forall a b. (a -> b) -> a -> b
    $
            Renderer -> Ptr BlendMode -> IO Int
    forall (m :: Type -> Type).
    MonadIO m =>
    Renderer -> Ptr BlendMode -> m Int
    Raw.getRenderDrawBlendMode Renderer
    r Ptr BlendMode
    bmPtr
          BlendMode -> BlendMode
    forall a b. FromNumber a b => b -> a
    fromNumber (BlendMode -> BlendMode) -> IO BlendMode -> IO BlendMode
    forall (f :: Type -> Type) a b. Functor f => (a -> b) -> f a -> f b
    <$> Ptr BlendMode -> IO BlendMode
    forall a. Storable a => Ptr a -> IO a
    peek Ptr BlendMode
    bmPtr

      setRenderDrawBlendMode :: a -> m ()
    setRenderDrawBlendMode a
    bm =
        Text -> Text -> m CInt -> m ()
    forall (m :: Type -> Type) a.
    (MonadIO m, Num a, Ord a) =>
    Text -> Text -> m a -> m ()
    throwIfNeg_ Text
    "SDL.Video.Renderer.setRenderDrawBlendMode" Text
    "SDL_SetRenderDrawBlendMode" (m CInt -> m ()) -> m CInt -> m ()
    forall a b. (a -> b) -> a -> b
    $
        Renderer -> BlendMode -> m CInt
    forall (m :: Type -> Type).
    MonadIO m =>
    Renderer -> BlendMode -> m CInt
    Raw.setRenderDrawBlendMode Renderer
    r (a -> BlendMode
    forall a b. ToNumber a b => a -> b
    toNumber a
    bm)

    -- | 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 @<https://wiki.libsdl.org/SDL_SetRenderDrawColor SDL_SetRenderDrawColor>@ and @<https://wiki.libsdl.org/SDL_GetRenderDrawColor SDL_GetRenderDrawColor>@ for C documentation.
    rendererDrawColor :: Renderer -> StateVar (V4 Word8)
    rendererDrawColor :: Renderer -> StateVar (V4 Word8)
    rendererDrawColor (Renderer Renderer
    re) = IO (V4 Word8) -> (V4 Word8 -> IO ()) -> StateVar (V4 Word8)
    forall a. IO a -> (a -> IO ()) -> StateVar a
    makeStateVar IO (V4 Word8)
    getRenderDrawColor V4 Word8 -> IO ()
    forall {m :: Type -> Type}. MonadIO m => V4 Word8 -> m ()
    setRenderDrawColor
      where
      getRenderDrawColor :: IO (V4 Word8)
    getRenderDrawColor = IO (V4 Word8) -> IO (V4 Word8)
    forall a. IO a -> IO a
    forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
    liftIO (IO (V4 Word8) -> IO (V4 Word8)) -> IO (V4 Word8) -> IO (V4 Word8)
    forall a b. (a -> b) -> a -> b
    $
        (Ptr Word8 -> IO (V4 Word8)) -> IO (V4 Word8)
    forall a b. Storable a => (Ptr a -> IO b) -> IO b
    alloca ((Ptr Word8 -> IO (V4 Word8)) -> IO (V4 Word8))
    -> (Ptr Word8 -> IO (V4 Word8)) -> IO (V4 Word8)
    forall a b. (a -> b) -> a -> b
    $ \Ptr Word8
    r ->
        (Ptr Word8 -> IO (V4 Word8)) -> IO (V4 Word8)
    forall a b. Storable a => (Ptr a -> IO b) -> IO b
    alloca ((Ptr Word8 -> IO (V4 Word8)) -> IO (V4 Word8))
    -> (Ptr Word8 -> IO (V4 Word8)) -> IO (V4 Word8)
    forall a b. (a -> b) -> a -> b
    $ \Ptr Word8
    g ->
        (Ptr Word8 -> IO (V4 Word8)) -> IO (V4 Word8)
    forall a b. Storable a => (Ptr a -> IO b) -> IO b
    alloca ((Ptr Word8 -> IO (V4 Word8)) -> IO (V4 Word8))
    -> (Ptr Word8 -> IO (V4 Word8)) -> IO (V4 Word8)
    forall a b. (a -> b) -> a -> b
    $ \Ptr Word8
    b ->
        (Ptr Word8 -> IO (V4 Word8)) -> IO (V4 Word8)
    forall a b. Storable a => (Ptr a -> IO b) -> IO b
    alloca ((Ptr Word8 -> IO (V4 Word8)) -> IO (V4 Word8))
    -> (Ptr Word8 -> IO (V4 Word8)) -> IO (V4 Word8)
    forall a b. (a -> b) -> a -> b
    $ \Ptr Word8
    a -> do
          Text -> Text -> IO CInt -> IO ()
    forall (m :: Type -> Type) a.
    (MonadIO m, Num a, Ord a) =>
    Text -> Text -> m a -> m ()
    throwIfNeg_ Text
    "SDL.Video.Renderer.getRenderDrawColor" Text
    "SDL_GetRenderDrawColor" (IO CInt -> IO ()) -> IO CInt -> IO ()
    forall a b. (a -> b) -> a -> b
    $
            Renderer
    -> Ptr Word8 -> Ptr Word8 -> Ptr Word8 -> Ptr Word8 -> IO CInt
    forall (m :: Type -> Type).
    MonadIO m =>
    Renderer
    -> Ptr Word8 -> Ptr Word8 -> Ptr Word8 -> Ptr Word8 -> m CInt
    Raw.getRenderDrawColor Renderer
    re Ptr Word8
    r Ptr Word8
    g Ptr Word8
    b Ptr Word8
    a
          Word8 -> Word8 -> Word8 -> Word8 -> V4 Word8
    forall a. a -> a -> a -> a -> V4 a
    V4 (Word8 -> Word8 -> Word8 -> Word8 -> V4 Word8)
    -> IO Word8 -> IO (Word8 -> Word8 -> Word8 -> V4 Word8)
    forall (f :: Type -> Type) a b. Functor f => (a -> b) -> f a -> f b
    <$> Ptr Word8 -> IO Word8
    forall a. Storable a => Ptr a -> IO a
    peek Ptr Word8
    r IO (Word8 -> Word8 -> Word8 -> V4 Word8)
    -> IO Word8 -> IO (Word8 -> Word8 -> V4 Word8)
    forall a b. IO (a -> b) -> IO a -> IO b
    forall (f :: Type -> Type) a b.
    Applicative f =>
    f (a -> b) -> f a -> f b
    <*> Ptr Word8 -> IO Word8
    forall a. Storable a => Ptr a -> IO a
    peek Ptr Word8
    g IO (Word8 -> Word8 -> V4 Word8)
    -> IO Word8 -> IO (Word8 -> V4 Word8)
    forall a b. IO (a -> b) -> IO a -> IO b
    forall (f :: Type -> Type) a b.
    Applicative f =>
    f (a -> b) -> f a -> f b
    <*> Ptr Word8 -> IO Word8
    forall a. Storable a => Ptr a -> IO a
    peek Ptr Word8
    b IO (Word8 -> V4 Word8) -> IO Word8 -> IO (V4 Word8)
    forall a b. IO (a -> b) -> IO a -> IO b
    forall (f :: Type -> Type) a b.
    Applicative f =>
    f (a -> b) -> f a -> f b
    <*> Ptr Word8 -> IO Word8
    forall a. Storable a => Ptr a -> IO a
    peek Ptr Word8
    a

      setRenderDrawColor :: V4 Word8 -> m ()
    setRenderDrawColor (V4 Word8
    r Word8
    g Word8
    b Word8
    a) =
        Text -> Text -> m CInt -> m ()
    forall (m :: Type -> Type) a.
    (MonadIO m, Num a, Ord a) =>
    Text -> Text -> m a -> m ()
    throwIfNeg_ Text
    "SDL.Video.setRenderDrawColor" Text
    "SDL_SetRenderDrawColor" (m CInt -> m ()) -> m CInt -> m ()
    forall a b. (a -> b) -> a -> b
    $
        Renderer -> Word8 -> Word8 -> Word8 -> Word8 -> m CInt
    forall (m :: Type -> Type).
    MonadIO m =>
    Renderer -> Word8 -> Word8 -> Word8 -> Word8 -> m CInt
    Raw.setRenderDrawColor Renderer
    re Word8
    r Word8
    g Word8
    b Word8
    a

    -- | Copy the window surface to the screen.
    --
    -- This is the function you use to reflect any changes to the surface on the screen.
    --
    -- See @<https://wiki.libsdl.org/SDL_UpdateWindowSurface SDL_UpdateWindowSurface>@ for C documentation.
    updateWindowSurface :: (Functor m, MonadIO m) => Window -> m ()
    updateWindowSurface :: forall (m :: Type -> Type).
    (Functor m, MonadIO m) =>
    Window -> m ()
    updateWindowSurface (Window Renderer
    w) =
      Text -> Text -> m CInt -> m ()
    forall (m :: Type -> Type) a.
    (MonadIO m, Num a, Ord a) =>
    Text -> Text -> m a -> m ()
    throwIfNeg_ Text
    "SDL.Video.updateWindowSurface" Text
    "SDL_UpdateWindowSurface" (m CInt -> m ()) -> m CInt -> m ()
    forall a b. (a -> b) -> a -> b
    $
        Renderer -> m CInt
    forall (m :: Type -> Type). MonadIO m => Renderer -> m CInt
    Raw.updateWindowSurface Renderer
    w

    -- | Blend modes used in 'copy' and drawing operations.
    data BlendMode
      = 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
        --
      deriving (BlendMode
    BlendMode -> BlendMode -> Bounded BlendMode
    forall a. a -> a -> Bounded a
    $cminBound :: BlendMode
    minBound :: BlendMode
    $cmaxBound :: BlendMode
    maxBound :: BlendMode
    Bounded, Typeable BlendMode
    Typeable BlendMode
    -> (forall (c :: Type -> Type).
        (forall d b. Data d => c (d -> b) -> d -> c b)
        -> (forall g. g -> c g) -> BlendMode -> c BlendMode)
    -> (forall (c :: Type -> Type).
        (forall b r. Data b => c (b -> r) -> c r)
        -> (forall r. r -> c r) -> Constr -> c BlendMode)
    -> (BlendMode -> Constr)
    -> (BlendMode -> DataType)
    -> (forall (t :: Type -> Type) (c :: Type -> Type).
        Typeable t =>
        (forall d. Data d => c (t d)) -> Maybe (c BlendMode))
    -> (forall (t :: Type -> Type -> Type) (c :: Type -> Type).
        Typeable t =>
        (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c BlendMode))
    -> ((forall b. Data b => b -> b) -> BlendMode -> BlendMode)
    -> (forall r r'.
        (r -> r' -> r)
        -> r -> (forall d. Data d => d -> r') -> BlendMode -> r)
    -> (forall r r'.
        (r' -> r -> r)
        -> r -> (forall d. Data d => d -> r') -> BlendMode -> r)
    -> (forall u. (forall d. Data d => d -> u) -> BlendMode -> [u])
    -> (forall u.
        Int -> (forall d. Data d => d -> u) -> BlendMode -> u)
    -> (forall (m :: Type -> Type).
        Monad m =>
        (forall d. Data d => d -> m d) -> BlendMode -> m BlendMode)
    -> (forall (m :: Type -> Type).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> BlendMode -> m BlendMode)
    -> (forall (m :: Type -> Type).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> BlendMode -> m BlendMode)
    -> Data BlendMode
    BlendMode -> Constr
    BlendMode -> DataType
    (forall b. Data b => b -> b) -> BlendMode -> BlendMode
    forall a.
    Typeable a
    -> (forall (c :: Type -> Type).
        (forall d b. Data d => c (d -> b) -> d -> c b)
        -> (forall g. g -> c g) -> a -> c a)
    -> (forall (c :: Type -> Type).
        (forall b r. Data b => c (b -> r) -> c r)
        -> (forall r. r -> c r) -> Constr -> c a)
    -> (a -> Constr)
    -> (a -> DataType)
    -> (forall (t :: Type -> Type) (c :: Type -> Type).
        Typeable t =>
        (forall d. Data d => c (t d)) -> Maybe (c a))
    -> (forall (t :: Type -> Type -> Type) (c :: Type -> Type).
        Typeable t =>
        (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
    -> ((forall b. Data b => b -> b) -> a -> a)
    -> (forall r r'.
        (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
    -> (forall r r'.
        (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
    -> (forall u. (forall d. Data d => d -> u) -> a -> [u])
    -> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
    -> (forall (m :: Type -> Type).
        Monad m =>
        (forall d. Data d => d -> m d) -> a -> m a)
    -> (forall (m :: Type -> Type).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> a -> m a)
    -> (forall (m :: Type -> Type).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> a -> m a)
    -> Data a
    forall u. Int -> (forall d. Data d => d -> u) -> BlendMode -> u
    forall u. (forall d. Data d => d -> u) -> BlendMode -> [u]
    forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> BlendMode -> r
    forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> BlendMode -> r
    forall (m :: Type -> Type).
    Monad m =>
    (forall d. Data d => d -> m d) -> BlendMode -> m BlendMode
    forall (m :: Type -> Type).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> BlendMode -> m BlendMode
    forall (c :: Type -> Type).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c BlendMode
    forall (c :: Type -> Type).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> BlendMode -> c BlendMode
    forall (t :: Type -> Type) (c :: Type -> Type).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c BlendMode)
    forall (t :: Type -> Type -> Type) (c :: Type -> Type).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c BlendMode)
    $cgfoldl :: forall (c :: Type -> Type).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> BlendMode -> c BlendMode
    gfoldl :: forall (c :: Type -> Type).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> BlendMode -> c BlendMode
    $cgunfold :: forall (c :: Type -> Type).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c BlendMode
    gunfold :: forall (c :: Type -> Type).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c BlendMode
    $ctoConstr :: BlendMode -> Constr
    toConstr :: BlendMode -> Constr
    $cdataTypeOf :: BlendMode -> DataType
    dataTypeOf :: BlendMode -> DataType
    $cdataCast1 :: forall (t :: Type -> Type) (c :: Type -> Type).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c BlendMode)
    dataCast1 :: forall (t :: Type -> Type) (c :: Type -> Type).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c BlendMode)
    $cdataCast2 :: forall (t :: Type -> Type -> Type) (c :: Type -> Type).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c BlendMode)
    dataCast2 :: forall (t :: Type -> Type -> Type) (c :: Type -> Type).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c BlendMode)
    $cgmapT :: (forall b. Data b => b -> b) -> BlendMode -> BlendMode
    gmapT :: (forall b. Data b => b -> b) -> BlendMode -> BlendMode
    $cgmapQl :: forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> BlendMode -> r
    gmapQl :: forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> BlendMode -> r
    $cgmapQr :: forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> BlendMode -> r
    gmapQr :: forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> BlendMode -> r
    $cgmapQ :: forall u. (forall d. Data d => d -> u) -> BlendMode -> [u]
    gmapQ :: forall u. (forall d. Data d => d -> u) -> BlendMode -> [u]
    $cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> BlendMode -> u
    gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> BlendMode -> u
    $cgmapM :: forall (m :: Type -> Type).
    Monad m =>
    (forall d. Data d => d -> m d) -> BlendMode -> m BlendMode
    gmapM :: forall (m :: Type -> Type).
    Monad m =>
    (forall d. Data d => d -> m d) -> BlendMode -> m BlendMode
    $cgmapMp :: forall (m :: Type -> Type).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> BlendMode -> m BlendMode
    gmapMp :: forall (m :: Type -> Type).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> BlendMode -> m BlendMode
    $cgmapMo :: forall (m :: Type -> Type).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> BlendMode -> m BlendMode
    gmapMo :: forall (m :: Type -> Type).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> BlendMode -> m BlendMode
    Data, Int -> BlendMode
    BlendMode -> Int
    BlendMode -> [BlendMode]
    BlendMode -> BlendMode
    BlendMode -> BlendMode -> [BlendMode]
    BlendMode -> BlendMode -> BlendMode -> [BlendMode]
    (BlendMode -> BlendMode)
    -> (BlendMode -> BlendMode)
    -> (Int -> BlendMode)
    -> (BlendMode -> Int)
    -> (BlendMode -> [BlendMode])
    -> (BlendMode -> BlendMode -> [BlendMode])
    -> (BlendMode -> BlendMode -> [BlendMode])
    -> (BlendMode -> BlendMode -> BlendMode -> [BlendMode])
    -> Enum BlendMode
    forall a.
    (a -> a)
    -> (a -> a)
    -> (Int -> a)
    -> (a -> Int)
    -> (a -> [a])
    -> (a -> a -> [a])
    -> (a -> a -> [a])
    -> (a -> a -> a -> [a])
    -> Enum a
    $csucc :: BlendMode -> BlendMode
    succ :: BlendMode -> BlendMode
    $cpred :: BlendMode -> BlendMode
    pred :: BlendMode -> BlendMode
    $ctoEnum :: Int -> BlendMode
    toEnum :: Int -> BlendMode
    $cfromEnum :: BlendMode -> Int
    fromEnum :: BlendMode -> Int
    $cenumFrom :: BlendMode -> [BlendMode]
    enumFrom :: BlendMode -> [BlendMode]
    $cenumFromThen :: BlendMode -> BlendMode -> [BlendMode]
    enumFromThen :: BlendMode -> BlendMode -> [BlendMode]
    $cenumFromTo :: BlendMode -> BlendMode -> [BlendMode]
    enumFromTo :: BlendMode -> BlendMode -> [BlendMode]
    $cenumFromThenTo :: BlendMode -> BlendMode -> BlendMode -> [BlendMode]
    enumFromThenTo :: BlendMode -> BlendMode -> BlendMode -> [BlendMode]
    Enum, BlendMode -> BlendMode -> Bool
    (BlendMode -> BlendMode -> Bool)
    -> (BlendMode -> BlendMode -> Bool) -> Eq BlendMode
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: BlendMode -> BlendMode -> Bool
    == :: BlendMode -> BlendMode -> Bool
    $c/= :: BlendMode -> BlendMode -> Bool
    /= :: BlendMode -> BlendMode -> Bool
    Eq, (forall x. BlendMode -> Rep BlendMode x)
    -> (forall x. Rep BlendMode x -> BlendMode) -> Generic BlendMode
    forall x. Rep BlendMode x -> BlendMode
    forall x. BlendMode -> Rep BlendMode x
    forall a.
    (forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
    $cfrom :: forall x. BlendMode -> Rep BlendMode x
    from :: forall x. BlendMode -> Rep BlendMode x
    $cto :: forall x. Rep BlendMode x -> BlendMode
    to :: forall x. Rep BlendMode x -> BlendMode
    Generic, Eq BlendMode
    Eq BlendMode
    -> (BlendMode -> BlendMode -> Ordering)
    -> (BlendMode -> BlendMode -> Bool)
    -> (BlendMode -> BlendMode -> Bool)
    -> (BlendMode -> BlendMode -> Bool)
    -> (BlendMode -> BlendMode -> Bool)
    -> (BlendMode -> BlendMode -> BlendMode)
    -> (BlendMode -> BlendMode -> BlendMode)
    -> Ord BlendMode
    BlendMode -> BlendMode -> Bool
    BlendMode -> BlendMode -> Ordering
    BlendMode -> BlendMode -> BlendMode
    forall a.
    Eq a
    -> (a -> a -> Ordering)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> a)
    -> (a -> a -> a)
    -> Ord a
    $ccompare :: BlendMode -> BlendMode -> Ordering
    compare :: BlendMode -> BlendMode -> Ordering
    $c< :: BlendMode -> BlendMode -> Bool
    < :: BlendMode -> BlendMode -> Bool
    $c<= :: BlendMode -> BlendMode -> Bool
    <= :: BlendMode -> BlendMode -> Bool
    $c> :: BlendMode -> BlendMode -> Bool
    > :: BlendMode -> BlendMode -> Bool
    $c>= :: BlendMode -> BlendMode -> Bool
    >= :: BlendMode -> BlendMode -> Bool
    $cmax :: BlendMode -> BlendMode -> BlendMode
    max :: BlendMode -> BlendMode -> BlendMode
    $cmin :: BlendMode -> BlendMode -> BlendMode
    min :: BlendMode -> BlendMode -> BlendMode
    Ord, ReadPrec [BlendMode]
    ReadPrec BlendMode
    Int -> ReadS BlendMode
    ReadS [BlendMode]
    (Int -> ReadS BlendMode)
    -> ReadS [BlendMode]
    -> ReadPrec BlendMode
    -> ReadPrec [BlendMode]
    -> Read BlendMode
    forall a.
    (Int -> ReadS a)
    -> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
    $creadsPrec :: Int -> ReadS BlendMode
    readsPrec :: Int -> ReadS BlendMode
    $creadList :: ReadS [BlendMode]
    readList :: ReadS [BlendMode]
    $creadPrec :: ReadPrec BlendMode
    readPrec :: ReadPrec BlendMode
    $creadListPrec :: ReadPrec [BlendMode]
    readListPrec :: ReadPrec [BlendMode]
    Read, Int -> BlendMode -> ShowS
    [BlendMode] -> ShowS
    BlendMode -> [Char]
    (Int -> BlendMode -> ShowS)
    -> (BlendMode -> [Char])
    -> ([BlendMode] -> ShowS)
    -> Show BlendMode
    forall a.
    (Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> BlendMode -> ShowS
    showsPrec :: Int -> BlendMode -> ShowS
    $cshow :: BlendMode -> [Char]
    show :: BlendMode -> [Char]
    $cshowList :: [BlendMode] -> ShowS
    showList :: [BlendMode] -> ShowS
    Show, Typeable)

    instance FromNumber BlendMode Word32 where
      fromNumber :: BlendMode -> BlendMode
    fromNumber BlendMode
    n = case BlendMode
    n of
        BlendMode
    Raw.SDL_BLENDMODE_ADD -> BlendMode
    BlendAdditive
        BlendMode
    Raw.SDL_BLENDMODE_BLEND -> BlendMode
    BlendAlphaBlend
        BlendMode
    Raw.SDL_BLENDMODE_NONE -> BlendMode
    BlendNone
        BlendMode
    Raw.SDL_BLENDMODE_MOD -> BlendMode
    BlendMod
        BlendMode
    _ -> [Char] -> BlendMode
    forall a. HasCallStack => [Char] -> a
    error ([Char] -> BlendMode) -> [Char] -> BlendMode
    forall a b. (a -> b) -> a -> b
    $ [Char]
    "fromNumber<BlendMode>: unknown blend mode: " [Char] -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ BlendMode -> [Char]
    forall a. Show a => a -> [Char]
    show BlendMode
    n

    instance ToNumber BlendMode Word32 where
      toNumber :: BlendMode -> BlendMode
    toNumber BlendMode
    BlendNone = BlendMode
    Raw.SDL_BLENDMODE_NONE
      toNumber BlendMode
    BlendAlphaBlend = BlendMode
    Raw.SDL_BLENDMODE_BLEND
      toNumber BlendMode
    BlendAdditive = BlendMode
    Raw.SDL_BLENDMODE_ADD
      toNumber BlendMode
    BlendMod = BlendMode
    Raw.SDL_BLENDMODE_MOD

    data Rectangle a = Rectangle (Point V2 a) (V2 a)
      deriving (Rectangle a -> Rectangle a -> Bool
    (Rectangle a -> Rectangle a -> Bool)
    -> (Rectangle a -> Rectangle a -> Bool) -> Eq (Rectangle a)
    forall a. Eq a => Rectangle a -> Rectangle a -> Bool
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: forall a. Eq a => Rectangle a -> Rectangle a -> Bool
    == :: Rectangle a -> Rectangle a -> Bool
    $c/= :: forall a. Eq a => Rectangle a -> Rectangle a -> Bool
    /= :: Rectangle a -> Rectangle a -> Bool
    Eq, (forall a b. (a -> b) -> Rectangle a -> Rectangle b)
    -> (forall a b. a -> Rectangle b -> Rectangle a)
    -> Functor Rectangle
    forall a b. a -> Rectangle b -> Rectangle a
    forall a b. (a -> b) -> Rectangle a -> Rectangle b
    forall (f :: Type -> Type).
    (forall a b. (a -> b) -> f a -> f b)
    -> (forall a b. a -> f b -> f a) -> Functor f
    $cfmap :: forall a b. (a -> b) -> Rectangle a -> Rectangle b
    fmap :: forall a b. (a -> b) -> Rectangle a -> Rectangle b
    $c<$ :: forall a b. a -> Rectangle b -> Rectangle a
    <$ :: forall a b. a -> Rectangle b -> Rectangle a
    Functor, (forall x. Rectangle a -> Rep (Rectangle a) x)
    -> (forall x. Rep (Rectangle a) x -> Rectangle a)
    -> Generic (Rectangle a)
    forall x. Rep (Rectangle a) x -> Rectangle a
    forall x. Rectangle a -> Rep (Rectangle a) x
    forall a.
    (forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
    forall a x. Rep (Rectangle a) x -> Rectangle a
    forall a x. Rectangle a -> Rep (Rectangle a) x
    $cfrom :: forall a x. Rectangle a -> Rep (Rectangle a) x
    from :: forall x. Rectangle a -> Rep (Rectangle a) x
    $cto :: forall a x. Rep (Rectangle a) x -> Rectangle a
    to :: forall x. Rep (Rectangle a) x -> Rectangle a
    Generic, Eq (Rectangle a)
    Eq (Rectangle a)
    -> (Rectangle a -> Rectangle a -> Ordering)
    -> (Rectangle a -> Rectangle a -> Bool)
    -> (Rectangle a -> Rectangle a -> Bool)
    -> (Rectangle a -> Rectangle a -> Bool)
    -> (Rectangle a -> Rectangle a -> Bool)
    -> (Rectangle a -> Rectangle a -> Rectangle a)
    -> (Rectangle a -> Rectangle a -> Rectangle a)
    -> Ord (Rectangle a)
    Rectangle a -> Rectangle a -> Bool
    Rectangle a -> Rectangle a -> Ordering
    Rectangle a -> Rectangle a -> Rectangle a
    forall a.
    Eq a
    -> (a -> a -> Ordering)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> a)
    -> (a -> a -> a)
    -> Ord a
    forall {a}. Ord a => Eq (Rectangle a)
    forall a. Ord a => Rectangle a -> Rectangle a -> Bool
    forall a. Ord a => Rectangle a -> Rectangle a -> Ordering
    forall a. Ord a => Rectangle a -> Rectangle a -> Rectangle a
    $ccompare :: forall a. Ord a => Rectangle a -> Rectangle a -> Ordering
    compare :: Rectangle a -> Rectangle a -> Ordering
    $c< :: forall a. Ord a => Rectangle a -> Rectangle a -> Bool
    < :: Rectangle a -> Rectangle a -> Bool
    $c<= :: forall a. Ord a => Rectangle a -> Rectangle a -> Bool
    <= :: Rectangle a -> Rectangle a -> Bool
    $c> :: forall a. Ord a => Rectangle a -> Rectangle a -> Bool
    > :: Rectangle a -> Rectangle a -> Bool
    $c>= :: forall a. Ord a => Rectangle a -> Rectangle a -> Bool
    >= :: Rectangle a -> Rectangle a -> Bool
    $cmax :: forall a. Ord a => Rectangle a -> Rectangle a -> Rectangle a
    max :: Rectangle a -> Rectangle a -> Rectangle a
    $cmin :: forall a. Ord a => Rectangle a -> Rectangle a -> Rectangle a
    min :: Rectangle a -> Rectangle a -> Rectangle a
    Ord, ReadPrec [Rectangle a]
    ReadPrec (Rectangle a)
    Int -> ReadS (Rectangle a)
    ReadS [Rectangle a]
    (Int -> ReadS (Rectangle a))
    -> ReadS [Rectangle a]
    -> ReadPrec (Rectangle a)
    -> ReadPrec [Rectangle a]
    -> Read (Rectangle a)
    forall a. Read a => ReadPrec [Rectangle a]
    forall a. Read a => ReadPrec (Rectangle a)
    forall a. Read a => Int -> ReadS (Rectangle a)
    forall a. Read a => ReadS [Rectangle a]
    forall a.
    (Int -> ReadS a)
    -> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
    $creadsPrec :: forall a. Read a => Int -> ReadS (Rectangle a)
    readsPrec :: Int -> ReadS (Rectangle a)
    $creadList :: forall a. Read a => ReadS [Rectangle a]
    readList :: ReadS [Rectangle a]
    $creadPrec :: forall a. Read a => ReadPrec (Rectangle a)
    readPrec :: ReadPrec (Rectangle a)
    $creadListPrec :: forall a. Read a => ReadPrec [Rectangle a]
    readListPrec :: ReadPrec [Rectangle a]
    Read, Int -> Rectangle a -> ShowS
    [Rectangle a] -> ShowS
    Rectangle a -> [Char]
    (Int -> Rectangle a -> ShowS)
    -> (Rectangle a -> [Char])
    -> ([Rectangle a] -> ShowS)
    -> Show (Rectangle a)
    forall a. Show a => Int -> Rectangle a -> ShowS
    forall a. Show a => [Rectangle a] -> ShowS
    forall a. Show a => Rectangle a -> [Char]
    forall a.
    (Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: forall a. Show a => Int -> Rectangle a -> ShowS
    showsPrec :: Int -> Rectangle a -> ShowS
    $cshow :: forall a. Show a => Rectangle a -> [Char]
    show :: Rectangle a -> [Char]
    $cshowList :: forall a. Show a => [Rectangle a] -> ShowS
    showList :: [Rectangle a] -> ShowS
    Show, Typeable)

    instance Storable a => Storable (Rectangle a) where
      sizeOf :: Rectangle a -> Int
    sizeOf ~(Rectangle Point V2 a
    o V2 a
    s) = Point V2 a -> Int
    forall a. Storable a => a -> Int
    sizeOf Point V2 a
    o Int -> Int -> Int
    forall a. Num a => a -> a -> a
    + V2 a -> Int
    forall a. Storable a => a -> Int
    sizeOf V2 a
    s
      alignment :: Rectangle a -> Int
    alignment Rectangle a
    _ = a -> Int
    forall a. Storable a => a -> Int
    alignment (a
    forall a. HasCallStack => a
    undefined :: a)
      peek :: Ptr (Rectangle a) -> IO (Rectangle a)
    peek Ptr (Rectangle a)
    ptr = do
        Point V2 a
    o <- Ptr (Point V2 a) -> IO (Point V2 a)
    forall a. Storable a => Ptr a -> IO a
    peek (Ptr (Rectangle a) -> Ptr (Point V2 a)
    forall a b. Ptr a -> Ptr b
    castPtr Ptr (Rectangle a)
    ptr)
        V2 a
    s <- Ptr (V2 a) -> IO (V2 a)
    forall a. Storable a => Ptr a -> IO a
    peek (Ptr Any -> Ptr (V2 a)
    forall a b. Ptr a -> Ptr b
    castPtr (Ptr (Rectangle a)
    ptr Ptr (Rectangle a) -> Int -> Ptr Any
    forall a b. Ptr a -> Int -> Ptr b
    `plusPtr` Point V2 a -> Int
    forall a. Storable a => a -> Int
    sizeOf Point V2 a
    o))
        Rectangle a -> IO (Rectangle a)
    forall a. a -> IO a
    forall (m :: Type -> Type) a. Monad m => a -> m a
    return (Point V2 a -> V2 a -> Rectangle a
    forall a. Point V2 a -> V2 a -> Rectangle a
    Rectangle Point V2 a
    o V2 a
    s)
      poke :: Ptr (Rectangle a) -> Rectangle a -> IO ()
    poke Ptr (Rectangle a)
    ptr (Rectangle Point V2 a
    o V2 a
    s) = do
        Ptr (Point V2 a) -> Point V2 a -> IO ()
    forall a. Storable a => Ptr a -> a -> IO ()
    poke (Ptr (Rectangle a) -> Ptr (Point V2 a)
    forall a b. Ptr a -> Ptr b
    castPtr Ptr (Rectangle a)
    ptr) Point V2 a
    o
        Ptr (V2 a) -> V2 a -> IO ()
    forall a. Storable a => Ptr a -> a -> IO ()
    poke (Ptr Any -> Ptr (V2 a)
    forall a b. Ptr a -> Ptr b
    castPtr (Ptr (Rectangle a)
    ptr Ptr (Rectangle a) -> Int -> Ptr Any
    forall a b. Ptr a -> Int -> Ptr b
    `plusPtr` Point V2 a -> Int
    forall a. Storable a => a -> Int
    sizeOf Point V2 a
    o)) V2 a
    s

    data Surface = Surface (Ptr Raw.Surface) (Maybe (MSV.IOVector Word8))
      deriving (Typeable)

    unmanagedSurface :: Ptr Raw.Surface -> Surface
    unmanagedSurface :: Ptr Surface -> Surface
    unmanagedSurface Ptr Surface
    s = Ptr Surface -> Maybe (IOVector Word8) -> Surface
    Surface Ptr Surface
    s Maybe (IOVector Word8)
    forall a. Maybe a
    Nothing

    managedSurface :: MSV.IOVector Word8 -> Ptr Raw.Surface -> Surface
    managedSurface :: IOVector Word8 -> Ptr Surface -> Surface
    managedSurface IOVector Word8
    p Ptr Surface
    s = Ptr Surface -> Maybe (IOVector Word8) -> Surface
    Surface Ptr Surface
    s (IOVector Word8 -> Maybe (IOVector Word8)
    forall a. a -> Maybe a
    Just IOVector Word8
    p)

    newtype Texture = Texture Raw.Texture
      deriving (Texture -> Texture -> Bool
    (Texture -> Texture -> Bool)
    -> (Texture -> Texture -> Bool) -> Eq Texture
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: Texture -> Texture -> Bool
    == :: Texture -> Texture -> Bool
    $c/= :: Texture -> Texture -> Bool
    /= :: Texture -> Texture -> Bool
    Eq, Typeable)

    -- | Draw a rectangle outline on the current rendering target.
    --
    -- See @<https://wiki.libsdl.org/SDL_RenderDrawRect SDL_RenderDrawRect>@ for C documentation.
    drawRect :: MonadIO m
             => Renderer
             -> Maybe (Rectangle CInt) -- ^ The rectangle outline to draw. 'Nothing' for the entire rendering context.
             -> m ()
    drawRect :: forall (m :: Type -> Type).
    MonadIO m =>
    Renderer -> Maybe (Rectangle CInt) -> m ()
    drawRect (Renderer Renderer
    r) Maybe (Rectangle CInt)
    rect = IO () -> m ()
    forall a. IO a -> m a
    forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
    liftIO (IO () -> m ()) -> IO () -> m ()
    forall a b. (a -> b) -> a -> b
    $
      Text -> Text -> IO CInt -> IO ()
    forall (m :: Type -> Type) a.
    (MonadIO m, Num a, Ord a) =>
    Text -> Text -> m a -> m ()
    throwIfNeg_ Text
    "SDL.Video.drawRect" Text
    "SDL_RenderDrawRect" (IO CInt -> IO ()) -> IO CInt -> IO ()
    forall a b. (a -> b) -> a -> b
    $
      (Rectangle CInt -> (Ptr (Rectangle CInt) -> IO CInt) -> IO CInt)
    -> Maybe (Rectangle CInt)
    -> (Ptr (Rectangle CInt) -> IO CInt)
    -> IO CInt
    forall a b c.
    (a -> (Ptr b -> IO c) -> IO c)
    -> Maybe a -> (Ptr b -> IO c) -> IO c
    maybeWith Rectangle CInt -> (Ptr (Rectangle CInt) -> IO CInt) -> IO CInt
    forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
    with Maybe (Rectangle CInt)
    rect (Renderer -> Ptr Rect -> IO CInt
    forall (m :: Type -> Type).
    MonadIO m =>
    Renderer -> Ptr Rect -> m CInt
    Raw.renderDrawRect Renderer
    r (Ptr Rect -> IO CInt)
    -> (Ptr (Rectangle CInt) -> Ptr Rect)
    -> Ptr (Rectangle CInt)
    -> IO CInt
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Ptr (Rectangle CInt) -> Ptr Rect
    forall a b. Ptr a -> Ptr b
    castPtr)

    -- | Draw some number of rectangles on the current rendering target.
    --
    -- See @<https://wiki.libsdl.org/SDL_RenderDrawRects SDL_RenderDrawRects>@ for C documentation.
    drawRects :: MonadIO m => Renderer -> SV.Vector (Rectangle CInt) -> m ()
    drawRects :: forall (m :: Type -> Type).
    MonadIO m =>
    Renderer -> Vector (Rectangle CInt) -> m ()
    drawRects (Renderer Renderer
    r) Vector (Rectangle CInt)
    rects = IO () -> m ()
    forall a. IO a -> m a
    forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
    liftIO (IO () -> m ()) -> IO () -> m ()
    forall a b. (a -> b) -> a -> b
    $
      Text -> Text -> IO CInt -> IO ()
    forall (m :: Type -> Type) a.
    (MonadIO m, Num a, Ord a) =>
    Text -> Text -> m a -> m ()
    throwIfNeg_ Text
    "SDL.Video.drawRects" Text
    "SDL_RenderDrawRects" (IO CInt -> IO ()) -> IO CInt -> IO ()
    forall a b. (a -> b) -> a -> b
    $
      Vector (Rectangle CInt)
    -> (Ptr (Rectangle CInt) -> IO CInt) -> IO CInt
    forall a b. Storable a => Vector a -> (Ptr a -> IO b) -> IO b
    SV.unsafeWith Vector (Rectangle CInt)
    rects ((Ptr (Rectangle CInt) -> IO CInt) -> IO CInt)
    -> (Ptr (Rectangle CInt) -> IO CInt) -> IO CInt
    forall a b. (a -> b) -> a -> b
    $ \Ptr (Rectangle CInt)
    rp ->
        Renderer -> Ptr Rect -> CInt -> IO CInt
    forall (m :: Type -> Type).
    MonadIO m =>
    Renderer -> Ptr Rect -> CInt -> m CInt
    Raw.renderDrawRects Renderer
    r
                            (Ptr (Rectangle CInt) -> Ptr Rect
    forall a b. Ptr a -> Ptr b
    castPtr Ptr (Rectangle CInt)
    rp)
                            (Int -> CInt
    forall a b. (Integral a, Num b) => a -> b
    fromIntegral (Vector (Rectangle CInt) -> Int
    forall a. Storable a => Vector a -> Int
    SV.length Vector (Rectangle CInt)
    rects))

    -- | Fill a rectangle on the current rendering target with the drawing color.
    --
    -- See @<https://wiki.libsdl.org/SDL_RenderFillRect SDL_RenderFillRect>@ for C documentation.
    fillRect ::
         MonadIO m
      => Renderer
      -> Maybe (Rectangle CInt) -- ^ The rectangle to fill.
      -> m ()
    fillRect :: forall (m :: Type -> Type).
    MonadIO m =>
    Renderer -> Maybe (Rectangle CInt) -> m ()
    fillRect (Renderer Renderer
    r) Maybe (Rectangle CInt)
    rect =
      IO () -> m ()
    forall a. IO a -> m a
    forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
    liftIO (IO () -> m ()) -> IO () -> m ()
    forall a b. (a -> b) -> a -> b
    $
      Text -> Text -> IO CInt -> IO ()
    forall (m :: Type -> Type) a.
    (MonadIO m, Num a, Ord a) =>
    Text -> Text -> m a -> m ()
    throwIfNeg_ Text
    "SDL.Video.fillRect" Text
    "SDL_RenderFillRect" (IO CInt -> IO ()) -> IO CInt -> IO ()
    forall a b. (a -> b) -> a -> b
    $
      case Maybe (Rectangle CInt)
    rect of
        Maybe (Rectangle CInt)
    Nothing -> Renderer -> Ptr Rect -> IO CInt
    forall (m :: Type -> Type).
    MonadIO m =>
    Renderer -> Ptr Rect -> m CInt
    Raw.renderFillRect Renderer
    r Ptr Rect
    forall a. Ptr a
    nullPtr
        Just (Rectangle (P (V2 CInt
    x CInt
    y)) (V2 CInt
    w CInt
    h)) -> Renderer -> CInt -> CInt -> CInt -> CInt -> IO CInt
    forall (m :: Type -> Type).
    MonadIO m =>
    Renderer -> CInt -> CInt -> CInt -> CInt -> m CInt
    Raw.renderFillRectEx Renderer
    r CInt
    x CInt
    y CInt
    w CInt
    h
    {-# INLINE fillRect #-}

    -- | Fill some number of rectangles on the current rendering target with the drawing color.
    --
    -- See @<https://wiki.libsdl.org/SDL_RenderFillRects SDL_RenderFillRects>@ for C documentation.
    fillRects :: MonadIO m => Renderer -> SV.Vector (Rectangle CInt) -> m ()
    fillRects :: forall (m :: Type -> Type).
    MonadIO m =>
    Renderer -> Vector (Rectangle CInt) -> m ()
    fillRects (Renderer Renderer
    r) Vector (Rectangle CInt)
    rects = IO () -> m ()
    forall a. IO a -> m a
    forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
    liftIO (IO () -> m ()) -> IO () -> m ()
    forall a b. (a -> b) -> a -> b
    $
      Text -> Text -> IO CInt -> IO ()
    forall (m :: Type -> Type) a.
    (MonadIO m, Num a, Ord a) =>
    Text -> Text -> m a -> m ()
    throwIfNeg_ Text
    "SDL.Video.fillRects" Text
    "SDL_RenderFillRects" (IO CInt -> IO ()) -> IO CInt -> IO ()
    forall a b. (a -> b) -> a -> b
    $
        Vector (Rectangle CInt)
    -> (Ptr (Rectangle CInt) -> IO CInt) -> IO CInt
    forall a b. Storable a => Vector a -> (Ptr a -> IO b) -> IO b
    SV.unsafeWith Vector (Rectangle CInt)
    rects ((Ptr (Rectangle CInt) -> IO CInt) -> IO CInt)
    -> (Ptr (Rectangle CInt) -> IO CInt) -> IO CInt
    forall a b. (a -> b) -> a -> b
    $ \Ptr (Rectangle CInt)
    rp ->
          Renderer -> Ptr Rect -> CInt -> IO CInt
    forall (m :: Type -> Type).
    MonadIO m =>
    Renderer -> Ptr Rect -> CInt -> m CInt
    Raw.renderFillRects Renderer
    r
                              (Ptr (Rectangle CInt) -> Ptr Rect
    forall a b. Ptr a -> Ptr b
    castPtr Ptr (Rectangle CInt)
    rp)
                              (Int -> CInt
    forall a b. (Integral a, Num b) => a -> b
    fromIntegral (Vector (Rectangle CInt) -> Int
    forall a. Storable a => Vector a -> Int
    SV.length Vector (Rectangle CInt)
    rects))

    #ifdef RECENT_ISH

    -- | Copy a portion of the texture to the current rendering target.
    copyF :: MonadIO m => Renderer -> Texture -> Maybe (Rectangle CInt) -> Maybe (Rectangle CFloat) -> m ()
    copyF :: forall (m :: Type -> Type).
    MonadIO m =>
    Renderer
    -> Texture
    -> Maybe (Rectangle CInt)
    -> Maybe (Rectangle CFloat)
    -> m ()
    copyF (Renderer Renderer
    r) (Texture Renderer
    t) Maybe (Rectangle CInt)
    srcRect Maybe (Rectangle CFloat)
    dstRect = IO () -> m ()
    forall a. IO a -> m a
    forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
    liftIO (IO () -> m ()) -> IO () -> m ()
    forall a b. (a -> b) -> a -> b
    $
      Text -> Text -> IO CInt -> IO ()
    forall (m :: Type -> Type) a.
    (MonadIO m, Num a, Ord a) =>
    Text -> Text -> m a -> m ()
    throwIfNeg_ Text
    "SDL.Video.copyF" Text
    "SDL_RenderCopyF" (IO CInt -> IO ()) -> IO CInt -> IO ()
    forall a b. (a -> b) -> a -> b
    $
        (Rectangle CInt -> (Ptr (Rectangle CInt) -> IO CInt) -> IO CInt)
    -> Maybe (Rectangle CInt)
    -> (Ptr (Rectangle CInt) -> IO CInt)
    -> IO CInt
    forall a b c.
    (a -> (Ptr b -> IO c) -> IO c)
    -> Maybe a -> (Ptr b -> IO c) -> IO c
    maybeWith Rectangle CInt -> (Ptr (Rectangle CInt) -> IO CInt) -> IO CInt
    forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
    with Maybe (Rectangle CInt)
    srcRect ((Ptr (Rectangle CInt) -> IO CInt) -> IO CInt)
    -> (Ptr (Rectangle CInt) -> IO CInt) -> IO CInt
    forall a b. (a -> b) -> a -> b
    $ \Ptr (Rectangle CInt)
    src ->
          (Rectangle CFloat
     -> (Ptr (Rectangle CFloat) -> IO CInt) -> IO CInt)
    -> Maybe (Rectangle CFloat)
    -> (Ptr (Rectangle CFloat) -> IO CInt)
    -> IO CInt
    forall a b c.
    (a -> (Ptr b -> IO c) -> IO c)
    -> Maybe a -> (Ptr b -> IO c) -> IO c
    maybeWith Rectangle CFloat -> (Ptr (Rectangle CFloat) -> IO CInt) -> IO CInt
    forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
    with Maybe (Rectangle CFloat)
    dstRect ((Ptr (Rectangle CFloat) -> IO CInt) -> IO CInt)
    -> (Ptr (Rectangle CFloat) -> IO CInt) -> IO CInt
    forall a b. (a -> b) -> a -> b
    $ \Ptr (Rectangle CFloat)
    dst ->
            Renderer -> Renderer -> Ptr Rect -> Ptr FRect -> IO CInt
    forall (m :: Type -> Type).
    MonadIO m =>
    Renderer -> Renderer -> Ptr Rect -> Ptr FRect -> m CInt
    Raw.renderCopyF Renderer
    r Renderer
    t (Ptr (Rectangle CInt) -> Ptr Rect
    forall a b. Ptr a -> Ptr b
    castPtr Ptr (Rectangle CInt)
    src) (Ptr (Rectangle CFloat) -> Ptr FRect
    forall a b. Ptr a -> Ptr b
    castPtr Ptr (Rectangle CFloat)
    dst)

    -- | 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.
    copyExF :: 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 ()
    copyExF :: forall (m :: Type -> Type).
    MonadIO m =>
    Renderer
    -> Texture
    -> Maybe (Rectangle CInt)
    -> Maybe (Rectangle CFloat)
    -> CDouble
    -> Maybe (Point V2 CFloat)
    -> V2 Bool
    -> m ()
    copyExF (Renderer Renderer
    r) (Texture Renderer
    t) Maybe (Rectangle CInt)
    srcRect Maybe (Rectangle CFloat)
    dstRect CDouble
    theta Maybe (Point V2 CFloat)
    center V2 Bool
    flips =
      IO () -> m ()
    forall a. IO a -> m a
    forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
    liftIO (IO () -> m ()) -> IO () -> m ()
    forall a b. (a -> b) -> a -> b
    $
      Text -> Text -> IO CInt -> IO ()
    forall (m :: Type -> Type) a.
    (MonadIO m, Num a, Ord a) =>
    Text -> Text -> m a -> m ()
    throwIfNeg_ Text
    "SDL.Video.copyExF" Text
    "SDL_RenderCopyExF" (IO CInt -> IO ()) -> IO CInt -> IO ()
    forall a b. (a -> b) -> a -> b
    $
      (Rectangle CInt -> (Ptr (Rectangle CInt) -> IO CInt) -> IO CInt)
    -> Maybe (Rectangle CInt)
    -> (Ptr (Rectangle CInt) -> IO CInt)
    -> IO CInt
    forall a b c.
    (a -> (Ptr b -> IO c) -> IO c)
    -> Maybe a -> (Ptr b -> IO c) -> IO c
    maybeWith Rectangle CInt -> (Ptr (Rectangle CInt) -> IO CInt) -> IO CInt
    forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
    with Maybe (Rectangle CInt)
    srcRect ((Ptr (Rectangle CInt) -> IO CInt) -> IO CInt)
    -> (Ptr (Rectangle CInt) -> IO CInt) -> IO CInt
    forall a b. (a -> b) -> a -> b
    $ \Ptr (Rectangle CInt)
    src ->
      (Rectangle CFloat
     -> (Ptr (Rectangle CFloat) -> IO CInt) -> IO CInt)
    -> Maybe (Rectangle CFloat)
    -> (Ptr (Rectangle CFloat) -> IO CInt)
    -> IO CInt
    forall a b c.
    (a -> (Ptr b -> IO c) -> IO c)
    -> Maybe a -> (Ptr b -> IO c) -> IO c
    maybeWith Rectangle CFloat -> (Ptr (Rectangle CFloat) -> IO CInt) -> IO CInt
    forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
    with Maybe (Rectangle CFloat)
    dstRect ((Ptr (Rectangle CFloat) -> IO CInt) -> IO CInt)
    -> (Ptr (Rectangle CFloat) -> IO CInt) -> IO CInt
    forall a b. (a -> b) -> a -> b
    $ \Ptr (Rectangle CFloat)
    dst ->
      (Point V2 CFloat -> (Ptr (Point V2 CFloat) -> IO CInt) -> IO CInt)
    -> Maybe (Point V2 CFloat)
    -> (Ptr (Point V2 CFloat) -> IO CInt)
    -> IO CInt
    forall a b c.
    (a -> (Ptr b -> IO c) -> IO c)
    -> Maybe a -> (Ptr b -> IO c) -> IO c
    maybeWith Point V2 CFloat -> (Ptr (Point V2 CFloat) -> IO CInt) -> IO CInt
    forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
    with Maybe (Point V2 CFloat)
    center ((Ptr (Point V2 CFloat) -> IO CInt) -> IO CInt)
    -> (Ptr (Point V2 CFloat) -> IO CInt) -> IO CInt
    forall a b. (a -> b) -> a -> b
    $ \Ptr (Point V2 CFloat)
    c ->
      Renderer
    -> Renderer
    -> Ptr Rect
    -> Ptr FRect
    -> CDouble
    -> Ptr FPoint
    -> BlendMode
    -> IO CInt
    forall (m :: Type -> Type).
    MonadIO m =>
    Renderer
    -> Renderer
    -> Ptr Rect
    -> Ptr FRect
    -> CDouble
    -> Ptr FPoint
    -> BlendMode
    -> m CInt
    Raw.renderCopyExF Renderer
    r Renderer
    t (Ptr (Rectangle CInt) -> Ptr Rect
    forall a b. Ptr a -> Ptr b
    castPtr Ptr (Rectangle CInt)
    src) (Ptr (Rectangle CFloat) -> Ptr FRect
    forall a b. Ptr a -> Ptr b
    castPtr Ptr (Rectangle CFloat)
    dst) CDouble
    theta (Ptr (Point V2 CFloat) -> Ptr FPoint
    forall a b. Ptr a -> Ptr b
    castPtr Ptr (Point V2 CFloat)
    c)
                       (case V2 Bool
    flips of
                          V2 Bool
    x Bool
    y -> (if Bool
    x then BlendMode
    Raw.SDL_FLIP_HORIZONTAL else BlendMode
    0) BlendMode -> BlendMode -> BlendMode
    forall a. Bits a => a -> a -> a
    .|.
                                   (if Bool
    y then BlendMode
    Raw.SDL_FLIP_VERTICAL else BlendMode
    0))

    -- | Draw a line between two points on the current rendering target.
    drawLineF :: MonadIO m => Renderer -> Point V2 CFloat -> Point V2 CFloat -> m ()
    drawLineF :: forall (m :: Type -> Type).
    MonadIO m =>
    Renderer -> Point V2 CFloat -> Point V2 CFloat -> m ()
    drawLineF (Renderer Renderer
    r) (P (V2 CFloat
    x CFloat
    y)) (P (V2 CFloat
    x' CFloat
    y')) = IO () -> m ()
    forall a. IO a -> m a
    forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
    liftIO (IO () -> m ()) -> IO () -> m ()
    forall a b. (a -> b) -> a -> b
    $
      Text -> Text -> IO CInt -> IO ()
    forall (m :: Type -> Type) a.
    (MonadIO m, Num a, Ord a) =>
    Text -> Text -> m a -> m ()
    throwIfNeg_ Text
    "SDL.Video.drawLineF" Text
    "SDL_RenderDrawLineF" (IO CInt -> IO ()) -> IO CInt -> IO ()
    forall a b. (a -> b) -> a -> b
    $
        Renderer -> CFloat -> CFloat -> CFloat -> CFloat -> IO CInt
    forall (m :: Type -> Type).
    MonadIO m =>
    Renderer -> CFloat -> CFloat -> CFloat -> CFloat -> m CInt
    Raw.renderDrawLineF Renderer
    r CFloat
    x CFloat
    y CFloat
    x' CFloat
    y'

    -- | Draw a series of connected lines on the current rendering target.
    drawLinesF :: MonadIO m => Renderer -> SV.Vector (Point V2 CFloat) -> m ()
    drawLinesF :: forall (m :: Type -> Type).
    MonadIO m =>
    Renderer -> Vector (Point V2 CFloat) -> m ()
    drawLinesF (Renderer Renderer
    r) Vector (Point V2 CFloat)
    points = IO () -> m ()
    forall a. IO a -> m a
    forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
    liftIO (IO () -> m ()) -> IO () -> m ()
    forall a b. (a -> b) -> a -> b
    $
      Text -> Text -> IO CInt -> IO ()
    forall (m :: Type -> Type) a.
    (MonadIO m, Num a, Ord a) =>
    Text -> Text -> m a -> m ()
    throwIfNeg_ Text
    "SDL.Video.drawLinesF" Text
    "SDL_RenderDrawLinesF" (IO CInt -> IO ()) -> IO CInt -> IO ()
    forall a b. (a -> b) -> a -> b
    $
        Vector (Point V2 CFloat)
    -> (Ptr (Point V2 CFloat) -> IO CInt) -> IO CInt
    forall a b. Storable a => Vector a -> (Ptr a -> IO b) -> IO b
    SV.unsafeWith Vector (Point V2 CFloat)
    points ((Ptr (Point V2 CFloat) -> IO CInt) -> IO CInt)
    -> (Ptr (Point V2 CFloat) -> IO CInt) -> IO CInt
    forall a b. (a -> b) -> a -> b
    $ \Ptr (Point V2 CFloat)
    p ->
          Renderer -> Ptr FPoint -> CInt -> IO CInt
    forall (m :: Type -> Type).
    MonadIO m =>
    Renderer -> Ptr FPoint -> CInt -> m CInt
    Raw.renderDrawLinesF Renderer
    r (Ptr (Point V2 CFloat) -> Ptr FPoint
    forall a b. Ptr a -> Ptr b
    castPtr Ptr (Point V2 CFloat)
    p) (Int -> CInt
    forall a b. (Integral a, Num b) => a -> b
    fromIntegral (Vector (Point V2 CFloat) -> Int
    forall a. Storable a => Vector a -> Int
    SV.length Vector (Point V2 CFloat)
    points))

    -- | Draw a point on the current rendering target.
    drawPointF :: MonadIO m => Renderer -> Point V2 CFloat -> m ()
    drawPointF :: forall (m :: Type -> Type).
    MonadIO m =>
    Renderer -> Point V2 CFloat -> m ()
    drawPointF (Renderer Renderer
    r) (P (V2 CFloat
    x CFloat
    y)) = IO () -> m ()
    forall a. IO a -> m a
    forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
    liftIO (IO () -> m ()) -> IO () -> m ()
    forall a b. (a -> b) -> a -> b
    $
      Text -> Text -> IO CInt -> IO ()
    forall (m :: Type -> Type) a.
    (MonadIO m, Num a, Ord a) =>
    Text -> Text -> m a -> m ()
    throwIfNeg_ Text
    "SDL.Video.drawPointF" Text
    "SDL_RenderDrawPointF" (IO CInt -> IO ()) -> IO CInt -> IO ()
    forall a b. (a -> b) -> a -> b
    $
        Renderer -> CFloat -> CFloat -> IO CInt
    forall (m :: Type -> Type).
    MonadIO m =>
    Renderer -> CFloat -> CFloat -> m CInt
    Raw.renderDrawPointF Renderer
    r CFloat
    x CFloat
    y

    -- | Draw a collection of points on the current rendering target.
    drawPointsF :: MonadIO m => Renderer -> SV.Vector (Point V2 CFloat) -> m ()
    drawPointsF :: forall (m :: Type -> Type).
    MonadIO m =>
    Renderer -> Vector (Point V2 CFloat) -> m ()
    drawPointsF (Renderer Renderer
    r) Vector (Point V2 CFloat)
    points = IO () -> m ()
    forall a. IO a -> m a
    forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
    liftIO (IO () -> m ()) -> IO () -> m ()
    forall a b. (a -> b) -> a -> b
    $
      Text -> Text -> IO CInt -> IO ()
    forall (m :: Type -> Type) a.
    (MonadIO m, Num a, Ord a) =>
    Text -> Text -> m a -> m ()
    throwIfNeg_ Text
    "SDL.Video.drawPointsF" Text
    "SDL_RenderDrawPointsF" (IO CInt -> IO ()) -> IO CInt -> IO ()
    forall a b. (a -> b) -> a -> b
    $
        Vector (Point V2 CFloat)
    -> (Ptr (Point V2 CFloat) -> IO CInt) -> IO CInt
    forall a b. Storable a => Vector a -> (Ptr a -> IO b) -> IO b
    SV.unsafeWith Vector (Point V2 CFloat)
    points ((Ptr (Point V2 CFloat) -> IO CInt) -> IO CInt)
    -> (Ptr (Point V2 CFloat) -> IO CInt) -> IO CInt
    forall a b. (a -> b) -> a -> b
    $ \Ptr (Point V2 CFloat)
    p ->
          Renderer -> Ptr FPoint -> CInt -> IO CInt
    forall (m :: Type -> Type).
    MonadIO m =>
    Renderer -> Ptr FPoint -> CInt -> m CInt
    Raw.renderDrawPointsF Renderer
    r (Ptr (Point V2 CFloat) -> Ptr FPoint
    forall a b. Ptr a -> Ptr b
    castPtr Ptr (Point V2 CFloat)
    p) (Int -> CInt
    forall a b. (Integral a, Num b) => a -> b
    fromIntegral (Vector (Point V2 CFloat) -> Int
    forall a. Storable a => Vector a -> Int
    SV.length Vector (Point V2 CFloat)
    points))

    -- | Draw the outline of a rectangle on the current rendering target.
    drawRectF :: MonadIO m => Renderer -> Rectangle CFloat -> m ()
    drawRectF :: forall (m :: Type -> Type).
    MonadIO m =>
    Renderer -> Rectangle CFloat -> m ()
    drawRectF (Renderer Renderer
    r) Rectangle CFloat
    rect = IO () -> m ()
    forall a. IO a -> m a
    forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
    liftIO (IO () -> m ()) -> IO () -> m ()
    forall a b. (a -> b) -> a -> b
    $
      Text -> Text -> IO CInt -> IO ()
    forall (m :: Type -> Type) a.
    (MonadIO m, Num a, Ord a) =>
    Text -> Text -> m a -> m ()
    throwIfNeg_ Text
    "SDL.Video.drawRectF" Text
    "SDL_RenderDrawRectF" (IO CInt -> IO ()) -> IO CInt -> IO ()
    forall a b. (a -> b) -> a -> b
    $
        Rectangle CFloat -> (Ptr (Rectangle CFloat) -> IO CInt) -> IO CInt
    forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
    with Rectangle CFloat
    rect ((Ptr (Rectangle CFloat) -> IO CInt) -> IO CInt)
    -> (Ptr (Rectangle CFloat) -> IO CInt) -> IO CInt
    forall a b. (a -> b) -> a -> b
    $ \Ptr (Rectangle CFloat)
    rectPtr ->
          Renderer -> Ptr FRect -> IO CInt
    forall (m :: Type -> Type).
    MonadIO m =>
    Renderer -> Ptr FRect -> m CInt
    Raw.renderDrawRectF Renderer
    r (Ptr (Rectangle CFloat) -> Ptr FRect
    forall a b. Ptr a -> Ptr b
    castPtr Ptr (Rectangle CFloat)
    rectPtr)

    -- | Draw a series of rectangle outlines on the current rendering target.
    drawRectsF :: MonadIO m => Renderer -> SV.Vector (Rectangle CFloat) -> m ()
    drawRectsF :: forall (m :: Type -> Type).
    MonadIO m =>
    Renderer -> Vector (Rectangle CFloat) -> m ()
    drawRectsF (Renderer Renderer
    r) Vector (Rectangle CFloat)
    rects = IO () -> m ()
    forall a. IO a -> m a
    forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
    liftIO (IO () -> m ()) -> IO () -> m ()
    forall a b. (a -> b) -> a -> b
    $
      Text -> Text -> IO CInt -> IO ()
    forall (m :: Type -> Type) a.
    (MonadIO m, Num a, Ord a) =>
    Text -> Text -> m a -> m ()
    throwIfNeg_ Text
    "SDL.Video.drawRectsF" Text
    "SDL_RenderDrawRectsF" (IO CInt -> IO ()) -> IO CInt -> IO ()
    forall a b. (a -> b) -> a -> b
    $
        Vector (Rectangle CFloat)
    -> (Ptr (Rectangle CFloat) -> IO CInt) -> IO CInt
    forall a b. Storable a => Vector a -> (Ptr a -> IO b) -> IO b
    SV.unsafeWith Vector (Rectangle CFloat)
    rects ((Ptr (Rectangle CFloat) -> IO CInt) -> IO CInt)
    -> (Ptr (Rectangle CFloat) -> IO CInt) -> IO CInt
    forall a b. (a -> b) -> a -> b
    $ \Ptr (Rectangle CFloat)
    rp ->
          Renderer -> Ptr FRect -> CInt -> IO CInt
    forall (m :: Type -> Type).
    MonadIO m =>
    Renderer -> Ptr FRect -> CInt -> m CInt
    Raw.renderDrawRectsF Renderer
    r (Ptr (Rectangle CFloat) -> Ptr FRect
    forall a b. Ptr a -> Ptr b
    castPtr Ptr (Rectangle CFloat)
    rp) (Int -> CInt
    forall a b. (Integral a, Num b) => a -> b
    fromIntegral (Vector (Rectangle CFloat) -> Int
    forall a. Storable a => Vector a -> Int
    SV.length Vector (Rectangle CFloat)
    rects))

    -- | Draw a filled rectangle on the current rendering target.
    fillRectF :: MonadIO m => Renderer -> Rectangle CFloat -> m ()
    fillRectF :: forall (m :: Type -> Type).
    MonadIO m =>
    Renderer -> Rectangle CFloat -> m ()
    fillRectF (Renderer Renderer
    r) Rectangle CFloat
    rect = IO () -> m ()
    forall a. IO a -> m a
    forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
    liftIO (IO () -> m ()) -> IO () -> m ()
    forall a b. (a -> b) -> a -> b
    $
      Text -> Text -> IO CInt -> IO ()
    forall (m :: Type -> Type) a.
    (MonadIO m, Num a, Ord a) =>
    Text -> Text -> m a -> m ()
    throwIfNeg_ Text
    "SDL.Video.fillRectF" Text
    "SDL_RenderFillRectF" (IO CInt -> IO ()) -> IO CInt -> IO ()
    forall a b. (a -> b) -> a -> b
    $
        Rectangle CFloat -> (Ptr (Rectangle CFloat) -> IO CInt) -> IO CInt
    forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
    with Rectangle CFloat
    rect ((Ptr (Rectangle CFloat) -> IO CInt) -> IO CInt)
    -> (Ptr (Rectangle CFloat) -> IO CInt) -> IO CInt
    forall a b. (a -> b) -> a -> b
    $ \Ptr (Rectangle CFloat)
    rectPtr ->
          Renderer -> Ptr FRect -> IO CInt
    forall (m :: Type -> Type).
    MonadIO m =>
    Renderer -> Ptr FRect -> m CInt
    Raw.renderFillRectF Renderer
    r (Ptr (Rectangle CFloat) -> Ptr FRect
    forall a b. Ptr a -> Ptr b
    castPtr Ptr (Rectangle CFloat)
    rectPtr)

    -- | Draw a series of filled rectangles on the current rendering target.
    fillRectsF :: MonadIO m => Renderer -> SV.Vector (Rectangle CFloat) -> m ()
    fillRectsF :: forall (m :: Type -> Type).
    MonadIO m =>
    Renderer -> Vector (Rectangle CFloat) -> m ()
    fillRectsF (Renderer Renderer
    r) Vector (Rectangle CFloat)
    rects = IO () -> m ()
    forall a. IO a -> m a
    forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
    liftIO (IO () -> m ()) -> IO () -> m ()
    forall a b. (a -> b) -> a -> b
    $
      Text -> Text -> IO CInt -> IO ()
    forall (m :: Type -> Type) a.
    (MonadIO m, Num a, Ord a) =>
    Text -> Text -> m a -> m ()
    throwIfNeg_ Text
    "SDL.Video.fillRectsF" Text
    "SDL_RenderFillRectsF" (IO CInt -> IO ()) -> IO CInt -> IO ()
    forall a b. (a -> b) -> a -> b
    $
        Vector (Rectangle CFloat)
    -> (Ptr (Rectangle CFloat) -> IO CInt) -> IO CInt
    forall a b. Storable a => Vector a -> (Ptr a -> IO b) -> IO b
    SV.unsafeWith Vector (Rectangle CFloat)
    rects ((Ptr (Rectangle CFloat) -> IO CInt) -> IO CInt)
    -> (Ptr (Rectangle CFloat) -> IO CInt) -> IO CInt
    forall a b. (a -> b) -> a -> b
    $ \Ptr (Rectangle CFloat)
    rp ->
          Renderer -> Ptr FRect -> CInt -> IO CInt
    forall (m :: Type -> Type).
    MonadIO m =>
    Renderer -> Ptr FRect -> CInt -> m CInt
    Raw.renderFillRectsF Renderer
    r (Ptr (Rectangle CFloat) -> Ptr FRect
    forall a b. Ptr a -> Ptr b
    castPtr Ptr (Rectangle CFloat)
    rp) (Int -> CInt
    forall a b. (Integral a, Num b) => a -> b
    fromIntegral (Vector (Rectangle CFloat) -> Int
    forall a. Storable a => Vector a -> Int
    SV.length Vector (Rectangle CFloat)
    rects))

    -- | 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).
    renderGeometry :: MonadIO m => Renderer -> Maybe Texture -> SV.Vector Raw.Vertex -> SV.Vector CInt -> m ()
    renderGeometry :: forall (m :: Type -> Type).
    MonadIO m =>
    Renderer -> Maybe Texture -> Vector Vertex -> Vector CInt -> m ()
    renderGeometry (Renderer Renderer
    r) Maybe Texture
    mtexture Vector Vertex
    vertices Vector CInt
    indices = IO () -> m ()
    forall a. IO a -> m a
    forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
    liftIO (IO () -> m ()) -> IO () -> m ()
    forall a b. (a -> b) -> a -> b
    $
      Text -> Text -> IO CInt -> IO ()
    forall (m :: Type -> Type) a.
    (MonadIO m, Num a, Ord a) =>
    Text -> Text -> m a -> m ()
    throwIfNeg_ Text
    "SDL.Video.renderGeometry" Text
    "SDL_RenderGeometry" (IO CInt -> IO ()) -> IO CInt -> IO ()
    forall a b. (a -> b) -> a -> b
    $
        Vector Vertex -> (Ptr Vertex -> IO CInt) -> IO CInt
    forall a b. Storable a => Vector a -> (Ptr a -> IO b) -> IO b
    SV.unsafeWith Vector Vertex
    vertices ((Ptr Vertex -> IO CInt) -> IO CInt)
    -> (Ptr Vertex -> IO CInt) -> IO CInt
    forall a b. (a -> b) -> a -> b
    $ \Ptr Vertex
    vp ->
          Vector CInt -> (Ptr CInt -> IO CInt) -> IO CInt
    forall a b. Storable a => Vector a -> (Ptr a -> IO b) -> IO b
    SV.unsafeWith Vector CInt
    indices ((Ptr CInt -> IO CInt) -> IO CInt)
    -> (Ptr CInt -> IO CInt) -> IO CInt
    forall a b. (a -> b) -> a -> b
    $ \Ptr CInt
    ip ->
            Renderer
    -> Renderer -> Ptr Vertex -> CInt -> Ptr CInt -> CInt -> IO CInt
    forall (m :: Type -> Type).
    MonadIO m =>
    Renderer
    -> Renderer -> Ptr Vertex -> CInt -> Ptr CInt -> CInt -> m CInt
    Raw.renderGeometry Renderer
    r Renderer
    t Ptr Vertex
    vp (Int -> CInt
    forall a b. (Integral a, Num b) => a -> b
    fromIntegral (Vector Vertex -> Int
    forall a. Storable a => Vector a -> Int
    SV.length Vector Vertex
    vertices)) (Ptr CInt -> Ptr CInt
    forall {a}. Ptr a -> Ptr a
    ipOrNull Ptr CInt
    ip) CInt
    ipSize
      where
        t :: Renderer
    t = case Maybe Texture
    mtexture of
          Just (Texture Renderer
    found) -> Renderer
    found
          Maybe Texture
    Nothing -> Renderer
    forall a. Ptr a
    nullPtr

        ipOrNull :: Ptr a -> Ptr a
    ipOrNull Ptr a
    ip = if CInt
    ipSize CInt -> CInt -> Bool
    forall a. Eq a => a -> a -> Bool
    == CInt
    0 then Ptr a
    forall a. Ptr a
    nullPtr else Ptr a
    ip

        ipSize :: CInt
    ipSize = Int -> CInt
    forall a b. (Integral a, Num b) => a -> b
    fromIntegral (Vector CInt -> Int
    forall a. Storable a => Vector a -> Int
    SV.length Vector CInt
    indices)

    -- | 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.
    renderGeometryRaw :: forall ix m . (Storable ix, MonadIO m) => Renderer -> Maybe Texture -> Ptr Raw.FPoint -> CInt -> Ptr Raw.Color -> CInt -> Ptr Raw.FPoint -> CInt -> CInt -> SV.Vector ix -> m ()
    renderGeometryRaw :: forall ix (m :: Type -> Type).
    (Storable ix, MonadIO m) =>
    Renderer
    -> Maybe Texture
    -> Ptr FPoint
    -> CInt
    -> Ptr Color
    -> CInt
    -> Ptr FPoint
    -> CInt
    -> CInt
    -> Vector ix
    -> m ()
    renderGeometryRaw (Renderer Renderer
    r) Maybe Texture
    mtexture Ptr FPoint
    xy CInt
    xyStride Ptr Color
    color CInt
    colorStride Ptr FPoint
    uv CInt
    uvStride CInt
    numVertices Vector ix
    indices = IO () -> m ()
    forall a. IO a -> m a
    forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
    liftIO (IO () -> m ()) -> IO () -> m ()
    forall a b. (a -> b) -> a -> b
    $
      Text -> Text -> IO CInt -> IO ()
    forall (m :: Type -> Type) a.
    (MonadIO m, Num a, Ord a) =>
    Text -> Text -> m a -> m ()
    throwIfNeg_ Text
    "SDL.Video.renderGeometryRaw" Text
    "SDL_RenderGeometryRaw" (IO CInt -> IO ()) -> IO CInt -> IO ()
    forall a b. (a -> b) -> a -> b
    $
        Vector ix -> (Ptr ix -> IO CInt) -> IO CInt
    forall a b. Storable a => Vector a -> (Ptr a -> IO b) -> IO b
    SV.unsafeWith Vector ix
    indices ((Ptr ix -> IO CInt) -> IO CInt) -> (Ptr ix -> IO CInt) -> IO CInt
    forall a b. (a -> b) -> a -> b
    $ \Ptr ix
    ip ->
          Renderer
    -> Renderer
    -> Ptr FPoint
    -> CInt
    -> Ptr Color
    -> CInt
    -> Ptr FPoint
    -> CInt
    -> CInt
    -> Renderer
    -> CInt
    -> CInt
    -> IO CInt
    forall (m :: Type -> Type).
    MonadIO m =>
    Renderer
    -> Renderer
    -> Ptr FPoint
    -> CInt
    -> Ptr Color
    -> CInt
    -> Ptr FPoint
    -> CInt
    -> CInt
    -> Renderer
    -> CInt
    -> CInt
    -> m CInt
    Raw.renderGeometryRaw Renderer
    r Renderer
    t Ptr FPoint
    xy CInt
    xyStride Ptr Color
    color CInt
    colorStride Ptr FPoint
    uv CInt
    uvStride CInt
    numVertices (Ptr ix -> Renderer
    forall a b. Ptr a -> Ptr b
    castPtr (Ptr ix -> Renderer) -> Ptr ix -> Renderer
    forall a b. (a -> b) -> a -> b
    $ Ptr ix -> Ptr ix
    forall {a}. Ptr a -> Ptr a
    ipOrNull Ptr ix
    ip) CInt
    ipSize CInt
    sizeOfip
      where
        t :: Renderer
    t = case Maybe Texture
    mtexture of
          Just (Texture Renderer
    found) -> Renderer
    found
          Maybe Texture
    Nothing -> Renderer
    forall a. Ptr a
    nullPtr

        ipOrNull :: Ptr a -> Ptr a
    ipOrNull Ptr a
    ip = if CInt
    ipSize CInt -> CInt -> Bool
    forall a. Eq a => a -> a -> Bool
    == CInt
    0 then Ptr a
    forall a. Ptr a
    nullPtr else Ptr a
    ip

        ipSize :: CInt
    ipSize = Int -> CInt
    forall a b. (Integral a, Num b) => a -> b
    fromIntegral (Vector ix -> Int
    forall a. Storable a => Vector a -> Int
    SV.length Vector ix
    indices)

        sizeOfip :: CInt
    sizeOfip = Int -> CInt
    forall a b. (Integral a, Num b) => a -> b
    fromIntegral (Int -> CInt) -> Int -> CInt
    forall a b. (a -> b) -> a -> b
    $ ix -> Int
    forall a. Storable a => a -> Int
    sizeOf (ix
    forall a. HasCallStack => a
    undefined :: ix)
    #endif

    -- | Clear the current rendering target with the drawing color.
    --
    -- See @<https://wiki.libsdl.org/SDL_RenderClear SDL_RenderClear>@ for C documentation.
    clear :: (Functor m, MonadIO m) => Renderer -> m ()
    clear :: forall (m :: Type -> Type).
    (Functor m, MonadIO m) =>
    Renderer -> m ()
    clear (Renderer Renderer
    r) =
      Text -> Text -> m CInt -> m ()
    forall (m :: Type -> Type) a.
    (MonadIO m, Num a, Ord a) =>
    Text -> Text -> m a -> m ()
    throwIfNeg_ Text
    "SDL.Video.clear" Text
    "SDL_RenderClear" (m CInt -> m ()) -> m CInt -> m ()
    forall a b. (a -> b) -> a -> b
    $
      Renderer -> m CInt
    forall (m :: Type -> Type). MonadIO m => Renderer -> m CInt
    Raw.renderClear Renderer
    r
    {-# INLINE clear #-}

    -- | 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 @<https://wiki.libsdl.org/SDL_RenderSetScale SDL_RenderSetScale>@ and @<https://wiki.libsdl.org/SDL_RenderGetScale SDL_RenderGetScale>@ for C documentation.
    rendererScale :: Renderer -> StateVar (V2 CFloat)
    rendererScale :: Renderer -> StateVar (V2 CFloat)
    rendererScale (Renderer Renderer
    r) = IO (V2 CFloat) -> (V2 CFloat -> IO ()) -> StateVar (V2 CFloat)
    forall a. IO a -> (a -> IO ()) -> StateVar a
    makeStateVar IO (V2 CFloat)
    renderGetScale V2 CFloat -> IO ()
    forall {m :: Type -> Type}. MonadIO m => V2 CFloat -> m ()
    renderSetScale
      where
      renderSetScale :: V2 CFloat -> m ()
    renderSetScale (V2 CFloat
    x CFloat
    y) =
        Text -> Text -> m CInt -> m ()
    forall (m :: Type -> Type) a.
    (MonadIO m, Num a, Ord a) =>
    Text -> Text -> m a -> m ()
    throwIfNeg_ Text
    "SDL.Video.renderSetScale" Text
    "SDL_RenderSetScale" (m CInt -> m ()) -> m CInt -> m ()
    forall a b. (a -> b) -> a -> b
    $
        Renderer -> CFloat -> CFloat -> m CInt
    forall (m :: Type -> Type).
    MonadIO m =>
    Renderer -> CFloat -> CFloat -> m CInt
    Raw.renderSetScale Renderer
    r CFloat
    x CFloat
    y

      renderGetScale :: IO (V2 CFloat)
    renderGetScale = IO (V2 CFloat) -> IO (V2 CFloat)
    forall a. IO a -> IO a
    forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
    liftIO (IO (V2 CFloat) -> IO (V2 CFloat))
    -> IO (V2 CFloat) -> IO (V2 CFloat)
    forall a b. (a -> b) -> a -> b
    $
        (Ptr CFloat -> IO (V2 CFloat)) -> IO (V2 CFloat)
    forall a b. Storable a => (Ptr a -> IO b) -> IO b
    alloca ((Ptr CFloat -> IO (V2 CFloat)) -> IO (V2 CFloat))
    -> (Ptr CFloat -> IO (V2 CFloat)) -> IO (V2 CFloat)
    forall a b. (a -> b) -> a -> b
    $ \Ptr CFloat
    w ->
        (Ptr CFloat -> IO (V2 CFloat)) -> IO (V2 CFloat)
    forall a b. Storable a => (Ptr a -> IO b) -> IO b
    alloca ((Ptr CFloat -> IO (V2 CFloat)) -> IO (V2 CFloat))
    -> (Ptr CFloat -> IO (V2 CFloat)) -> IO (V2 CFloat)
    forall a b. (a -> b) -> a -> b
    $ \Ptr CFloat
    h -> do
          Renderer -> Ptr CFloat -> Ptr CFloat -> IO ()
    forall (m :: Type -> Type).
    MonadIO m =>
    Renderer -> Ptr CFloat -> Ptr CFloat -> m ()
    Raw.renderGetScale Renderer
    r Ptr CFloat
    w Ptr CFloat
    h
          CFloat -> CFloat -> V2 CFloat
    forall a. a -> a -> V2 a
    V2 (CFloat -> CFloat -> V2 CFloat)
    -> IO CFloat -> IO (CFloat -> V2 CFloat)
    forall (f :: Type -> Type) a b. Functor f => (a -> b) -> f a -> f b
    <$> Ptr CFloat -> IO CFloat
    forall a. Storable a => Ptr a -> IO a
    peek Ptr CFloat
    w IO (CFloat -> V2 CFloat) -> IO CFloat -> IO (V2 CFloat)
    forall a b. IO (a -> b) -> IO a -> IO b
    forall (f :: Type -> Type) a b.
    Applicative f =>
    f (a -> b) -> f a -> f b
    <*> Ptr CFloat -> IO CFloat
    forall a. Storable a => Ptr a -> IO a
    peek Ptr CFloat
    h

    -- | 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 @<https://wiki.libsdl.org/SDL_RenderSetClipRect SDL_RenderSetClipRect>@ and @<https://wiki.libsdl.org/SDL_RenderGetClipRect SDL_RenderGetClipRect>@ for C documentation.
    rendererClipRect :: Renderer -> StateVar (Maybe (Rectangle CInt))
    rendererClipRect :: Renderer -> StateVar (Maybe (Rectangle CInt))
    rendererClipRect (Renderer Renderer
    r) = IO (Maybe (Rectangle CInt))
    -> (Maybe (Rectangle CInt) -> IO ())
    -> StateVar (Maybe (Rectangle CInt))
    forall a. IO a -> (a -> IO ()) -> StateVar a
    makeStateVar IO (Maybe (Rectangle CInt))
    renderGetClipRect Maybe (Rectangle CInt) -> IO ()
    forall {m :: Type -> Type} {b}.
    (MonadIO m, Storable b) =>
    Maybe b -> m ()
    renderSetClipRect
      where
      renderGetClipRect :: IO (Maybe (Rectangle CInt))
    renderGetClipRect = IO (Maybe (Rectangle CInt)) -> IO (Maybe (Rectangle CInt))
    forall a. IO a -> IO a
    forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
    liftIO (IO (Maybe (Rectangle CInt)) -> IO (Maybe (Rectangle CInt)))
    -> IO (Maybe (Rectangle CInt)) -> IO (Maybe (Rectangle CInt))
    forall a b. (a -> b) -> a -> b
    $
        (Ptr Rect -> IO (Maybe (Rectangle CInt)))
    -> IO (Maybe (Rectangle CInt))
    forall a b. Storable a => (Ptr a -> IO b) -> IO b
    alloca ((Ptr Rect -> IO (Maybe (Rectangle CInt)))
     -> IO (Maybe (Rectangle CInt)))
    -> (Ptr Rect -> IO (Maybe (Rectangle CInt)))
    -> IO (Maybe (Rectangle CInt))
    forall a b. (a -> b) -> a -> b
    $ \Ptr Rect
    rPtr -> do
          Renderer -> Ptr Rect -> IO ()
    forall (m :: Type -> Type).
    MonadIO m =>
    Renderer -> Ptr Rect -> m ()
    Raw.renderGetClipRect Renderer
    r Ptr Rect
    rPtr
          (Ptr (Rectangle CInt) -> IO (Rectangle CInt))
    -> Ptr (Rectangle CInt) -> IO (Maybe (Rectangle CInt))
    forall a b. (Ptr a -> IO b) -> Ptr a -> IO (Maybe b)
    maybePeek Ptr (Rectangle CInt) -> IO (Rectangle CInt)
    forall a. Storable a => Ptr a -> IO a
    peek (Ptr Rect -> Ptr (Rectangle CInt)
    forall a b. Ptr a -> Ptr b
    castPtr Ptr Rect
    rPtr)
      renderSetClipRect :: Maybe b -> m ()
    renderSetClipRect Maybe b
    rect =
        IO () -> m ()
    forall a. IO a -> m a
    forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
    liftIO (IO () -> m ()) -> IO () -> m ()
    forall a b. (a -> b) -> a -> b
    $
        Text -> Text -> IO CInt -> IO ()
    forall (m :: Type -> Type) a.
    (MonadIO m, Num a, Ord a) =>
    Text -> Text -> m a -> m ()
    throwIfNeg_ Text
    "SDL.Video.renderSetClipRect" Text
    "SDL_RenderSetClipRect" (IO CInt -> IO ()) -> IO CInt -> IO ()
    forall a b. (a -> b) -> a -> b
    $
        (b -> (Ptr b -> IO CInt) -> IO CInt)
    -> Maybe b -> (Ptr b -> IO CInt) -> IO CInt
    forall a b c.
    (a -> (Ptr b -> IO c) -> IO c)
    -> Maybe a -> (Ptr b -> IO c) -> IO c
    maybeWith b -> (Ptr b -> IO CInt) -> IO CInt
    forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
    with Maybe b
    rect ((Ptr b -> IO CInt) -> IO CInt) -> (Ptr b -> IO CInt) -> IO CInt
    forall a b. (a -> b) -> a -> b
    $ Renderer -> Ptr Rect -> IO CInt
    forall (m :: Type -> Type).
    MonadIO m =>
    Renderer -> Ptr Rect -> m CInt
    Raw.renderSetClipRect Renderer
    r (Ptr Rect -> IO CInt) -> (Ptr b -> Ptr Rect) -> Ptr b -> IO CInt
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Ptr b -> Ptr Rect
    forall a b. Ptr a -> Ptr b
    castPtr

    -- | 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 @<https://wiki.libsdl.org/SDL_RenderSetViewport SDL_RenderSetViewport>@ and @<https://wiki.libsdl.org/SDL_RenderGetViewport SDL_RenderGetViewport>@ for C documentation.
    rendererViewport :: Renderer -> StateVar (Maybe (Rectangle CInt))
    rendererViewport :: Renderer -> StateVar (Maybe (Rectangle CInt))
    rendererViewport (Renderer Renderer
    r) = IO (Maybe (Rectangle CInt))
    -> (Maybe (Rectangle CInt) -> IO ())
    -> StateVar (Maybe (Rectangle CInt))
    forall a. IO a -> (a -> IO ()) -> StateVar a
    makeStateVar IO (Maybe (Rectangle CInt))
    renderGetViewport Maybe (Rectangle CInt) -> IO ()
    forall {m :: Type -> Type} {b}.
    (MonadIO m, Storable b) =>
    Maybe b -> m ()
    renderSetViewport
      where
      renderGetViewport :: IO (Maybe (Rectangle CInt))
    renderGetViewport = IO (Maybe (Rectangle CInt)) -> IO (Maybe (Rectangle CInt))
    forall a. IO a -> IO a
    forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
    liftIO (IO (Maybe (Rectangle CInt)) -> IO (Maybe (Rectangle CInt)))
    -> IO (Maybe (Rectangle CInt)) -> IO (Maybe (Rectangle CInt))
    forall a b. (a -> b) -> a -> b
    $
        (Ptr Rect -> IO (Maybe (Rectangle CInt)))
    -> IO (Maybe (Rectangle CInt))
    forall a b. Storable a => (Ptr a -> IO b) -> IO b
    alloca ((Ptr Rect -> IO (Maybe (Rectangle CInt)))
     -> IO (Maybe (Rectangle CInt)))
    -> (Ptr Rect -> IO (Maybe (Rectangle CInt)))
    -> IO (Maybe (Rectangle CInt))
    forall a b. (a -> b) -> a -> b
    $ \Ptr Rect
    rect -> do
          Renderer -> Ptr Rect -> IO ()
    forall (m :: Type -> Type).
    MonadIO m =>
    Renderer -> Ptr Rect -> m ()
    Raw.renderGetViewport Renderer
    r Ptr Rect
    rect
          (Ptr (Rectangle CInt) -> IO (Rectangle CInt))
    -> Ptr (Rectangle CInt) -> IO (Maybe (Rectangle CInt))
    forall a b. (Ptr a -> IO b) -> Ptr a -> IO (Maybe b)
    maybePeek Ptr (Rectangle CInt) -> IO (Rectangle CInt)
    forall a. Storable a => Ptr a -> IO a
    peek (Ptr Rect -> Ptr (Rectangle CInt)
    forall a b. Ptr a -> Ptr b
    castPtr Ptr Rect
    rect)

      renderSetViewport :: Maybe b -> m ()
    renderSetViewport Maybe b
    rect =
        IO () -> m ()
    forall a. IO a -> m a
    forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
    liftIO (IO () -> m ()) -> IO () -> m ()
    forall a b. (a -> b) -> a -> b
    $
        Text -> Text -> IO CInt -> IO ()
    forall (m :: Type -> Type) a.
    (MonadIO m, Num a, Ord a) =>
    Text -> Text -> m a -> m ()
    throwIfNeg_ Text
    "SDL.Video.renderSetViewport" Text
    "SDL_RenderSetViewport" (IO CInt -> IO ()) -> IO CInt -> IO ()
    forall a b. (a -> b) -> a -> b
    $
        (b -> (Ptr b -> IO CInt) -> IO CInt)
    -> Maybe b -> (Ptr b -> IO CInt) -> IO CInt
    forall a b c.
    (a -> (Ptr b -> IO c) -> IO c)
    -> Maybe a -> (Ptr b -> IO c) -> IO c
    maybeWith b -> (Ptr b -> IO CInt) -> IO CInt
    forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
    with Maybe b
    rect ((Ptr b -> IO CInt) -> IO CInt) -> (Ptr b -> IO CInt) -> IO CInt
    forall a b. (a -> b) -> a -> b
    $ Renderer -> Ptr Rect -> IO CInt
    forall (m :: Type -> Type).
    MonadIO m =>
    Renderer -> Ptr Rect -> m CInt
    Raw.renderSetViewport Renderer
    r (Ptr Rect -> IO CInt) -> (Ptr b -> Ptr Rect) -> Ptr b -> IO CInt
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Ptr b -> Ptr Rect
    forall a b. Ptr a -> Ptr b
    castPtr

    -- | 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 @<https://wiki.libsdl.org/SDL_RenderPresent SDL_RenderPresent>@ for C documentation.
    present :: MonadIO m => Renderer -> m ()
    present :: forall (m :: Type -> Type). MonadIO m => Renderer -> m ()
    present (Renderer Renderer
    r) = Renderer -> m ()
    forall (m :: Type -> Type). MonadIO m => Renderer -> m ()
    Raw.renderPresent Renderer
    r

    -- | Copy a portion of the texture to the current rendering target.
    --
    -- See @<https://wiki.libsdl.org/SDL_RenderCopy SDL_RenderCopy>@ for C documentation.
    copy :: 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 :: forall (m :: Type -> Type).
    MonadIO m =>
    Renderer
    -> Texture
    -> Maybe (Rectangle CInt)
    -> Maybe (Rectangle CInt)
    -> m ()
    copy (Renderer Renderer
    r) (Texture Renderer
    t) Maybe (Rectangle CInt)
    srcRect Maybe (Rectangle CInt)
    dstRect =
      IO () -> m ()
    forall a. IO a -> m a
    forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
    liftIO (IO () -> m ()) -> IO () -> m ()
    forall a b. (a -> b) -> a -> b
    $
      Text -> Text -> IO CInt -> IO ()
    forall (m :: Type -> Type) a.
    (MonadIO m, Num a, Ord a) =>
    Text -> Text -> m a -> m ()
    throwIfNeg_ Text
    "SDL.Video.copy" Text
    "SDL_RenderCopy" (IO CInt -> IO ()) -> IO CInt -> IO ()
    forall a b. (a -> b) -> a -> b
    $
      (Rectangle CInt -> (Ptr (Rectangle CInt) -> IO CInt) -> IO CInt)
    -> Maybe (Rectangle CInt)
    -> (Ptr (Rectangle CInt) -> IO CInt)
    -> IO CInt
    forall a b c.
    (a -> (Ptr b -> IO c) -> IO c)
    -> Maybe a -> (Ptr b -> IO c) -> IO c
    maybeWith Rectangle CInt -> (Ptr (Rectangle CInt) -> IO CInt) -> IO CInt
    forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
    with Maybe (Rectangle CInt)
    srcRect ((Ptr (Rectangle CInt) -> IO CInt) -> IO CInt)
    -> (Ptr (Rectangle CInt) -> IO CInt) -> IO CInt
    forall a b. (a -> b) -> a -> b
    $ \Ptr (Rectangle CInt)
    src ->
      (Rectangle CInt -> (Ptr (Rectangle CInt) -> IO CInt) -> IO CInt)
    -> Maybe (Rectangle CInt)
    -> (Ptr (Rectangle CInt) -> IO CInt)
    -> IO CInt
    forall a b c.
    (a -> (Ptr b -> IO c) -> IO c)
    -> Maybe a -> (Ptr b -> IO c) -> IO c
    maybeWith Rectangle CInt -> (Ptr (Rectangle CInt) -> IO CInt) -> IO CInt
    forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
    with Maybe (Rectangle CInt)
    dstRect ((Ptr (Rectangle CInt) -> IO CInt) -> IO CInt)
    -> (Ptr (Rectangle CInt) -> IO CInt) -> IO CInt
    forall a b. (a -> b) -> a -> b
    $ \Ptr (Rectangle CInt)
    dst ->
      Renderer -> Renderer -> Ptr Rect -> Ptr Rect -> IO CInt
    forall (m :: Type -> Type).
    MonadIO m =>
    Renderer -> Renderer -> Ptr Rect -> Ptr Rect -> m CInt
    Raw.renderCopy Renderer
    r Renderer
    t (Ptr (Rectangle CInt) -> Ptr Rect
    forall a b. Ptr a -> Ptr b
    castPtr Ptr (Rectangle CInt)
    src) (Ptr (Rectangle CInt) -> Ptr Rect
    forall a b. Ptr a -> Ptr b
    castPtr Ptr (Rectangle CInt)
    dst)

    -- | 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 @<https://wiki.libsdl.org/SDL_RenderCopyEx SDL_RenderCopyEx>@ for C documentation.
    copyEx :: 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 ()
    copyEx :: forall (m :: Type -> Type).
    MonadIO m =>
    Renderer
    -> Texture
    -> Maybe (Rectangle CInt)
    -> Maybe (Rectangle CInt)
    -> CDouble
    -> Maybe (Point V2 CInt)
    -> V2 Bool
    -> m ()
    copyEx (Renderer Renderer
    r) (Texture Renderer
    t) Maybe (Rectangle CInt)
    srcRect Maybe (Rectangle CInt)
    dstRect CDouble
    theta Maybe (Point V2 CInt)
    center V2 Bool
    flips =
      IO () -> m ()
    forall a. IO a -> m a
    forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
    liftIO (IO () -> m ()) -> IO () -> m ()
    forall a b. (a -> b) -> a -> b
    $
      Text -> Text -> IO CInt -> IO ()
    forall (m :: Type -> Type) a.
    (MonadIO m, Num a, Ord a) =>
    Text -> Text -> m a -> m ()
    throwIfNeg_ Text
    "SDL.Video.copyEx" Text
    "SDL_RenderCopyEx" (IO CInt -> IO ()) -> IO CInt -> IO ()
    forall a b. (a -> b) -> a -> b
    $
      (Rectangle CInt -> (Ptr (Rectangle CInt) -> IO CInt) -> IO CInt)
    -> Maybe (Rectangle CInt)
    -> (Ptr (Rectangle CInt) -> IO CInt)
    -> IO CInt
    forall a b c.
    (a -> (Ptr b -> IO c) -> IO c)
    -> Maybe a -> (Ptr b -> IO c) -> IO c
    maybeWith Rectangle CInt -> (Ptr (Rectangle CInt) -> IO CInt) -> IO CInt
    forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
    with Maybe (Rectangle CInt)
    srcRect ((Ptr (Rectangle CInt) -> IO CInt) -> IO CInt)
    -> (Ptr (Rectangle CInt) -> IO CInt) -> IO CInt
    forall a b. (a -> b) -> a -> b
    $ \Ptr (Rectangle CInt)
    src ->
      (Rectangle CInt -> (Ptr (Rectangle CInt) -> IO CInt) -> IO CInt)
    -> Maybe (Rectangle CInt)
    -> (Ptr (Rectangle CInt) -> IO CInt)
    -> IO CInt
    forall a b c.
    (a -> (Ptr b -> IO c) -> IO c)
    -> Maybe a -> (Ptr b -> IO c) -> IO c
    maybeWith Rectangle CInt -> (Ptr (Rectangle CInt) -> IO CInt) -> IO CInt
    forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
    with Maybe (Rectangle CInt)
    dstRect ((Ptr (Rectangle CInt) -> IO CInt) -> IO CInt)
    -> (Ptr (Rectangle CInt) -> IO CInt) -> IO CInt
    forall a b. (a -> b) -> a -> b
    $ \Ptr (Rectangle CInt)
    dst ->
      (Point V2 CInt -> (Ptr (Point V2 CInt) -> IO CInt) -> IO CInt)
    -> Maybe (Point V2 CInt)
    -> (Ptr (Point V2 CInt) -> IO CInt)
    -> IO CInt
    forall a b c.
    (a -> (Ptr b -> IO c) -> IO c)
    -> Maybe a -> (Ptr b -> IO c) -> IO c
    maybeWith Point V2 CInt -> (Ptr (Point V2 CInt) -> IO CInt) -> IO CInt
    forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
    with Maybe (Point V2 CInt)
    center ((Ptr (Point V2 CInt) -> IO CInt) -> IO CInt)
    -> (Ptr (Point V2 CInt) -> IO CInt) -> IO CInt
    forall a b. (a -> b) -> a -> b
    $ \Ptr (Point V2 CInt)
    c ->
      Renderer
    -> Renderer
    -> Ptr Rect
    -> Ptr Rect
    -> CDouble
    -> Ptr Point
    -> BlendMode
    -> IO CInt
    forall (m :: Type -> Type).
    MonadIO m =>
    Renderer
    -> Renderer
    -> Ptr Rect
    -> Ptr Rect
    -> CDouble
    -> Ptr Point
    -> BlendMode
    -> m CInt
    Raw.renderCopyEx Renderer
    r Renderer
    t (Ptr (Rectangle CInt) -> Ptr Rect
    forall a b. Ptr a -> Ptr b
    castPtr Ptr (Rectangle CInt)
    src) (Ptr (Rectangle CInt) -> Ptr Rect
    forall a b. Ptr a -> Ptr b
    castPtr Ptr (Rectangle CInt)
    dst) CDouble
    theta (Ptr (Point V2 CInt) -> Ptr Point
    forall a b. Ptr a -> Ptr b
    castPtr Ptr (Point V2 CInt)
    c)
                       (case V2 Bool
    flips of
                          V2 Bool
    x Bool
    y -> (if Bool
    x then BlendMode
    Raw.SDL_FLIP_HORIZONTAL else BlendMode
    0) BlendMode -> BlendMode -> BlendMode
    forall a. Bits a => a -> a -> a
    .|.
                                   (if Bool
    y then BlendMode
    Raw.SDL_FLIP_VERTICAL else BlendMode
    0))

    -- | Draw a line on the current rendering target.
    --
    -- See @<https://wiki.libsdl.org/SDL_RenderDrawLine SDL_RenderDrawLine>@ for C documentation.
    drawLine :: (Functor m,MonadIO m)
             => Renderer
             -> Point V2 CInt -- ^ The start point of the line
             -> Point V2 CInt -- ^ The end point of the line
             -> m ()
    drawLine :: forall (m :: Type -> Type).
    (Functor m, MonadIO m) =>
    Renderer -> Point V2 CInt -> Point V2 CInt -> m ()
    drawLine (Renderer Renderer
    r) (P (V2 CInt
    x CInt
    y)) (P (V2 CInt
    x' CInt
    y')) =
      Text -> Text -> m CInt -> m ()
    forall (m :: Type -> Type) a.
    (MonadIO m, Num a, Ord a) =>
    Text -> Text -> m a -> m ()
    throwIfNeg_ Text
    "SDL.Video.drawLine" Text
    "SDL_RenderDrawLine" (m CInt -> m ()) -> m CInt -> m ()
    forall a b. (a -> b) -> a -> b
    $
      Renderer -> CInt -> CInt -> CInt -> CInt -> m CInt
    forall (m :: Type -> Type).
    MonadIO m =>
    Renderer -> CInt -> CInt -> CInt -> CInt -> m CInt
    Raw.renderDrawLine Renderer
    r CInt
    x CInt
    y CInt
    x' CInt
    y'

    -- | Draw a series of connected lines on the current rendering target.
    --
    -- See @<https://wiki.libsdl.org/SDL_RenderDrawLines SDL_RenderDrawLines>@ for C documentation.
    drawLines :: MonadIO m
              => Renderer
              -> SV.Vector (Point V2 CInt) -- ^ A 'SV.Vector' of points along the line. SDL will draw lines between these points.
              -> m ()
    drawLines :: forall (m :: Type -> Type).
    MonadIO m =>
    Renderer -> Vector (Point V2 CInt) -> m ()
    drawLines (Renderer Renderer
    r) Vector (Point V2 CInt)
    points =
      IO () -> m ()
    forall a. IO a -> m a
    forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
    liftIO (IO () -> m ()) -> IO () -> m ()
    forall a b. (a -> b) -> a -> b
    $
      Text -> Text -> IO CInt -> IO ()
    forall (m :: Type -> Type) a.
    (MonadIO m, Num a, Ord a) =>
    Text -> Text -> m a -> m ()
    throwIfNeg_ Text
    "SDL.Video.drawLines" Text
    "SDL_RenderDrawLines" (IO CInt -> IO ()) -> IO CInt -> IO ()
    forall a b. (a -> b) -> a -> b
    $
      Vector (Point V2 CInt)
    -> (Ptr (Point V2 CInt) -> IO CInt) -> IO CInt
    forall a b. Storable a => Vector a -> (Ptr a -> IO b) -> IO b
    SV.unsafeWith Vector (Point V2 CInt)
    points ((Ptr (Point V2 CInt) -> IO CInt) -> IO CInt)
    -> (Ptr (Point V2 CInt) -> IO CInt) -> IO CInt
    forall a b. (a -> b) -> a -> b
    $ \Ptr (Point V2 CInt)
    cp ->
        Renderer -> Ptr Point -> CInt -> IO CInt
    forall (m :: Type -> Type).
    MonadIO m =>
    Renderer -> Ptr Point -> CInt -> m CInt
    Raw.renderDrawLines Renderer
    r
                            (Ptr (Point V2 CInt) -> Ptr Point
    forall a b. Ptr a -> Ptr b
    castPtr Ptr (Point V2 CInt)
    cp)
                            (Int -> CInt
    forall a b. (Integral a, Num b) => a -> b
    fromIntegral (Vector (Point V2 CInt) -> Int
    forall a. Storable a => Vector a -> Int
    SV.length Vector (Point V2 CInt)
    points))

    -- | Draw a point on the current rendering target.
    --
    -- See @<https://wiki.libsdl.org/SDL_RenderDrawPoint SDL_RenderDrawPoint>@ for C documentation.
    drawPoint :: (Functor m, MonadIO m) => Renderer -> Point V2 CInt -> m ()
    drawPoint :: forall (m :: Type -> Type).
    (Functor m, MonadIO m) =>
    Renderer -> Point V2 CInt -> m ()
    drawPoint (Renderer Renderer
    r) (P (V2 CInt
    x CInt
    y)) =
      Text -> Text -> m CInt -> m ()
    forall (m :: Type -> Type) a.
    (MonadIO m, Num a, Ord a) =>
    Text -> Text -> m a -> m ()
    throwIfNeg_ Text
    "SDL.Video.drawPoint" Text
    "SDL_RenderDrawPoint" (m CInt -> m ()) -> m CInt -> m ()
    forall a b. (a -> b) -> a -> b
    $
      Renderer -> CInt -> CInt -> m CInt
    forall (m :: Type -> Type).
    MonadIO m =>
    Renderer -> CInt -> CInt -> m CInt
    Raw.renderDrawPoint Renderer
    r CInt
    x CInt
    y

    -- | Draw multiple points on the current rendering target.
    --
    -- See @<https://wiki.libsdl.org/SDL_RenderDrawPoints SDL_RenderDrawPoints>@ for C documentation.
    drawPoints :: MonadIO m => Renderer -> SV.Vector (Point V2 CInt) -> m ()
    drawPoints :: forall (m :: Type -> Type).
    MonadIO m =>
    Renderer -> Vector (Point V2 CInt) -> m ()
    drawPoints (Renderer Renderer
    r) Vector (Point V2 CInt)
    points =
      IO () -> m ()
    forall a. IO a -> m a
    forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
    liftIO (IO () -> m ()) -> IO () -> m ()
    forall a b. (a -> b) -> a -> b
    $
      Text -> Text -> IO CInt -> IO ()
    forall (m :: Type -> Type) a.
    (MonadIO m, Num a, Ord a) =>
    Text -> Text -> m a -> m ()
    throwIfNeg_ Text
    "SDL.Video.drawPoints" Text
    "SDL_RenderDrawPoints" (IO CInt -> IO ()) -> IO CInt -> IO ()
    forall a b. (a -> b) -> a -> b
    $
      Vector (Point V2 CInt)
    -> (Ptr (Point V2 CInt) -> IO CInt) -> IO CInt
    forall a b. Storable a => Vector a -> (Ptr a -> IO b) -> IO b
    SV.unsafeWith Vector (Point V2 CInt)
    points ((Ptr (Point V2 CInt) -> IO CInt) -> IO CInt)
    -> (Ptr (Point V2 CInt) -> IO CInt) -> IO CInt
    forall a b. (a -> b) -> a -> b
    $ \Ptr (Point V2 CInt)
    cp ->
        Renderer -> Ptr Point -> CInt -> IO CInt
    forall (m :: Type -> Type).
    MonadIO m =>
    Renderer -> Ptr Point -> CInt -> m CInt
    Raw.renderDrawPoints Renderer
    r
                             (Ptr (Point V2 CInt) -> Ptr Point
    forall a b. Ptr a -> Ptr b
    castPtr Ptr (Point V2 CInt)
    cp)
                             (Int -> CInt
    forall a b. (Integral a, Num b) => a -> b
    fromIntegral (Vector (Point V2 CInt) -> Int
    forall a. Storable a => Vector a -> Int
    SV.length Vector (Point V2 CInt)
    points))

    -- | 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 @<https://wiki.libsdl.org/SDL_ConvertSurface SDL_ConvertSurface>@ for C documentation.
    convertSurface :: (Functor m,MonadIO m)
                   => Surface -- ^ The 'Surface' to convert
                   -> SurfacePixelFormat -- ^ The pixel format that the new surface is optimized for
                   -> m Surface
    convertSurface :: forall (m :: Type -> Type).
    (Functor m, MonadIO m) =>
    Surface -> SurfacePixelFormat -> m Surface
    convertSurface (Surface Ptr Surface
    s Maybe (IOVector Word8)
    _) (SurfacePixelFormat Ptr PixelFormat
    fmt) =
      (Ptr Surface -> Surface) -> m (Ptr Surface) -> m Surface
    forall a b. (a -> b) -> m a -> m b
    forall (f :: Type -> Type) a b. Functor f => (a -> b) -> f a -> f b
    fmap Ptr Surface -> Surface
    unmanagedSurface (m (Ptr Surface) -> m Surface) -> m (Ptr Surface) -> m Surface
    forall a b. (a -> b) -> a -> b
    $
      Text -> Text -> m (Ptr Surface) -> m (Ptr Surface)
    forall (m :: Type -> Type) a.
    MonadIO m =>
    Text -> Text -> m (Ptr a) -> m (Ptr a)
    throwIfNull Text
    "SDL.Video.Renderer.convertSurface" Text
    "SDL_ConvertSurface" (m (Ptr Surface) -> m (Ptr Surface))
    -> m (Ptr Surface) -> m (Ptr Surface)
    forall a b. (a -> b) -> a -> b
    $
      Ptr Surface -> Ptr PixelFormat -> BlendMode -> m (Ptr Surface)
    forall (m :: Type -> Type).
    MonadIO m =>
    Ptr Surface -> Ptr PixelFormat -> BlendMode -> m (Ptr Surface)
    Raw.convertSurface Ptr Surface
    s Ptr PixelFormat
    fmt BlendMode
    0

    -- | Perform a scaled surface copy to a destination surface.
    --
    -- See @<https://wiki.libsdl.org/SDL_BlitScaled SDL_BlitScaled>@ for C documentation.
    surfaceBlitScaled :: 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 ()
    surfaceBlitScaled :: forall (m :: Type -> Type).
    MonadIO m =>
    Surface
    -> Maybe (Rectangle CInt)
    -> Surface
    -> Maybe (Rectangle CInt)
    -> m ()
    surfaceBlitScaled (Surface Ptr Surface
    src Maybe (IOVector Word8)
    _) Maybe (Rectangle CInt)
    srcRect (Surface Ptr Surface
    dst Maybe (IOVector Word8)
    _) Maybe (Rectangle CInt)
    dstRect =
      IO () -> m ()
    forall a. IO a -> m a
    forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
    liftIO (IO () -> m ()) -> IO () -> m ()
    forall a b. (a -> b) -> a -> b
    $
      Text -> Text -> IO CInt -> IO ()
    forall (m :: Type -> Type) a.
    (MonadIO m, Num a, Ord a) =>
    Text -> Text -> m a -> m ()
    throwIfNeg_ Text
    "SDL.Video.blitSurface" Text
    "SDL_BlitSurface" (IO CInt -> IO ()) -> IO CInt -> IO ()
    forall a b. (a -> b) -> a -> b
    $
      (Rectangle CInt -> (Ptr (Rectangle CInt) -> IO CInt) -> IO CInt)
    -> Maybe (Rectangle CInt)
    -> (Ptr (Rectangle CInt) -> IO CInt)
    -> IO CInt
    forall a b c.
    (a -> (Ptr b -> IO c) -> IO c)
    -> Maybe a -> (Ptr b -> IO c) -> IO c
    maybeWith Rectangle CInt -> (Ptr (Rectangle CInt) -> IO CInt) -> IO CInt
    forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
    with Maybe (Rectangle CInt)
    srcRect ((Ptr (Rectangle CInt) -> IO CInt) -> IO CInt)
    -> (Ptr (Rectangle CInt) -> IO CInt) -> IO CInt
    forall a b. (a -> b) -> a -> b
    $ \Ptr (Rectangle CInt)
    srcPtr ->
      (Rectangle CInt -> (Ptr (Rectangle CInt) -> IO CInt) -> IO CInt)
    -> Maybe (Rectangle CInt)
    -> (Ptr (Rectangle CInt) -> IO CInt)
    -> IO CInt
    forall a b c.
    (a -> (Ptr b -> IO c) -> IO c)
    -> Maybe a -> (Ptr b -> IO c) -> IO c
    maybeWith Rectangle CInt -> (Ptr (Rectangle CInt) -> IO CInt) -> IO CInt
    forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
    with Maybe (Rectangle CInt)
    dstRect ((Ptr (Rectangle CInt) -> IO CInt) -> IO CInt)
    -> (Ptr (Rectangle CInt) -> IO CInt) -> IO CInt
    forall a b. (a -> b) -> a -> b
    $ \Ptr (Rectangle CInt)
    dstPtr ->
      Ptr Surface -> Ptr Rect -> Ptr Surface -> Ptr Rect -> IO CInt
    forall (m :: Type -> Type).
    MonadIO m =>
    Ptr Surface -> Ptr Rect -> Ptr Surface -> Ptr Rect -> m CInt
    Raw.blitScaled Ptr Surface
    src (Ptr (Rectangle CInt) -> Ptr Rect
    forall a b. Ptr a -> Ptr b
    castPtr Ptr (Rectangle CInt)
    srcPtr) Ptr Surface
    dst (Ptr (Rectangle CInt) -> Ptr Rect
    forall a b. Ptr a -> Ptr b
    castPtr Ptr (Rectangle CInt)
    dstPtr)

    -- | 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 @<https://wiki.libsdl.org/SDL_SetColorKey SDL_SetColorKey>@ and @<https://wiki.libsdl.org/SDL_GetColorKey SDL_GetColorKey>@ for C documentation.
    surfaceColorKey :: Surface -> StateVar (Maybe (V4 Word8))
    surfaceColorKey :: Surface -> StateVar (Maybe (V4 Word8))
    surfaceColorKey (Surface Ptr Surface
    s Maybe (IOVector Word8)
    _) = IO (Maybe (V4 Word8))
    -> (Maybe (V4 Word8) -> IO ()) -> StateVar (Maybe (V4 Word8))
    forall a. IO a -> (a -> IO ()) -> StateVar a
    makeStateVar IO (Maybe (V4 Word8))
    getColorKey Maybe (V4 Word8) -> IO ()
    forall {m :: Type -> Type}. MonadIO m => Maybe (V4 Word8) -> m ()
    setColorKey
      where
      getColorKey :: IO (Maybe (V4 Word8))
    getColorKey =
        IO (Maybe (V4 Word8)) -> IO (Maybe (V4 Word8))
    forall a. IO a -> IO a
    forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
    liftIO (IO (Maybe (V4 Word8)) -> IO (Maybe (V4 Word8)))
    -> IO (Maybe (V4 Word8)) -> IO (Maybe (V4 Word8))
    forall a b. (a -> b) -> a -> b
    $
        (Ptr BlendMode -> IO (Maybe (V4 Word8))) -> IO (Maybe (V4 Word8))
    forall a b. Storable a => (Ptr a -> IO b) -> IO b
    alloca ((Ptr BlendMode -> IO (Maybe (V4 Word8))) -> IO (Maybe (V4 Word8)))
    -> (Ptr BlendMode -> IO (Maybe (V4 Word8)))
    -> IO (Maybe (V4 Word8))
    forall a b. (a -> b) -> a -> b
    $ \Ptr BlendMode
    keyPtr -> do
          CInt
    ret <- Ptr Surface -> Ptr BlendMode -> IO CInt
    forall (m :: Type -> Type).
    MonadIO m =>
    Ptr Surface -> Ptr BlendMode -> m CInt
    Raw.getColorKey Ptr Surface
    s Ptr BlendMode
    keyPtr
          if CInt
    ret CInt -> CInt -> Bool
    forall a. Eq a => a -> a -> Bool
    == -CInt
    1
            then Maybe (V4 Word8) -> IO (Maybe (V4 Word8))
    forall a. a -> IO a
    forall (m :: Type -> Type) a. Monad m => a -> m a
    return Maybe (V4 Word8)
    forall a. Maybe a
    Nothing
            else do Ptr PixelFormat
    format <- IO (Ptr PixelFormat) -> IO (Ptr PixelFormat)
    forall a. IO a -> IO a
    forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
    liftIO (Surface -> Ptr PixelFormat
    Raw.surfaceFormat (Surface -> Ptr PixelFormat) -> IO Surface -> IO (Ptr PixelFormat)
    forall (f :: Type -> Type) a b. Functor f => (a -> b) -> f a -> f b
    <$> Ptr Surface -> IO Surface
    forall a. Storable a => Ptr a -> IO a
    peek Ptr Surface
    s)
                    BlendMode
    mapped <- Ptr BlendMode -> IO BlendMode
    forall a. Storable a => Ptr a -> IO a
    peek Ptr BlendMode
    keyPtr
                    (Ptr Word8 -> IO (Maybe (V4 Word8))) -> IO (Maybe (V4 Word8))
    forall a b. Storable a => (Ptr a -> IO b) -> IO b
    alloca ((Ptr Word8 -> IO (Maybe (V4 Word8))) -> IO (Maybe (V4 Word8)))
    -> (Ptr Word8 -> IO (Maybe (V4 Word8))) -> IO (Maybe (V4 Word8))
    forall a b. (a -> b) -> a -> b
    $ \Ptr Word8
    r ->
                      (Ptr Word8 -> IO (Maybe (V4 Word8))) -> IO (Maybe (V4 Word8))
    forall a b. Storable a => (Ptr a -> IO b) -> IO b
    alloca ((Ptr Word8 -> IO (Maybe (V4 Word8))) -> IO (Maybe (V4 Word8)))
    -> (Ptr Word8 -> IO (Maybe (V4 Word8))) -> IO (Maybe (V4 Word8))
    forall a b. (a -> b) -> a -> b
    $ \Ptr Word8
    g ->
                      (Ptr Word8 -> IO (Maybe (V4 Word8))) -> IO (Maybe (V4 Word8))
    forall a b. Storable a => (Ptr a -> IO b) -> IO b
    alloca ((Ptr Word8 -> IO (Maybe (V4 Word8))) -> IO (Maybe (V4 Word8)))
    -> (Ptr Word8 -> IO (Maybe (V4 Word8))) -> IO (Maybe (V4 Word8))
    forall a b. (a -> b) -> a -> b
    $ \Ptr Word8
    b ->
                      (Ptr Word8 -> IO (Maybe (V4 Word8))) -> IO (Maybe (V4 Word8))
    forall a b. Storable a => (Ptr a -> IO b) -> IO b
    alloca ((Ptr Word8 -> IO (Maybe (V4 Word8))) -> IO (Maybe (V4 Word8)))
    -> (Ptr Word8 -> IO (Maybe (V4 Word8))) -> IO (Maybe (V4 Word8))
    forall a b. (a -> b) -> a -> b
    $ \Ptr Word8
    a ->
                        do BlendMode
    -> Ptr PixelFormat
    -> Ptr Word8
    -> Ptr Word8
    -> Ptr Word8
    -> Ptr Word8
    -> IO ()
    forall (m :: Type -> Type).
    MonadIO m =>
    BlendMode
    -> Ptr PixelFormat
    -> Ptr Word8
    -> Ptr Word8
    -> Ptr Word8
    -> Ptr Word8
    -> m ()
    Raw.getRGBA BlendMode
    mapped Ptr PixelFormat
    format Ptr Word8
    r Ptr Word8
    g Ptr Word8
    b Ptr Word8
    a
                           V4 Word8 -> Maybe (V4 Word8)
    forall a. a -> Maybe a
    Just (V4 Word8 -> Maybe (V4 Word8))
    -> IO (V4 Word8) -> IO (Maybe (V4 Word8))
    forall (f :: Type -> Type) a b. Functor f => (a -> b) -> f a -> f b
    <$> (Word8 -> Word8 -> Word8 -> Word8 -> V4 Word8
    forall a. a -> a -> a -> a -> V4 a
    V4 (Word8 -> Word8 -> Word8 -> Word8 -> V4 Word8)
    -> IO Word8 -> IO (Word8 -> Word8 -> Word8 -> V4 Word8)
    forall (f :: Type -> Type) a b. Functor f => (a -> b) -> f a -> f b
    <$> Ptr Word8 -> IO Word8
    forall a. Storable a => Ptr a -> IO a
    peek Ptr Word8
    r IO (Word8 -> Word8 -> Word8 -> V4 Word8)
    -> IO Word8 -> IO (Word8 -> Word8 -> V4 Word8)
    forall a b. IO (a -> b) -> IO a -> IO b
    forall (f :: Type -> Type) a b.
    Applicative f =>
    f (a -> b) -> f a -> f b
    <*> Ptr Word8 -> IO Word8
    forall a. Storable a => Ptr a -> IO a
    peek Ptr Word8
    g IO (Word8 -> Word8 -> V4 Word8)
    -> IO Word8 -> IO (Word8 -> V4 Word8)
    forall a b. IO (a -> b) -> IO a -> IO b
    forall (f :: Type -> Type) a b.
    Applicative f =>
    f (a -> b) -> f a -> f b
    <*> Ptr Word8 -> IO Word8
    forall a. Storable a => Ptr a -> IO a
    peek Ptr Word8
    b IO (Word8 -> V4 Word8) -> IO Word8 -> IO (V4 Word8)
    forall a b. IO (a -> b) -> IO a -> IO b
    forall (f :: Type -> Type) a b.
    Applicative f =>
    f (a -> b) -> f a -> f b
    <*> Ptr Word8 -> IO Word8
    forall a. Storable a => Ptr a -> IO a
    peek Ptr Word8
    a)
      setColorKey :: Maybe (V4 Word8) -> m ()
    setColorKey Maybe (V4 Word8)
    key =
        IO () -> m ()
    forall a. IO a -> m a
    forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
    liftIO (IO () -> m ()) -> IO () -> m ()
    forall a b. (a -> b) -> a -> b
    $
        Text -> Text -> IO CInt -> IO ()
    forall (m :: Type -> Type) a.
    (MonadIO m, Num a, Ord a) =>
    Text -> Text -> m a -> m ()
    throwIfNeg_ Text
    "SDL.Video.Renderer.setColorKey" Text
    "SDL_SetColorKey" (IO CInt -> IO ()) -> IO CInt -> IO ()
    forall a b. (a -> b) -> a -> b
    $
        case Maybe (V4 Word8)
    key of
          Maybe (V4 Word8)
    Nothing ->
            (Ptr BlendMode -> IO CInt) -> IO CInt
    forall a b. Storable a => (Ptr a -> IO b) -> IO b
    alloca ((Ptr BlendMode -> IO CInt) -> IO CInt)
    -> (Ptr BlendMode -> IO CInt) -> IO CInt
    forall a b. (a -> b) -> a -> b
    $ \Ptr BlendMode
    keyPtr -> do
              -- TODO Error checking?
              CInt
    ret <- Ptr Surface -> Ptr BlendMode -> IO CInt
    forall (m :: Type -> Type).
    MonadIO m =>
    Ptr Surface -> Ptr BlendMode -> m CInt
    Raw.getColorKey Ptr Surface
    s Ptr BlendMode
    keyPtr
              if CInt
    ret CInt -> CInt -> Bool
    forall a. Eq a => a -> a -> Bool
    == -CInt
    1
                -- if ret == -1 then there is no key enabled, so we have nothing to
                -- do.
                then CInt -> IO CInt
    forall a. a -> IO a
    forall (m :: Type -> Type) a. Monad m => a -> m a
    return CInt
    0
                else do BlendMode
    key' <- Ptr BlendMode -> IO BlendMode
    forall a. Storable a => Ptr a -> IO a
    peek Ptr BlendMode
    keyPtr
                        Ptr Surface -> CInt -> BlendMode -> IO CInt
    forall (m :: Type -> Type).
    MonadIO m =>
    Ptr Surface -> CInt -> BlendMode -> m CInt
    Raw.setColorKey Ptr Surface
    s CInt
    0 BlendMode
    key'

          Just (V4 Word8
    r Word8
    g Word8
    b Word8
    a) -> do
            Ptr PixelFormat
    format <- IO (Ptr PixelFormat) -> IO (Ptr PixelFormat)
    forall a. IO a -> IO a
    forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
    liftIO (Surface -> Ptr PixelFormat
    Raw.surfaceFormat (Surface -> Ptr PixelFormat) -> IO Surface -> IO (Ptr PixelFormat)
    forall (f :: Type -> Type) a b. Functor f => (a -> b) -> f a -> f b
    <$> Ptr Surface -> IO Surface
    forall a. Storable a => Ptr a -> IO a
    peek Ptr Surface
    s)
            Ptr PixelFormat -> Word8 -> Word8 -> Word8 -> Word8 -> IO BlendMode
    forall (m :: Type -> Type).
    MonadIO m =>
    Ptr PixelFormat -> Word8 -> Word8 -> Word8 -> Word8 -> m BlendMode
    Raw.mapRGBA Ptr PixelFormat
    format Word8
    r Word8
    g Word8
    b Word8
    a IO BlendMode -> (BlendMode -> IO CInt) -> IO CInt
    forall a b. IO a -> (a -> IO b) -> IO b
    forall (m :: Type -> Type) a b. Monad m => m a -> (a -> m b) -> m b
    >>= Ptr Surface -> CInt -> BlendMode -> IO CInt
    forall (m :: Type -> Type).
    MonadIO m =>
    Ptr Surface -> CInt -> BlendMode -> m CInt
    Raw.setColorKey Ptr Surface
    s CInt
    1

    -- | 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 @<https://wiki.libsdl.org/SDL_SetTextureColorMod SDL_SetTextureColorMod>@ and @<https://wiki.libsdl.org/SDL_GetTextureColorMod SDL_GetTextureColorMod>@ for C documentation.
    textureColorMod :: Texture -> StateVar (V3 Word8)
    textureColorMod :: Texture -> StateVar (V3 Word8)
    textureColorMod (Texture Renderer
    t) = IO (V3 Word8) -> (V3 Word8 -> IO ()) -> StateVar (V3 Word8)
    forall a. IO a -> (a -> IO ()) -> StateVar a
    makeStateVar IO (V3 Word8)
    getTextureColorMod V3 Word8 -> IO ()
    forall {m :: Type -> Type}. MonadIO m => V3 Word8 -> m ()
    setTextureColorMod
      where
      getTextureColorMod :: IO (V3 Word8)
    getTextureColorMod = IO (V3 Word8) -> IO (V3 Word8)
    forall a. IO a -> IO a
    forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
    liftIO (IO (V3 Word8) -> IO (V3 Word8)) -> IO (V3 Word8) -> IO (V3 Word8)
    forall a b. (a -> b) -> a -> b
    $
        (Ptr Word8 -> IO (V3 Word8)) -> IO (V3 Word8)
    forall a b. Storable a => (Ptr a -> IO b) -> IO b
    alloca ((Ptr Word8 -> IO (V3 Word8)) -> IO (V3 Word8))
    -> (Ptr Word8 -> IO (V3 Word8)) -> IO (V3 Word8)
    forall a b. (a -> b) -> a -> b
    $ \Ptr Word8
    r ->
        (Ptr Word8 -> IO (V3 Word8)) -> IO (V3 Word8)
    forall a b. Storable a => (Ptr a -> IO b) -> IO b
    alloca ((Ptr Word8 -> IO (V3 Word8)) -> IO (V3 Word8))
    -> (Ptr Word8 -> IO (V3 Word8)) -> IO (V3 Word8)
    forall a b. (a -> b) -> a -> b
    $ \Ptr Word8
    g ->
        (Ptr Word8 -> IO (V3 Word8)) -> IO (V3 Word8)
    forall a b. Storable a => (Ptr a -> IO b) -> IO b
    alloca ((Ptr Word8 -> IO (V3 Word8)) -> IO (V3 Word8))
    -> (Ptr Word8 -> IO (V3 Word8)) -> IO (V3 Word8)
    forall a b. (a -> b) -> a -> b
    $ \Ptr Word8
    b -> do
          Text -> Text -> IO CInt -> IO ()
    forall (m :: Type -> Type) a.
    (MonadIO m, Num a, Ord a) =>
    Text -> Text -> m a -> m ()
    throwIfNeg_ Text
    "SDL.Video.Renderer.getTextureColorMod" Text
    "SDL_GetTextureColorMod" (IO CInt -> IO ()) -> IO CInt -> IO ()
    forall a b. (a -> b) -> a -> b
    $
            Renderer -> Ptr Word8 -> Ptr Word8 -> Ptr Word8 -> IO CInt
    forall (m :: Type -> Type).
    MonadIO m =>
    Renderer -> Ptr Word8 -> Ptr Word8 -> Ptr Word8 -> m CInt
    Raw.getTextureColorMod Renderer
    t Ptr Word8
    r Ptr Word8
    g Ptr Word8
    b
          Word8 -> Word8 -> Word8 -> V3 Word8
    forall a. a -> a -> a -> V3 a
    V3 (Word8 -> Word8 -> Word8 -> V3 Word8)
    -> IO Word8 -> IO (Word8 -> Word8 -> V3 Word8)
    forall (f :: Type -> Type) a b. Functor f => (a -> b) -> f a -> f b
    <$> Ptr Word8 -> IO Word8
    forall a. Storable a => Ptr a -> IO a
    peek Ptr Word8
    r IO (Word8 -> Word8 -> V3 Word8)
    -> IO Word8 -> IO (Word8 -> V3 Word8)
    forall a b. IO (a -> b) -> IO a -> IO b
    forall (f :: Type -> Type) a b.
    Applicative f =>
    f (a -> b) -> f a -> f b
    <*> Ptr Word8 -> IO Word8
    forall a. Storable a => Ptr a -> IO a
    peek Ptr Word8
    g IO (Word8 -> V3 Word8) -> IO Word8 -> IO (V3 Word8)
    forall a b. IO (a -> b) -> IO a -> IO b
    forall (f :: Type -> Type) a b.
    Applicative f =>
    f (a -> b) -> f a -> f b
    <*> Ptr Word8 -> IO Word8
    forall a. Storable a => Ptr a -> IO a
    peek Ptr Word8
    b

      setTextureColorMod :: V3 Word8 -> m ()
    setTextureColorMod (V3 Word8
    r Word8
    g Word8
    b) =
        Text -> Text -> m CInt -> m ()
    forall (m :: Type -> Type) a.
    (MonadIO m, Num a, Ord a) =>
    Text -> Text -> m a -> m ()
    throwIfNeg_ Text
    "SDL.Video.Renderer.setTextureColorMod" Text
    "SDL_SetTextureColorMod" (m CInt -> m ()) -> m CInt -> m ()
    forall a b. (a -> b) -> a -> b
    $
        Renderer -> Word8 -> Word8 -> Word8 -> m CInt
    forall (m :: Type -> Type).
    MonadIO m =>
    Renderer -> Word8 -> Word8 -> Word8 -> m CInt
    Raw.setTextureColorMod Renderer
    t Word8
    r Word8
    g Word8
    b

    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
      deriving (Typeable PixelFormat
    Typeable PixelFormat
    -> (forall (c :: Type -> Type).
        (forall d b. Data d => c (d -> b) -> d -> c b)
        -> (forall g. g -> c g) -> PixelFormat -> c PixelFormat)
    -> (forall (c :: Type -> Type).
        (forall b r. Data b => c (b -> r) -> c r)
        -> (forall r. r -> c r) -> Constr -> c PixelFormat)
    -> (PixelFormat -> Constr)
    -> (PixelFormat -> DataType)
    -> (forall (t :: Type -> Type) (c :: Type -> Type).
        Typeable t =>
        (forall d. Data d => c (t d)) -> Maybe (c PixelFormat))
    -> (forall (t :: Type -> Type -> Type) (c :: Type -> Type).
        Typeable t =>
        (forall d e. (Data d, Data e) => c (t d e))
        -> Maybe (c PixelFormat))
    -> ((forall b. Data b => b -> b) -> PixelFormat -> PixelFormat)
    -> (forall r r'.
        (r -> r' -> r)
        -> r -> (forall d. Data d => d -> r') -> PixelFormat -> r)
    -> (forall r r'.
        (r' -> r -> r)
        -> r -> (forall d. Data d => d -> r') -> PixelFormat -> r)
    -> (forall u. (forall d. Data d => d -> u) -> PixelFormat -> [u])
    -> (forall u.
        Int -> (forall d. Data d => d -> u) -> PixelFormat -> u)
    -> (forall (m :: Type -> Type).
        Monad m =>
        (forall d. Data d => d -> m d) -> PixelFormat -> m PixelFormat)
    -> (forall (m :: Type -> Type).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> PixelFormat -> m PixelFormat)
    -> (forall (m :: Type -> Type).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> PixelFormat -> m PixelFormat)
    -> Data PixelFormat
    PixelFormat -> Constr
    PixelFormat -> DataType
    (forall b. Data b => b -> b) -> PixelFormat -> PixelFormat
    forall a.
    Typeable a
    -> (forall (c :: Type -> Type).
        (forall d b. Data d => c (d -> b) -> d -> c b)
        -> (forall g. g -> c g) -> a -> c a)
    -> (forall (c :: Type -> Type).
        (forall b r. Data b => c (b -> r) -> c r)
        -> (forall r. r -> c r) -> Constr -> c a)
    -> (a -> Constr)
    -> (a -> DataType)
    -> (forall (t :: Type -> Type) (c :: Type -> Type).
        Typeable t =>
        (forall d. Data d => c (t d)) -> Maybe (c a))
    -> (forall (t :: Type -> Type -> Type) (c :: Type -> Type).
        Typeable t =>
        (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
    -> ((forall b. Data b => b -> b) -> a -> a)
    -> (forall r r'.
        (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
    -> (forall r r'.
        (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
    -> (forall u. (forall d. Data d => d -> u) -> a -> [u])
    -> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
    -> (forall (m :: Type -> Type).
        Monad m =>
        (forall d. Data d => d -> m d) -> a -> m a)
    -> (forall (m :: Type -> Type).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> a -> m a)
    -> (forall (m :: Type -> Type).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> a -> m a)
    -> Data a
    forall u. Int -> (forall d. Data d => d -> u) -> PixelFormat -> u
    forall u. (forall d. Data d => d -> u) -> PixelFormat -> [u]
    forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> PixelFormat -> r
    forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> PixelFormat -> r
    forall (m :: Type -> Type).
    Monad m =>
    (forall d. Data d => d -> m d) -> PixelFormat -> m PixelFormat
    forall (m :: Type -> Type).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> PixelFormat -> m PixelFormat
    forall (c :: Type -> Type).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c PixelFormat
    forall (c :: Type -> Type).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> PixelFormat -> c PixelFormat
    forall (t :: Type -> Type) (c :: Type -> Type).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c PixelFormat)
    forall (t :: Type -> Type -> Type) (c :: Type -> Type).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c PixelFormat)
    $cgfoldl :: forall (c :: Type -> Type).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> PixelFormat -> c PixelFormat
    gfoldl :: forall (c :: Type -> Type).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> PixelFormat -> c PixelFormat
    $cgunfold :: forall (c :: Type -> Type).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c PixelFormat
    gunfold :: forall (c :: Type -> Type).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c PixelFormat
    $ctoConstr :: PixelFormat -> Constr
    toConstr :: PixelFormat -> Constr
    $cdataTypeOf :: PixelFormat -> DataType
    dataTypeOf :: PixelFormat -> DataType
    $cdataCast1 :: forall (t :: Type -> Type) (c :: Type -> Type).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c PixelFormat)
    dataCast1 :: forall (t :: Type -> Type) (c :: Type -> Type).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c PixelFormat)
    $cdataCast2 :: forall (t :: Type -> Type -> Type) (c :: Type -> Type).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c PixelFormat)
    dataCast2 :: forall (t :: Type -> Type -> Type) (c :: Type -> Type).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c PixelFormat)
    $cgmapT :: (forall b. Data b => b -> b) -> PixelFormat -> PixelFormat
    gmapT :: (forall b. Data b => b -> b) -> PixelFormat -> PixelFormat
    $cgmapQl :: forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> PixelFormat -> r
    gmapQl :: forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> PixelFormat -> r
    $cgmapQr :: forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> PixelFormat -> r
    gmapQr :: forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> PixelFormat -> r
    $cgmapQ :: forall u. (forall d. Data d => d -> u) -> PixelFormat -> [u]
    gmapQ :: forall u. (forall d. Data d => d -> u) -> PixelFormat -> [u]
    $cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> PixelFormat -> u
    gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> PixelFormat -> u
    $cgmapM :: forall (m :: Type -> Type).
    Monad m =>
    (forall d. Data d => d -> m d) -> PixelFormat -> m PixelFormat
    gmapM :: forall (m :: Type -> Type).
    Monad m =>
    (forall d. Data d => d -> m d) -> PixelFormat -> m PixelFormat
    $cgmapMp :: forall (m :: Type -> Type).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> PixelFormat -> m PixelFormat
    gmapMp :: forall (m :: Type -> Type).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> PixelFormat -> m PixelFormat
    $cgmapMo :: forall (m :: Type -> Type).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> PixelFormat -> m PixelFormat
    gmapMo :: forall (m :: Type -> Type).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> PixelFormat -> m PixelFormat
    Data, PixelFormat -> PixelFormat -> Bool
    (PixelFormat -> PixelFormat -> Bool)
    -> (PixelFormat -> PixelFormat -> Bool) -> Eq PixelFormat
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: PixelFormat -> PixelFormat -> Bool
    == :: PixelFormat -> PixelFormat -> Bool
    $c/= :: PixelFormat -> PixelFormat -> Bool
    /= :: PixelFormat -> PixelFormat -> Bool
    Eq, (forall x. PixelFormat -> Rep PixelFormat x)
    -> (forall x. Rep PixelFormat x -> PixelFormat)
    -> Generic PixelFormat
    forall x. Rep PixelFormat x -> PixelFormat
    forall x. PixelFormat -> Rep PixelFormat x
    forall a.
    (forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
    $cfrom :: forall x. PixelFormat -> Rep PixelFormat x
    from :: forall x. PixelFormat -> Rep PixelFormat x
    $cto :: forall x. Rep PixelFormat x -> PixelFormat
    to :: forall x. Rep PixelFormat x -> PixelFormat
    Generic, Eq PixelFormat
    Eq PixelFormat
    -> (PixelFormat -> PixelFormat -> Ordering)
    -> (PixelFormat -> PixelFormat -> Bool)
    -> (PixelFormat -> PixelFormat -> Bool)
    -> (PixelFormat -> PixelFormat -> Bool)
    -> (PixelFormat -> PixelFormat -> Bool)
    -> (PixelFormat -> PixelFormat -> PixelFormat)
    -> (PixelFormat -> PixelFormat -> PixelFormat)
    -> Ord PixelFormat
    PixelFormat -> PixelFormat -> Bool
    PixelFormat -> PixelFormat -> Ordering
    PixelFormat -> PixelFormat -> PixelFormat
    forall a.
    Eq a
    -> (a -> a -> Ordering)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> a)
    -> (a -> a -> a)
    -> Ord a
    $ccompare :: PixelFormat -> PixelFormat -> Ordering
    compare :: PixelFormat -> PixelFormat -> Ordering
    $c< :: PixelFormat -> PixelFormat -> Bool
    < :: PixelFormat -> PixelFormat -> Bool
    $c<= :: PixelFormat -> PixelFormat -> Bool
    <= :: PixelFormat -> PixelFormat -> Bool
    $c> :: PixelFormat -> PixelFormat -> Bool
    > :: PixelFormat -> PixelFormat -> Bool
    $c>= :: PixelFormat -> PixelFormat -> Bool
    >= :: PixelFormat -> PixelFormat -> Bool
    $cmax :: PixelFormat -> PixelFormat -> PixelFormat
    max :: PixelFormat -> PixelFormat -> PixelFormat
    $cmin :: PixelFormat -> PixelFormat -> PixelFormat
    min :: PixelFormat -> PixelFormat -> PixelFormat
    Ord, ReadPrec [PixelFormat]
    ReadPrec PixelFormat
    Int -> ReadS PixelFormat
    ReadS [PixelFormat]
    (Int -> ReadS PixelFormat)
    -> ReadS [PixelFormat]
    -> ReadPrec PixelFormat
    -> ReadPrec [PixelFormat]
    -> Read PixelFormat
    forall a.
    (Int -> ReadS a)
    -> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
    $creadsPrec :: Int -> ReadS PixelFormat
    readsPrec :: Int -> ReadS PixelFormat
    $creadList :: ReadS [PixelFormat]
    readList :: ReadS [PixelFormat]
    $creadPrec :: ReadPrec PixelFormat
    readPrec :: ReadPrec PixelFormat
    $creadListPrec :: ReadPrec [PixelFormat]
    readListPrec :: ReadPrec [PixelFormat]
    Read, Int -> PixelFormat -> ShowS
    [PixelFormat] -> ShowS
    PixelFormat -> [Char]
    (Int -> PixelFormat -> ShowS)
    -> (PixelFormat -> [Char])
    -> ([PixelFormat] -> ShowS)
    -> Show PixelFormat
    forall a.
    (Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> PixelFormat -> ShowS
    showsPrec :: Int -> PixelFormat -> ShowS
    $cshow :: PixelFormat -> [Char]
    show :: PixelFormat -> [Char]
    $cshowList :: [PixelFormat] -> ShowS
    showList :: [PixelFormat] -> ShowS
    Show, Typeable)

    instance FromNumber PixelFormat Word32 where
      fromNumber :: BlendMode -> PixelFormat
    fromNumber BlendMode
    n' = case BlendMode
    n' of
        BlendMode
    Raw.SDL_PIXELFORMAT_INDEX1LSB -> PixelFormat
    Index1LSB
        BlendMode
    Raw.SDL_PIXELFORMAT_INDEX1MSB -> PixelFormat
    Index1MSB
        BlendMode
    Raw.SDL_PIXELFORMAT_INDEX4LSB -> PixelFormat
    Index4LSB
        BlendMode
    Raw.SDL_PIXELFORMAT_INDEX4MSB -> PixelFormat
    Index4MSB
        BlendMode
    Raw.SDL_PIXELFORMAT_INDEX8 -> PixelFormat
    Index8
        BlendMode
    Raw.SDL_PIXELFORMAT_RGB332 -> PixelFormat
    RGB332
        BlendMode
    Raw.SDL_PIXELFORMAT_RGB444 -> PixelFormat
    RGB444
        BlendMode
    Raw.SDL_PIXELFORMAT_RGB555 -> PixelFormat
    RGB555
        BlendMode
    Raw.SDL_PIXELFORMAT_BGR555 -> PixelFormat
    BGR555
        BlendMode
    Raw.SDL_PIXELFORMAT_ARGB4444 -> PixelFormat
    ARGB4444
        BlendMode
    Raw.SDL_PIXELFORMAT_RGBA4444 -> PixelFormat
    RGBA4444
        BlendMode
    Raw.SDL_PIXELFORMAT_ABGR4444 -> PixelFormat
    ABGR4444
        BlendMode
    Raw.SDL_PIXELFORMAT_BGRA4444 -> PixelFormat
    BGRA4444
        BlendMode
    Raw.SDL_PIXELFORMAT_ARGB1555 -> PixelFormat
    ARGB1555
        BlendMode
    Raw.SDL_PIXELFORMAT_RGBA5551 -> PixelFormat
    RGBA5551
        BlendMode
    Raw.SDL_PIXELFORMAT_ABGR1555 -> PixelFormat
    ABGR1555
        BlendMode
    Raw.SDL_PIXELFORMAT_BGRA5551 -> PixelFormat
    BGRA5551
        BlendMode
    Raw.SDL_PIXELFORMAT_RGB565 -> PixelFormat
    RGB565
        BlendMode
    Raw.SDL_PIXELFORMAT_BGR565 -> PixelFormat
    BGR565
        BlendMode
    Raw.SDL_PIXELFORMAT_RGB24 -> PixelFormat
    RGB24
        BlendMode
    Raw.SDL_PIXELFORMAT_BGR24 -> PixelFormat
    BGR24
        BlendMode
    Raw.SDL_PIXELFORMAT_RGB888 -> PixelFormat
    RGB888
        BlendMode
    Raw.SDL_PIXELFORMAT_RGBX8888 -> PixelFormat
    RGBX8888
        BlendMode
    Raw.SDL_PIXELFORMAT_BGR888 -> PixelFormat
    BGR888
        BlendMode
    Raw.SDL_PIXELFORMAT_BGRX8888 -> PixelFormat
    BGRX8888
        BlendMode
    Raw.SDL_PIXELFORMAT_ARGB8888 -> PixelFormat
    ARGB8888
        BlendMode
    Raw.SDL_PIXELFORMAT_RGBA8888 -> PixelFormat
    RGBA8888
        BlendMode
    Raw.SDL_PIXELFORMAT_ABGR8888 -> PixelFormat
    ABGR8888
        BlendMode
    Raw.SDL_PIXELFORMAT_BGRA8888 -> PixelFormat
    BGRA8888
        BlendMode
    Raw.SDL_PIXELFORMAT_ARGB2101010 -> PixelFormat
    ARGB2101010
        BlendMode
    Raw.SDL_PIXELFORMAT_YV12 -> PixelFormat
    YV12
        BlendMode
    Raw.SDL_PIXELFORMAT_IYUV -> PixelFormat
    IYUV
        BlendMode
    Raw.SDL_PIXELFORMAT_YUY2 -> PixelFormat
    YUY2
        BlendMode
    Raw.SDL_PIXELFORMAT_UYVY -> PixelFormat
    UYVY
        BlendMode
    Raw.SDL_PIXELFORMAT_YVYU -> PixelFormat
    YVYU
        BlendMode
    Raw.SDL_PIXELFORMAT_UNKNOWN -> BlendMode -> PixelFormat
    Unknown BlendMode
    n'
        BlendMode
    _ -> BlendMode -> PixelFormat
    Unknown BlendMode
    n'

    instance ToNumber PixelFormat Word32 where
      toNumber :: PixelFormat -> BlendMode
    toNumber PixelFormat
    pf = case PixelFormat
    pf of
        Unknown BlendMode
    _ -> BlendMode
    forall {a}. (Eq a, Num a) => a
    Raw.SDL_PIXELFORMAT_UNKNOWN
        PixelFormat
    Index1LSB -> BlendMode
    forall {a}. (Eq a, Num a) => a
    Raw.SDL_PIXELFORMAT_INDEX1LSB
        PixelFormat
    Index1MSB -> BlendMode
    forall {a}. (Eq a, Num a) => a
    Raw.SDL_PIXELFORMAT_INDEX1MSB
        PixelFormat
    Index4LSB -> BlendMode
    forall {a}. (Eq a, Num a) => a
    Raw.SDL_PIXELFORMAT_INDEX4LSB
        PixelFormat
    Index4MSB -> BlendMode
    forall {a}. (Eq a, Num a) => a
    Raw.SDL_PIXELFORMAT_INDEX4MSB
        PixelFormat
    Index8 -> BlendMode
    forall {a}. (Eq a, Num a) => a
    Raw.SDL_PIXELFORMAT_INDEX8
        PixelFormat
    RGB332 -> BlendMode
    forall {a}. (Eq a, Num a) => a
    Raw.SDL_PIXELFORMAT_RGB332
        PixelFormat
    RGB444 -> BlendMode
    forall {a}. (Eq a, Num a) => a
    Raw.SDL_PIXELFORMAT_RGB444
        PixelFormat
    RGB555 -> BlendMode
    forall {a}. (Eq a, Num a) => a
    Raw.SDL_PIXELFORMAT_RGB555
        PixelFormat
    BGR555 -> BlendMode
    forall {a}. (Eq a, Num a) => a
    Raw.SDL_PIXELFORMAT_BGR555
        PixelFormat
    ARGB4444 -> BlendMode
    forall {a}. (Eq a, Num a) => a
    Raw.SDL_PIXELFORMAT_ARGB4444
        PixelFormat
    RGBA4444 -> BlendMode
    forall {a}. (Eq a, Num a) => a
    Raw.SDL_PIXELFORMAT_RGBA4444
        PixelFormat
    ABGR4444 -> BlendMode
    forall {a}. (Eq a, Num a) => a
    Raw.SDL_PIXELFORMAT_ABGR4444
        PixelFormat
    BGRA4444 -> BlendMode
    forall {a}. (Eq a, Num a) => a
    Raw.SDL_PIXELFORMAT_BGRA4444
        PixelFormat
    ARGB1555 -> BlendMode
    forall {a}. (Eq a, Num a) => a
    Raw.SDL_PIXELFORMAT_ARGB1555
        PixelFormat
    RGBA5551 -> BlendMode
    forall {a}. (Eq a, Num a) => a
    Raw.SDL_PIXELFORMAT_RGBA5551
        PixelFormat
    ABGR1555 -> BlendMode
    forall {a}. (Eq a, Num a) => a
    Raw.SDL_PIXELFORMAT_ABGR1555
        PixelFormat
    BGRA5551 -> BlendMode
    forall {a}. (Eq a, Num a) => a
    Raw.SDL_PIXELFORMAT_BGRA5551
        PixelFormat
    RGB565 -> BlendMode
    forall {a}. (Eq a, Num a) => a
    Raw.SDL_PIXELFORMAT_RGB565
        PixelFormat
    BGR565 -> BlendMode
    forall {a}. (Eq a, Num a) => a
    Raw.SDL_PIXELFORMAT_BGR565
        PixelFormat
    RGB24 -> BlendMode
    forall {a}. (Eq a, Num a) => a
    Raw.SDL_PIXELFORMAT_RGB24
        PixelFormat
    BGR24 -> BlendMode
    forall {a}. (Eq a, Num a) => a
    Raw.SDL_PIXELFORMAT_BGR24
        PixelFormat
    RGB888 -> BlendMode
    forall {a}. (Eq a, Num a) => a
    Raw.SDL_PIXELFORMAT_RGB888
        PixelFormat
    RGBX8888 -> BlendMode
    forall {a}. (Eq a, Num a) => a
    Raw.SDL_PIXELFORMAT_RGBX8888
        PixelFormat
    BGR888 -> BlendMode
    forall {a}. (Eq a, Num a) => a
    Raw.SDL_PIXELFORMAT_BGR888
        PixelFormat
    BGRX8888 -> BlendMode
    forall {a}. (Eq a, Num a) => a
    Raw.SDL_PIXELFORMAT_BGRX8888
        PixelFormat
    ARGB8888 -> BlendMode
    forall {a}. (Eq a, Num a) => a
    Raw.SDL_PIXELFORMAT_ARGB8888
        PixelFormat
    RGBA8888 -> BlendMode
    forall {a}. (Eq a, Num a) => a
    Raw.SDL_PIXELFORMAT_RGBA8888
        PixelFormat
    ABGR8888 -> BlendMode
    forall {a}. (Eq a, Num a) => a
    Raw.SDL_PIXELFORMAT_ABGR8888
        PixelFormat
    BGRA8888 -> BlendMode
    forall {a}. (Eq a, Num a) => a
    Raw.SDL_PIXELFORMAT_BGRA8888
        PixelFormat
    ARGB2101010 -> BlendMode
    forall {a}. (Eq a, Num a) => a
    Raw.SDL_PIXELFORMAT_ARGB2101010
        PixelFormat
    YV12 -> BlendMode
    forall {a}. (Eq a, Num a) => a
    Raw.SDL_PIXELFORMAT_YV12
        PixelFormat
    IYUV -> BlendMode
    forall {a}. (Eq a, Num a) => a
    Raw.SDL_PIXELFORMAT_IYUV
        PixelFormat
    YUY2 -> BlendMode
    forall {a}. (Eq a, Num a) => a
    Raw.SDL_PIXELFORMAT_YUY2
        PixelFormat
    UYVY -> BlendMode
    forall {a}. (Eq a, Num a) => a
    Raw.SDL_PIXELFORMAT_UYVY
        PixelFormat
    YVYU -> BlendMode
    forall {a}. (Eq a, Num a) => a
    Raw.SDL_PIXELFORMAT_YVYU

    -- | Renderer acceleration mode
    data RendererType
      = 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
      deriving (RendererType
    RendererType -> RendererType -> Bounded RendererType
    forall a. a -> a -> Bounded a
    $cminBound :: RendererType
    minBound :: RendererType
    $cmaxBound :: RendererType
    maxBound :: RendererType
    Bounded, Typeable RendererType
    Typeable RendererType
    -> (forall (c :: Type -> Type).
        (forall d b. Data d => c (d -> b) -> d -> c b)
        -> (forall g. g -> c g) -> RendererType -> c RendererType)
    -> (forall (c :: Type -> Type).
        (forall b r. Data b => c (b -> r) -> c r)
        -> (forall r. r -> c r) -> Constr -> c RendererType)
    -> (RendererType -> Constr)
    -> (RendererType -> DataType)
    -> (forall (t :: Type -> Type) (c :: Type -> Type).
        Typeable t =>
        (forall d. Data d => c (t d)) -> Maybe (c RendererType))
    -> (forall (t :: Type -> Type -> Type) (c :: Type -> Type).
        Typeable t =>
        (forall d e. (Data d, Data e) => c (t d e))
        -> Maybe (c RendererType))
    -> ((forall b. Data b => b -> b) -> RendererType -> RendererType)
    -> (forall r r'.
        (r -> r' -> r)
        -> r -> (forall d. Data d => d -> r') -> RendererType -> r)
    -> (forall r r'.
        (r' -> r -> r)
        -> r -> (forall d. Data d => d -> r') -> RendererType -> r)
    -> (forall u. (forall d. Data d => d -> u) -> RendererType -> [u])
    -> (forall u.
        Int -> (forall d. Data d => d -> u) -> RendererType -> u)
    -> (forall (m :: Type -> Type).
        Monad m =>
        (forall d. Data d => d -> m d) -> RendererType -> m RendererType)
    -> (forall (m :: Type -> Type).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> RendererType -> m RendererType)
    -> (forall (m :: Type -> Type).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> RendererType -> m RendererType)
    -> Data RendererType
    RendererType -> Constr
    RendererType -> DataType
    (forall b. Data b => b -> b) -> RendererType -> RendererType
    forall a.
    Typeable a
    -> (forall (c :: Type -> Type).
        (forall d b. Data d => c (d -> b) -> d -> c b)
        -> (forall g. g -> c g) -> a -> c a)
    -> (forall (c :: Type -> Type).
        (forall b r. Data b => c (b -> r) -> c r)
        -> (forall r. r -> c r) -> Constr -> c a)
    -> (a -> Constr)
    -> (a -> DataType)
    -> (forall (t :: Type -> Type) (c :: Type -> Type).
        Typeable t =>
        (forall d. Data d => c (t d)) -> Maybe (c a))
    -> (forall (t :: Type -> Type -> Type) (c :: Type -> Type).
        Typeable t =>
        (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
    -> ((forall b. Data b => b -> b) -> a -> a)
    -> (forall r r'.
        (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
    -> (forall r r'.
        (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
    -> (forall u. (forall d. Data d => d -> u) -> a -> [u])
    -> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
    -> (forall (m :: Type -> Type).
        Monad m =>
        (forall d. Data d => d -> m d) -> a -> m a)
    -> (forall (m :: Type -> Type).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> a -> m a)
    -> (forall (m :: Type -> Type).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> a -> m a)
    -> Data a
    forall u. Int -> (forall d. Data d => d -> u) -> RendererType -> u
    forall u. (forall d. Data d => d -> u) -> RendererType -> [u]
    forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> RendererType -> r
    forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> RendererType -> r
    forall (m :: Type -> Type).
    Monad m =>
    (forall d. Data d => d -> m d) -> RendererType -> m RendererType
    forall (m :: Type -> Type).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> RendererType -> m RendererType
    forall (c :: Type -> Type).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c RendererType
    forall (c :: Type -> Type).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> RendererType -> c RendererType
    forall (t :: Type -> Type) (c :: Type -> Type).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c RendererType)
    forall (t :: Type -> Type -> Type) (c :: Type -> Type).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c RendererType)
    $cgfoldl :: forall (c :: Type -> Type).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> RendererType -> c RendererType
    gfoldl :: forall (c :: Type -> Type).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> RendererType -> c RendererType
    $cgunfold :: forall (c :: Type -> Type).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c RendererType
    gunfold :: forall (c :: Type -> Type).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c RendererType
    $ctoConstr :: RendererType -> Constr
    toConstr :: RendererType -> Constr
    $cdataTypeOf :: RendererType -> DataType
    dataTypeOf :: RendererType -> DataType
    $cdataCast1 :: forall (t :: Type -> Type) (c :: Type -> Type).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c RendererType)
    dataCast1 :: forall (t :: Type -> Type) (c :: Type -> Type).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c RendererType)
    $cdataCast2 :: forall (t :: Type -> Type -> Type) (c :: Type -> Type).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c RendererType)
    dataCast2 :: forall (t :: Type -> Type -> Type) (c :: Type -> Type).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c RendererType)
    $cgmapT :: (forall b. Data b => b -> b) -> RendererType -> RendererType
    gmapT :: (forall b. Data b => b -> b) -> RendererType -> RendererType
    $cgmapQl :: forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> RendererType -> r
    gmapQl :: forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> RendererType -> r
    $cgmapQr :: forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> RendererType -> r
    gmapQr :: forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> RendererType -> r
    $cgmapQ :: forall u. (forall d. Data d => d -> u) -> RendererType -> [u]
    gmapQ :: forall u. (forall d. Data d => d -> u) -> RendererType -> [u]
    $cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> RendererType -> u
    gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> RendererType -> u
    $cgmapM :: forall (m :: Type -> Type).
    Monad m =>
    (forall d. Data d => d -> m d) -> RendererType -> m RendererType
    gmapM :: forall (m :: Type -> Type).
    Monad m =>
    (forall d. Data d => d -> m d) -> RendererType -> m RendererType
    $cgmapMp :: forall (m :: Type -> Type).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> RendererType -> m RendererType
    gmapMp :: forall (m :: Type -> Type).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> RendererType -> m RendererType
    $cgmapMo :: forall (m :: Type -> Type).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> RendererType -> m RendererType
    gmapMo :: forall (m :: Type -> Type).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> RendererType -> m RendererType
    Data, Int -> RendererType
    RendererType -> Int
    RendererType -> [RendererType]
    RendererType -> RendererType
    RendererType -> RendererType -> [RendererType]
    RendererType -> RendererType -> RendererType -> [RendererType]
    (RendererType -> RendererType)
    -> (RendererType -> RendererType)
    -> (Int -> RendererType)
    -> (RendererType -> Int)
    -> (RendererType -> [RendererType])
    -> (RendererType -> RendererType -> [RendererType])
    -> (RendererType -> RendererType -> [RendererType])
    -> (RendererType -> RendererType -> RendererType -> [RendererType])
    -> Enum RendererType
    forall a.
    (a -> a)
    -> (a -> a)
    -> (Int -> a)
    -> (a -> Int)
    -> (a -> [a])
    -> (a -> a -> [a])
    -> (a -> a -> [a])
    -> (a -> a -> a -> [a])
    -> Enum a
    $csucc :: RendererType -> RendererType
    succ :: RendererType -> RendererType
    $cpred :: RendererType -> RendererType
    pred :: RendererType -> RendererType
    $ctoEnum :: Int -> RendererType
    toEnum :: Int -> RendererType
    $cfromEnum :: RendererType -> Int
    fromEnum :: RendererType -> Int
    $cenumFrom :: RendererType -> [RendererType]
    enumFrom :: RendererType -> [RendererType]
    $cenumFromThen :: RendererType -> RendererType -> [RendererType]
    enumFromThen :: RendererType -> RendererType -> [RendererType]
    $cenumFromTo :: RendererType -> RendererType -> [RendererType]
    enumFromTo :: RendererType -> RendererType -> [RendererType]
    $cenumFromThenTo :: RendererType -> RendererType -> RendererType -> [RendererType]
    enumFromThenTo :: RendererType -> RendererType -> RendererType -> [RendererType]
    Enum, RendererType -> RendererType -> Bool
    (RendererType -> RendererType -> Bool)
    -> (RendererType -> RendererType -> Bool) -> Eq RendererType
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: RendererType -> RendererType -> Bool
    == :: RendererType -> RendererType -> Bool
    $c/= :: RendererType -> RendererType -> Bool
    /= :: RendererType -> RendererType -> Bool
    Eq, (forall x. RendererType -> Rep RendererType x)
    -> (forall x. Rep RendererType x -> RendererType)
    -> Generic RendererType
    forall x. Rep RendererType x -> RendererType
    forall x. RendererType -> Rep RendererType x
    forall a.
    (forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
    $cfrom :: forall x. RendererType -> Rep RendererType x
    from :: forall x. RendererType -> Rep RendererType x
    $cto :: forall x. Rep RendererType x -> RendererType
    to :: forall x. Rep RendererType x -> RendererType
    Generic, Eq RendererType
    Eq RendererType
    -> (RendererType -> RendererType -> Ordering)
    -> (RendererType -> RendererType -> Bool)
    -> (RendererType -> RendererType -> Bool)
    -> (RendererType -> RendererType -> Bool)
    -> (RendererType -> RendererType -> Bool)
    -> (RendererType -> RendererType -> RendererType)
    -> (RendererType -> RendererType -> RendererType)
    -> Ord RendererType
    RendererType -> RendererType -> Bool
    RendererType -> RendererType -> Ordering
    RendererType -> RendererType -> RendererType
    forall a.
    Eq a
    -> (a -> a -> Ordering)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> a)
    -> (a -> a -> a)
    -> Ord a
    $ccompare :: RendererType -> RendererType -> Ordering
    compare :: RendererType -> RendererType -> Ordering
    $c< :: RendererType -> RendererType -> Bool
    < :: RendererType -> RendererType -> Bool
    $c<= :: RendererType -> RendererType -> Bool
    <= :: RendererType -> RendererType -> Bool
    $c> :: RendererType -> RendererType -> Bool
    > :: RendererType -> RendererType -> Bool
    $c>= :: RendererType -> RendererType -> Bool
    >= :: RendererType -> RendererType -> Bool
    $cmax :: RendererType -> RendererType -> RendererType
    max :: RendererType -> RendererType -> RendererType
    $cmin :: RendererType -> RendererType -> RendererType
    min :: RendererType -> RendererType -> RendererType
    Ord, ReadPrec [RendererType]
    ReadPrec RendererType
    Int -> ReadS RendererType
    ReadS [RendererType]
    (Int -> ReadS RendererType)
    -> ReadS [RendererType]
    -> ReadPrec RendererType
    -> ReadPrec [RendererType]
    -> Read RendererType
    forall a.
    (Int -> ReadS a)
    -> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
    $creadsPrec :: Int -> ReadS RendererType
    readsPrec :: Int -> ReadS RendererType
    $creadList :: ReadS [RendererType]
    readList :: ReadS [RendererType]
    $creadPrec :: ReadPrec RendererType
    readPrec :: ReadPrec RendererType
    $creadListPrec :: ReadPrec [RendererType]
    readListPrec :: ReadPrec [RendererType]
    Read, Int -> RendererType -> ShowS
    [RendererType] -> ShowS
    RendererType -> [Char]
    (Int -> RendererType -> ShowS)
    -> (RendererType -> [Char])
    -> ([RendererType] -> ShowS)
    -> Show RendererType
    forall a.
    (Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> RendererType -> ShowS
    showsPrec :: Int -> RendererType -> ShowS
    $cshow :: RendererType -> [Char]
    show :: RendererType -> [Char]
    $cshowList :: [RendererType] -> ShowS
    showList :: [RendererType] -> ShowS
    Show, Typeable)

    -- | The configuration data used when creating windows.
    data RendererConfig = RendererConfig
      { RendererConfig -> RendererType
    rendererType  :: RendererType
        -- ^ The renderer's acceleration mode
      , RendererConfig -> Bool
    rendererTargetTexture :: Bool
        -- ^ The renderer supports rendering to texture
      } deriving (Typeable RendererConfig
    Typeable RendererConfig
    -> (forall (c :: Type -> Type).
        (forall d b. Data d => c (d -> b) -> d -> c b)
        -> (forall g. g -> c g) -> RendererConfig -> c RendererConfig)
    -> (forall (c :: Type -> Type).
        (forall b r. Data b => c (b -> r) -> c r)
        -> (forall r. r -> c r) -> Constr -> c RendererConfig)
    -> (RendererConfig -> Constr)
    -> (RendererConfig -> DataType)
    -> (forall (t :: Type -> Type) (c :: Type -> Type).
        Typeable t =>
        (forall d. Data d => c (t d)) -> Maybe (c RendererConfig))
    -> (forall (t :: Type -> Type -> Type) (c :: Type -> Type).
        Typeable t =>
        (forall d e. (Data d, Data e) => c (t d e))
        -> Maybe (c RendererConfig))
    -> ((forall b. Data b => b -> b)
        -> RendererConfig -> RendererConfig)
    -> (forall r r'.
        (r -> r' -> r)
        -> r -> (forall d. Data d => d -> r') -> RendererConfig -> r)
    -> (forall r r'.
        (r' -> r -> r)
        -> r -> (forall d. Data d => d -> r') -> RendererConfig -> r)
    -> (forall u.
        (forall d. Data d => d -> u) -> RendererConfig -> [u])
    -> (forall u.
        Int -> (forall d. Data d => d -> u) -> RendererConfig -> u)
    -> (forall (m :: Type -> Type).
        Monad m =>
        (forall d. Data d => d -> m d)
        -> RendererConfig -> m RendererConfig)
    -> (forall (m :: Type -> Type).
        MonadPlus m =>
        (forall d. Data d => d -> m d)
        -> RendererConfig -> m RendererConfig)
    -> (forall (m :: Type -> Type).
        MonadPlus m =>
        (forall d. Data d => d -> m d)
        -> RendererConfig -> m RendererConfig)
    -> Data RendererConfig
    RendererConfig -> Constr
    RendererConfig -> DataType
    (forall b. Data b => b -> b) -> RendererConfig -> RendererConfig
    forall a.
    Typeable a
    -> (forall (c :: Type -> Type).
        (forall d b. Data d => c (d -> b) -> d -> c b)
        -> (forall g. g -> c g) -> a -> c a)
    -> (forall (c :: Type -> Type).
        (forall b r. Data b => c (b -> r) -> c r)
        -> (forall r. r -> c r) -> Constr -> c a)
    -> (a -> Constr)
    -> (a -> DataType)
    -> (forall (t :: Type -> Type) (c :: Type -> Type).
        Typeable t =>
        (forall d. Data d => c (t d)) -> Maybe (c a))
    -> (forall (t :: Type -> Type -> Type) (c :: Type -> Type).
        Typeable t =>
        (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
    -> ((forall b. Data b => b -> b) -> a -> a)
    -> (forall r r'.
        (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
    -> (forall r r'.
        (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
    -> (forall u. (forall d. Data d => d -> u) -> a -> [u])
    -> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
    -> (forall (m :: Type -> Type).
        Monad m =>
        (forall d. Data d => d -> m d) -> a -> m a)
    -> (forall (m :: Type -> Type).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> a -> m a)
    -> (forall (m :: Type -> Type).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> a -> m a)
    -> Data a
    forall u.
    Int -> (forall d. Data d => d -> u) -> RendererConfig -> u
    forall u. (forall d. Data d => d -> u) -> RendererConfig -> [u]
    forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> RendererConfig -> r
    forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> RendererConfig -> r
    forall (m :: Type -> Type).
    Monad m =>
    (forall d. Data d => d -> m d)
    -> RendererConfig -> m RendererConfig
    forall (m :: Type -> Type).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> RendererConfig -> m RendererConfig
    forall (c :: Type -> Type).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c RendererConfig
    forall (c :: Type -> Type).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> RendererConfig -> c RendererConfig
    forall (t :: Type -> Type) (c :: Type -> Type).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c RendererConfig)
    forall (t :: Type -> Type -> Type) (c :: Type -> Type).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c RendererConfig)
    $cgfoldl :: forall (c :: Type -> Type).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> RendererConfig -> c RendererConfig
    gfoldl :: forall (c :: Type -> Type).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> RendererConfig -> c RendererConfig
    $cgunfold :: forall (c :: Type -> Type).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c RendererConfig
    gunfold :: forall (c :: Type -> Type).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c RendererConfig
    $ctoConstr :: RendererConfig -> Constr
    toConstr :: RendererConfig -> Constr
    $cdataTypeOf :: RendererConfig -> DataType
    dataTypeOf :: RendererConfig -> DataType
    $cdataCast1 :: forall (t :: Type -> Type) (c :: Type -> Type).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c RendererConfig)
    dataCast1 :: forall (t :: Type -> Type) (c :: Type -> Type).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c RendererConfig)
    $cdataCast2 :: forall (t :: Type -> Type -> Type) (c :: Type -> Type).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c RendererConfig)
    dataCast2 :: forall (t :: Type -> Type -> Type) (c :: Type -> Type).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c RendererConfig)
    $cgmapT :: (forall b. Data b => b -> b) -> RendererConfig -> RendererConfig
    gmapT :: (forall b. Data b => b -> b) -> RendererConfig -> RendererConfig
    $cgmapQl :: forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> RendererConfig -> r
    gmapQl :: forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> RendererConfig -> r
    $cgmapQr :: forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> RendererConfig -> r
    gmapQr :: forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> RendererConfig -> r
    $cgmapQ :: forall u. (forall d. Data d => d -> u) -> RendererConfig -> [u]
    gmapQ :: forall u. (forall d. Data d => d -> u) -> RendererConfig -> [u]
    $cgmapQi :: forall u.
    Int -> (forall d. Data d => d -> u) -> RendererConfig -> u
    gmapQi :: forall u.
    Int -> (forall d. Data d => d -> u) -> RendererConfig -> u
    $cgmapM :: forall (m :: Type -> Type).
    Monad m =>
    (forall d. Data d => d -> m d)
    -> RendererConfig -> m RendererConfig
    gmapM :: forall (m :: Type -> Type).
    Monad m =>
    (forall d. Data d => d -> m d)
    -> RendererConfig -> m RendererConfig
    $cgmapMp :: forall (m :: Type -> Type).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> RendererConfig -> m RendererConfig
    gmapMp :: forall (m :: Type -> Type).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> RendererConfig -> m RendererConfig
    $cgmapMo :: forall (m :: Type -> Type).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> RendererConfig -> m RendererConfig
    gmapMo :: forall (m :: Type -> Type).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> RendererConfig -> m RendererConfig
    Data, RendererConfig -> RendererConfig -> Bool
    (RendererConfig -> RendererConfig -> Bool)
    -> (RendererConfig -> RendererConfig -> Bool) -> Eq RendererConfig
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: RendererConfig -> RendererConfig -> Bool
    == :: RendererConfig -> RendererConfig -> Bool
    $c/= :: RendererConfig -> RendererConfig -> Bool
    /= :: RendererConfig -> RendererConfig -> Bool
    Eq, (forall x. RendererConfig -> Rep RendererConfig x)
    -> (forall x. Rep RendererConfig x -> RendererConfig)
    -> Generic RendererConfig
    forall x. Rep RendererConfig x -> RendererConfig
    forall x. RendererConfig -> Rep RendererConfig x
    forall a.
    (forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
    $cfrom :: forall x. RendererConfig -> Rep RendererConfig x
    from :: forall x. RendererConfig -> Rep RendererConfig x
    $cto :: forall x. Rep RendererConfig x -> RendererConfig
    to :: forall x. Rep RendererConfig x -> RendererConfig
    Generic, Eq RendererConfig
    Eq RendererConfig
    -> (RendererConfig -> RendererConfig -> Ordering)
    -> (RendererConfig -> RendererConfig -> Bool)
    -> (RendererConfig -> RendererConfig -> Bool)
    -> (RendererConfig -> RendererConfig -> Bool)
    -> (RendererConfig -> RendererConfig -> Bool)
    -> (RendererConfig -> RendererConfig -> RendererConfig)
    -> (RendererConfig -> RendererConfig -> RendererConfig)
    -> Ord RendererConfig
    RendererConfig -> RendererConfig -> Bool
    RendererConfig -> RendererConfig -> Ordering
    RendererConfig -> RendererConfig -> RendererConfig
    forall a.
    Eq a
    -> (a -> a -> Ordering)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> a)
    -> (a -> a -> a)
    -> Ord a
    $ccompare :: RendererConfig -> RendererConfig -> Ordering
    compare :: RendererConfig -> RendererConfig -> Ordering
    $c< :: RendererConfig -> RendererConfig -> Bool
    < :: RendererConfig -> RendererConfig -> Bool
    $c<= :: RendererConfig -> RendererConfig -> Bool
    <= :: RendererConfig -> RendererConfig -> Bool
    $c> :: RendererConfig -> RendererConfig -> Bool
    > :: RendererConfig -> RendererConfig -> Bool
    $c>= :: RendererConfig -> RendererConfig -> Bool
    >= :: RendererConfig -> RendererConfig -> Bool
    $cmax :: RendererConfig -> RendererConfig -> RendererConfig
    max :: RendererConfig -> RendererConfig -> RendererConfig
    $cmin :: RendererConfig -> RendererConfig -> RendererConfig
    min :: RendererConfig -> RendererConfig -> RendererConfig
    Ord, ReadPrec [RendererConfig]
    ReadPrec RendererConfig
    Int -> ReadS RendererConfig
    ReadS [RendererConfig]
    (Int -> ReadS RendererConfig)
    -> ReadS [RendererConfig]
    -> ReadPrec RendererConfig
    -> ReadPrec [RendererConfig]
    -> Read RendererConfig
    forall a.
    (Int -> ReadS a)
    -> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
    $creadsPrec :: Int -> ReadS RendererConfig
    readsPrec :: Int -> ReadS RendererConfig
    $creadList :: ReadS [RendererConfig]
    readList :: ReadS [RendererConfig]
    $creadPrec :: ReadPrec RendererConfig
    readPrec :: ReadPrec RendererConfig
    $creadListPrec :: ReadPrec [RendererConfig]
    readListPrec :: ReadPrec [RendererConfig]
    Read, Int -> RendererConfig -> ShowS
    [RendererConfig] -> ShowS
    RendererConfig -> [Char]
    (Int -> RendererConfig -> ShowS)
    -> (RendererConfig -> [Char])
    -> ([RendererConfig] -> ShowS)
    -> Show RendererConfig
    forall a.
    (Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> RendererConfig -> ShowS
    showsPrec :: Int -> RendererConfig -> ShowS
    $cshow :: RendererConfig -> [Char]
    show :: RendererConfig -> [Char]
    $cshowList :: [RendererConfig] -> ShowS
    showList :: [RendererConfig] -> ShowS
    Show, Typeable)

    instance FromNumber RendererConfig Word32 where
      fromNumber :: BlendMode -> RendererConfig
    fromNumber BlendMode
    n = RendererConfig
        { rendererType :: RendererType
    rendererType          = Bool -> Bool -> Bool -> RendererType
    rendererType'
                                    (BlendMode
    n BlendMode -> BlendMode -> BlendMode
    forall a. Bits a => a -> a -> a
    .&. BlendMode
    forall {a}. (Eq a, Num a) => a
    Raw.SDL_RENDERER_SOFTWARE BlendMode -> BlendMode -> Bool
    forall a. Eq a => a -> a -> Bool
    /= BlendMode
    0)
                                    (BlendMode
    n BlendMode -> BlendMode -> BlendMode
    forall a. Bits a => a -> a -> a
    .&. BlendMode
    forall {a}. (Eq a, Num a) => a
    Raw.SDL_RENDERER_ACCELERATED BlendMode -> BlendMode -> Bool
    forall a. Eq a => a -> a -> Bool
    /= BlendMode
    0)
                                    (BlendMode
    n BlendMode -> BlendMode -> BlendMode
    forall a. Bits a => a -> a -> a
    .&. BlendMode
    forall {a}. (Eq a, Num a) => a
    Raw.SDL_RENDERER_PRESENTVSYNC BlendMode -> BlendMode -> Bool
    forall a. Eq a => a -> a -> Bool
    /= BlendMode
    0)
        , rendererTargetTexture :: Bool
    rendererTargetTexture = BlendMode
    n BlendMode -> BlendMode -> BlendMode
    forall a. Bits a => a -> a -> a
    .&. BlendMode
    forall {a}. (Eq a, Num a) => a
    Raw.SDL_RENDERER_TARGETTEXTURE BlendMode -> BlendMode -> Bool
    forall a. Eq a => a -> a -> Bool
    /= BlendMode
    0
        }
        where
          rendererType' :: Bool -> Bool -> Bool -> RendererType
    rendererType' Bool
    s Bool
    a Bool
    v | Bool
    s         = RendererType
    SoftwareRenderer
                              | Bool
    a Bool -> Bool -> Bool
    && Bool
    v    = RendererType
    AcceleratedVSyncRenderer
                              | Bool
    a         = RendererType
    AcceleratedRenderer
                              | Bool
    otherwise = RendererType
    UnacceleratedRenderer

    instance ToNumber RendererConfig Word32 where
      toNumber :: RendererConfig -> BlendMode
    toNumber RendererConfig
    config = (BlendMode -> BlendMode -> BlendMode)
    -> BlendMode -> [BlendMode] -> BlendMode
    forall a b. (a -> b -> b) -> b -> [a] -> b
    forall (t :: Type -> Type) a b.
    Foldable t =>
    (a -> b -> b) -> b -> t a -> b
    foldr BlendMode -> BlendMode -> BlendMode
    forall a. Bits a => a -> a -> a
    (.|.) BlendMode
    0
        [ if Bool
    isSoftware then BlendMode
    forall {a}. (Eq a, Num a) => a
    Raw.SDL_RENDERER_SOFTWARE else BlendMode
    0
        , if Bool -> Bool
    not Bool
    isSoftware then BlendMode
    forall {a}. (Eq a, Num a) => a
    Raw.SDL_RENDERER_ACCELERATED else BlendMode
    0
        , if RendererConfig -> RendererType
    rendererType RendererConfig
    config RendererType -> RendererType -> Bool
    forall a. Eq a => a -> a -> Bool
    == RendererType
    AcceleratedVSyncRenderer then BlendMode
    forall {a}. (Eq a, Num a) => a
    Raw.SDL_RENDERER_PRESENTVSYNC  else BlendMode
    0
        , if RendererConfig -> Bool
    rendererTargetTexture RendererConfig
    config then BlendMode
    forall {a}. (Eq a, Num a) => a
    Raw.SDL_RENDERER_TARGETTEXTURE else BlendMode
    0
        ]
        where
          isSoftware :: Bool
    isSoftware = RendererConfig -> RendererType
    rendererType RendererConfig
    config RendererType -> RendererType -> Bool
    forall a. Eq a => a -> a -> Bool
    == RendererType
    SoftwareRenderer

    -- | Default options for 'RendererConfig'.
    --
    -- @
    -- 'defaultRenderer' = 'RendererConfig'
    --   { 'rendererType'          = 'AcceleratedRenderer'
    --   , 'rendererTargetTexture' = False
    --   }
    -- @
    defaultRenderer :: RendererConfig
    defaultRenderer :: RendererConfig
    defaultRenderer = RendererConfig
      { rendererType :: RendererType
    rendererType          = RendererType
    AcceleratedRenderer
      , rendererTargetTexture :: Bool
    rendererTargetTexture = Bool
    False
      }

    -- | Information about an instantiated 'Renderer'.
    data RendererInfo = RendererInfo
      { RendererInfo -> Text
    rendererInfoName              :: Text
        -- ^ The name of the renderer
      , RendererInfo -> RendererConfig
    rendererInfoFlags             :: RendererConfig
        -- ^ Supported renderer features
      , RendererInfo -> BlendMode
    rendererInfoNumTextureFormats :: Word32
        -- ^ The number of available texture formats
      , RendererInfo -> [PixelFormat]
    rendererInfoTextureFormats    :: [PixelFormat]
        -- ^ The available texture formats
      , RendererInfo -> CInt
    rendererInfoMaxTextureWidth   :: CInt
        -- ^ The maximum texture width
      , RendererInfo -> CInt
    rendererInfoMaxTextureHeight  :: CInt
        -- ^ The maximum texture height
      } deriving (RendererInfo -> RendererInfo -> Bool
    (RendererInfo -> RendererInfo -> Bool)
    -> (RendererInfo -> RendererInfo -> Bool) -> Eq RendererInfo
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: RendererInfo -> RendererInfo -> Bool
    == :: RendererInfo -> RendererInfo -> Bool
    $c/= :: RendererInfo -> RendererInfo -> Bool
    /= :: RendererInfo -> RendererInfo -> Bool
    Eq, (forall x. RendererInfo -> Rep RendererInfo x)
    -> (forall x. Rep RendererInfo x -> RendererInfo)
    -> Generic RendererInfo
    forall x. Rep RendererInfo x -> RendererInfo
    forall x. RendererInfo -> Rep RendererInfo x
    forall a.
    (forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
    $cfrom :: forall x. RendererInfo -> Rep RendererInfo x
    from :: forall x. RendererInfo -> Rep RendererInfo x
    $cto :: forall x. Rep RendererInfo x -> RendererInfo
    to :: forall x. Rep RendererInfo x -> RendererInfo
    Generic, Eq RendererInfo
    Eq RendererInfo
    -> (RendererInfo -> RendererInfo -> Ordering)
    -> (RendererInfo -> RendererInfo -> Bool)
    -> (RendererInfo -> RendererInfo -> Bool)
    -> (RendererInfo -> RendererInfo -> Bool)
    -> (RendererInfo -> RendererInfo -> Bool)
    -> (RendererInfo -> RendererInfo -> RendererInfo)
    -> (RendererInfo -> RendererInfo -> RendererInfo)
    -> Ord RendererInfo
    RendererInfo -> RendererInfo -> Bool
    RendererInfo -> RendererInfo -> Ordering
    RendererInfo -> RendererInfo -> RendererInfo
    forall a.
    Eq a
    -> (a -> a -> Ordering)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> a)
    -> (a -> a -> a)
    -> Ord a
    $ccompare :: RendererInfo -> RendererInfo -> Ordering
    compare :: RendererInfo -> RendererInfo -> Ordering
    $c< :: RendererInfo -> RendererInfo -> Bool
    < :: RendererInfo -> RendererInfo -> Bool
    $c<= :: RendererInfo -> RendererInfo -> Bool
    <= :: RendererInfo -> RendererInfo -> Bool
    $c> :: RendererInfo -> RendererInfo -> Bool
    > :: RendererInfo -> RendererInfo -> Bool
    $c>= :: RendererInfo -> RendererInfo -> Bool
    >= :: RendererInfo -> RendererInfo -> Bool
    $cmax :: RendererInfo -> RendererInfo -> RendererInfo
    max :: RendererInfo -> RendererInfo -> RendererInfo
    $cmin :: RendererInfo -> RendererInfo -> RendererInfo
    min :: RendererInfo -> RendererInfo -> RendererInfo
    Ord, ReadPrec [RendererInfo]
    ReadPrec RendererInfo
    Int -> ReadS RendererInfo
    ReadS [RendererInfo]
    (Int -> ReadS RendererInfo)
    -> ReadS [RendererInfo]
    -> ReadPrec RendererInfo
    -> ReadPrec [RendererInfo]
    -> Read RendererInfo
    forall a.
    (Int -> ReadS a)
    -> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
    $creadsPrec :: Int -> ReadS RendererInfo
    readsPrec :: Int -> ReadS RendererInfo
    $creadList :: ReadS [RendererInfo]
    readList :: ReadS [RendererInfo]
    $creadPrec :: ReadPrec RendererInfo
    readPrec :: ReadPrec RendererInfo
    $creadListPrec :: ReadPrec [RendererInfo]
    readListPrec :: ReadPrec [RendererInfo]
    Read, Int -> RendererInfo -> ShowS
    [RendererInfo] -> ShowS
    RendererInfo -> [Char]
    (Int -> RendererInfo -> ShowS)
    -> (RendererInfo -> [Char])
    -> ([RendererInfo] -> ShowS)
    -> Show RendererInfo
    forall a.
    (Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> RendererInfo -> ShowS
    showsPrec :: Int -> RendererInfo -> ShowS
    $cshow :: RendererInfo -> [Char]
    show :: RendererInfo -> [Char]
    $cshowList :: [RendererInfo] -> ShowS
    showList :: [RendererInfo] -> ShowS
    Show, Typeable)

    fromRawRendererInfo :: MonadIO m => Raw.RendererInfo -> m RendererInfo
    fromRawRendererInfo :: forall (m :: Type -> Type).
    MonadIO m =>
    RendererInfo -> m RendererInfo
    fromRawRendererInfo (Raw.RendererInfo CString
    name BlendMode
    flgs BlendMode
    ntf [BlendMode]
    tfs CInt
    mtw CInt
    mth) = IO RendererInfo -> m RendererInfo
    forall a. IO a -> m a
    forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
    liftIO (IO RendererInfo -> m RendererInfo)
    -> IO RendererInfo -> m RendererInfo
    forall a b. (a -> b) -> a -> b
    $ do
        Text
    name' <- ByteString -> Text
    Text.decodeUtf8 (ByteString -> Text) -> IO ByteString -> IO Text
    forall (f :: Type -> Type) a b. Functor f => (a -> b) -> f a -> f b
    <$> CString -> IO ByteString
    BS.packCString CString
    name
        RendererInfo -> IO RendererInfo
    forall a. a -> IO a
    forall (m :: Type -> Type) a. Monad m => a -> m a
    return (RendererInfo -> IO RendererInfo)
    -> RendererInfo -> IO RendererInfo
    forall a b. (a -> b) -> a -> b
    $ Text
    -> RendererConfig
    -> BlendMode
    -> [PixelFormat]
    -> CInt
    -> CInt
    -> RendererInfo
    RendererInfo Text
    name' (BlendMode -> RendererConfig
    forall a b. FromNumber a b => b -> a
    fromNumber BlendMode
    flgs) BlendMode
    ntf ((BlendMode -> PixelFormat) -> [BlendMode] -> [PixelFormat]
    forall a b. (a -> b) -> [a] -> [b]
    forall (f :: Type -> Type) a b. Functor f => (a -> b) -> f a -> f b
    fmap BlendMode -> PixelFormat
    forall a b. FromNumber a b => b -> a
    fromNumber [BlendMode]
    tfs) CInt
    mtw CInt
    mth

    -- | Get information about a rendering context.
    --
    -- See @<https://wiki.libsdl.org/SDL_GetRendererInfo SDL_GetRendererInfo>@ for C documentation.
    getRendererInfo :: MonadIO m => Renderer -> m RendererInfo
    getRendererInfo :: forall (m :: Type -> Type). MonadIO m => Renderer -> m RendererInfo
    getRendererInfo (Renderer Renderer
    renderer) = IO RendererInfo -> m RendererInfo
    forall a. IO a -> m a
    forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
    liftIO (IO RendererInfo -> m RendererInfo)
    -> IO RendererInfo -> m RendererInfo
    forall a b. (a -> b) -> a -> b
    $
      (Ptr RendererInfo -> IO RendererInfo) -> IO RendererInfo
    forall a b. Storable a => (Ptr a -> IO b) -> IO b
    alloca ((Ptr RendererInfo -> IO RendererInfo) -> IO RendererInfo)
    -> (Ptr RendererInfo -> IO RendererInfo) -> IO RendererInfo
    forall a b. (a -> b) -> a -> b
    $ \Ptr RendererInfo
    rptr -> do
        Text -> Text -> IO CInt -> IO ()
    forall (m :: Type -> Type) a.
    (MonadIO m, Num a, Ord a) =>
    Text -> Text -> m a -> m ()
    throwIfNeg_ Text
    "getRendererInfo" Text
    "SDL_GetRendererInfo" (IO CInt -> IO ()) -> IO CInt -> IO ()
    forall a b. (a -> b) -> a -> b
    $
          Renderer -> Ptr RendererInfo -> IO CInt
    forall (m :: Type -> Type).
    MonadIO m =>
    Renderer -> Ptr RendererInfo -> m CInt
    Raw.getRendererInfo Renderer
    renderer Ptr RendererInfo
    rptr
        Ptr RendererInfo -> IO RendererInfo
    forall a. Storable a => Ptr a -> IO a
    peek Ptr RendererInfo
    rptr IO RendererInfo
    -> (RendererInfo -> IO RendererInfo) -> IO RendererInfo
    forall a b. IO a -> (a -> IO b) -> IO b
    forall (m :: Type -> Type) a b. Monad m => m a -> (a -> m b) -> m b
    >>= RendererInfo -> IO RendererInfo
    forall (m :: Type -> Type).
    MonadIO m =>
    RendererInfo -> m RendererInfo
    fromRawRendererInfo

    -- | Enumerate all known render drivers on the system, and determine their supported features.
    --
    -- See @<https://wiki.libsdl.org/SDL_GetRenderDriverInfo SDL_GetRenderDriverInfo>@ for C documentation.
    getRenderDriverInfo :: MonadIO m => m [RendererInfo]
    getRenderDriverInfo :: forall (m :: Type -> Type). MonadIO m => m [RendererInfo]
    getRenderDriverInfo = IO [RendererInfo] -> m [RendererInfo]
    forall a. IO a -> m a
    forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
    liftIO (IO [RendererInfo] -> m [RendererInfo])
    -> IO [RendererInfo] -> m [RendererInfo]
    forall a b. (a -> b) -> a -> b
    $ do
      CInt
    count <- IO CInt
    forall (m :: Type -> Type). MonadIO m => m CInt
    Raw.getNumRenderDrivers
      (CInt -> IO RendererInfo) -> [CInt] -> IO [RendererInfo]
    forall (t :: Type -> Type) (f :: Type -> Type) a b.
    (Traversable t, Applicative f) =>
    (a -> f b) -> t a -> f (t b)
    forall (f :: Type -> Type) a b.
    Applicative f =>
    (a -> f b) -> [a] -> f [b]
    traverse CInt -> IO RendererInfo
    go [CInt
    0..CInt
    countCInt -> CInt -> CInt
    forall a. Num a => a -> a -> a
    -CInt
    1]
      where
        go :: CInt -> IO RendererInfo
    go CInt
    idx = (Ptr RendererInfo -> IO RendererInfo) -> IO RendererInfo
    forall a b. Storable a => (Ptr a -> IO b) -> IO b
    alloca ((Ptr RendererInfo -> IO RendererInfo) -> IO RendererInfo)
    -> (Ptr RendererInfo -> IO RendererInfo) -> IO RendererInfo
    forall a b. (a -> b) -> a -> b
    $ \Ptr RendererInfo
    rptr -> do
                   Text -> Text -> IO CInt -> IO ()
    forall (m :: Type -> Type) a.
    (MonadIO m, Num a, Ord a) =>
    Text -> Text -> m a -> m ()
    throwIfNeg_ Text
    "getRenderDriverInfo" Text
    "SDL_GetRenderDriverInfo" (IO CInt -> IO ()) -> IO CInt -> IO ()
    forall a b. (a -> b) -> a -> b
    $
                     CInt -> Ptr RendererInfo -> IO CInt
    forall (m :: Type -> Type).
    MonadIO m =>
    CInt -> Ptr RendererInfo -> m CInt
    Raw.getRenderDriverInfo CInt
    idx Ptr RendererInfo
    rptr
                   Ptr RendererInfo -> IO RendererInfo
    forall a. Storable a => Ptr a -> IO a
    peek Ptr RendererInfo
    rptr IO RendererInfo
    -> (RendererInfo -> IO RendererInfo) -> IO RendererInfo
    forall a b. IO a -> (a -> IO b) -> IO b
    forall (m :: Type -> Type) a b. Monad m => m a -> (a -> m b) -> m b
    >>= RendererInfo -> IO RendererInfo
    forall (m :: Type -> Type).
    MonadIO m =>
    RendererInfo -> m RendererInfo
    fromRawRendererInfo

    -- | 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 @<https://wiki.libsdl.org/SDL_SetTextureAlphaMod SDL_SetTextureAlphaMod>@ and @<https://wiki.libsdl.org/SDL_GetTextureAlphaMod SDL_GetTextureAlphaMod>@ for C documentation.
    textureAlphaMod :: Texture -> StateVar Word8
    textureAlphaMod :: Texture -> StateVar Word8
    textureAlphaMod (Texture Renderer
    t) = IO Word8 -> (Word8 -> IO ()) -> StateVar Word8
    forall a. IO a -> (a -> IO ()) -> StateVar a
    makeStateVar IO Word8
    getTextureAlphaMod Word8 -> IO ()
    forall {m :: Type -> Type}. MonadIO m => Word8 -> m ()
    setTextureAlphaMod
      where
      getTextureAlphaMod :: IO Word8
    getTextureAlphaMod = IO Word8 -> IO Word8
    forall a. IO a -> IO a
    forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
    liftIO (IO Word8 -> IO Word8) -> IO Word8 -> IO Word8
    forall a b. (a -> b) -> a -> b
    $
        (Ptr Word8 -> IO Word8) -> IO Word8
    forall a b. Storable a => (Ptr a -> IO b) -> IO b
    alloca ((Ptr Word8 -> IO Word8) -> IO Word8)
    -> (Ptr Word8 -> IO Word8) -> IO Word8
    forall a b. (a -> b) -> a -> b
    $ \Ptr Word8
    x -> do
          Text -> Text -> IO CInt -> IO ()
    forall (m :: Type -> Type) a.
    (MonadIO m, Num a, Ord a) =>
    Text -> Text -> m a -> m ()
    throwIfNeg_ Text
    "SDL.Video.Renderer.getTextureAlphaMod" Text
    "SDL_GetTextureAlphaMod" (IO CInt -> IO ()) -> IO CInt -> IO ()
    forall a b. (a -> b) -> a -> b
    $
            Renderer -> Ptr Word8 -> IO CInt
    forall (m :: Type -> Type).
    MonadIO m =>
    Renderer -> Ptr Word8 -> m CInt
    Raw.getTextureAlphaMod Renderer
    t Ptr Word8
    x
          Ptr Word8 -> IO Word8
    forall a. Storable a => Ptr a -> IO a
    peek Ptr Word8
    x

      setTextureAlphaMod :: Word8 -> m ()
    setTextureAlphaMod Word8
    alpha =
        Text -> Text -> m CInt -> m ()
    forall (m :: Type -> Type) a.
    (MonadIO m, Num a, Ord a) =>
    Text -> Text -> m a -> m ()
    throwIfNeg_ Text
    "SDL.Video.Renderer.setTextureAlphaMod" Text
    "SDL_SetTextureAlphaMod" (m CInt -> m ()) -> m CInt -> m ()
    forall a b. (a -> b) -> a -> b
    $
          Renderer -> Word8 -> m CInt
    forall (m :: Type -> Type).
    MonadIO m =>
    Renderer -> Word8 -> m CInt
    Raw.setTextureAlphaMod Renderer
    t Word8
    alpha

    -- | 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 @<https://wiki.libsdl.org/SDL_SetTextureBlendMode SDL_SetTextureBlendMode>@ and @<https://wiki.libsdl.org/SDL_GetTextureBlendMode SDL_GetTextureBlendMode>@ for C documentation.
    textureBlendMode :: Texture -> StateVar BlendMode
    textureBlendMode :: Texture -> StateVar BlendMode
    textureBlendMode (Texture Renderer
    t) = IO BlendMode -> (BlendMode -> IO ()) -> StateVar BlendMode
    forall a. IO a -> (a -> IO ()) -> StateVar a
    makeStateVar IO BlendMode
    getTextureBlendMode BlendMode -> IO ()
    forall {m :: Type -> Type} {a}.
    (MonadIO m, ToNumber a BlendMode) =>
    a -> m ()
    setTextureBlendMode
      where
      getTextureBlendMode :: IO BlendMode
    getTextureBlendMode = IO BlendMode -> IO BlendMode
    forall a. IO a -> IO a
    forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
    liftIO (IO BlendMode -> IO BlendMode) -> IO BlendMode -> IO BlendMode
    forall a b. (a -> b) -> a -> b
    $
        (Ptr BlendMode -> IO BlendMode) -> IO BlendMode
    forall a b. Storable a => (Ptr a -> IO b) -> IO b
    alloca ((Ptr BlendMode -> IO BlendMode) -> IO BlendMode)
    -> (Ptr BlendMode -> IO BlendMode) -> IO BlendMode
    forall a b. (a -> b) -> a -> b
    $ \Ptr BlendMode
    x -> do
          Text -> Text -> IO CInt -> IO ()
    forall (m :: Type -> Type) a.
    (MonadIO m, Num a, Ord a) =>
    Text -> Text -> m a -> m ()
    throwIfNeg_ Text
    "SDL.Video.Renderer.getTextureBlendMode" Text
    "SDL_GetTextureBlendMode" (IO CInt -> IO ()) -> IO CInt -> IO ()
    forall a b. (a -> b) -> a -> b
    $
            Renderer -> Ptr BlendMode -> IO CInt
    forall (m :: Type -> Type).
    MonadIO m =>
    Renderer -> Ptr BlendMode -> m CInt
    Raw.getTextureBlendMode Renderer
    t Ptr BlendMode
    x
          BlendMode -> BlendMode
    forall a b. FromNumber a b => b -> a
    fromNumber (BlendMode -> BlendMode) -> IO BlendMode -> IO BlendMode
    forall (f :: Type -> Type) a b. Functor f => (a -> b) -> f a -> f b
    <$> Ptr BlendMode -> IO BlendMode
    forall a. Storable a => Ptr a -> IO a
    peek Ptr BlendMode
    x

      setTextureBlendMode :: a -> m ()
    setTextureBlendMode a
    bm =
        Text -> Text -> m CInt -> m ()
    forall (m :: Type -> Type) a.
    (MonadIO m, Num a, Ord a) =>
    Text -> Text -> m a -> m ()
    throwIfNeg_ Text
    "SDL.Video.Renderer.setTextureBlendMode" Text
    "SDL_SetTextureBlendMode" (m CInt -> m ()) -> m CInt -> m ()
    forall a b. (a -> b) -> a -> b
    $
        Renderer -> BlendMode -> m CInt
    forall (m :: Type -> Type).
    MonadIO m =>
    Renderer -> BlendMode -> m CInt
    Raw.setTextureBlendMode Renderer
    t (a -> BlendMode
    forall a b. ToNumber a b => a -> b
    toNumber a
    bm)

    -- | Get or set the blend mode used for blit operations.
    --
    -- This 'StateVar' can be modified using '$=' and the current value retrieved with 'get'.
    --
    -- See @<https://wiki.libsdl.org/SDL_SetSurfaceBlendMode SDL_SetSurfaceBlendMode>@ and @<https://wiki.libsdl.org/SDL_GetSurfaceBlendMode SDL_GetSurfaceBlendMode>@ for C documentation.
    surfaceBlendMode :: Surface -> StateVar BlendMode
    surfaceBlendMode :: Surface -> StateVar BlendMode
    surfaceBlendMode (Surface Ptr Surface
    s Maybe (IOVector Word8)
    _) = IO BlendMode -> (BlendMode -> IO ()) -> StateVar BlendMode
    forall a. IO a -> (a -> IO ()) -> StateVar a
    makeStateVar IO BlendMode
    getSurfaceBlendMode BlendMode -> IO ()
    forall {m :: Type -> Type} {a}.
    (MonadIO m, ToNumber a BlendMode) =>
    a -> m ()
    setSurfaceBlendMode
      where
      getSurfaceBlendMode :: IO BlendMode
    getSurfaceBlendMode = IO BlendMode -> IO BlendMode
    forall a. IO a -> IO a
    forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
    liftIO (IO BlendMode -> IO BlendMode) -> IO BlendMode -> IO BlendMode
    forall a b. (a -> b) -> a -> b
    $
        (Ptr BlendMode -> IO BlendMode) -> IO BlendMode
    forall a b. Storable a => (Ptr a -> IO b) -> IO b
    alloca ((Ptr BlendMode -> IO BlendMode) -> IO BlendMode)
    -> (Ptr BlendMode -> IO BlendMode) -> IO BlendMode
    forall a b. (a -> b) -> a -> b
    $ \Ptr BlendMode
    x -> do
          Text -> Text -> IO CInt -> IO ()
    forall (m :: Type -> Type) a.
    (MonadIO m, Num a, Ord a) =>
    Text -> Text -> m a -> m ()
    throwIfNeg_ Text
    "SDL.Video.Renderer.getSurfaceBlendMode" Text
    "SDL_GetSurfaceBlendMode" (IO CInt -> IO ()) -> IO CInt -> IO ()
    forall a b. (a -> b) -> a -> b
    $
            Ptr Surface -> Ptr BlendMode -> IO CInt
    forall (m :: Type -> Type).
    MonadIO m =>
    Ptr Surface -> Ptr BlendMode -> m CInt
    Raw.getSurfaceBlendMode Ptr Surface
    s Ptr BlendMode
    x
          BlendMode -> BlendMode
    forall a b. FromNumber a b => b -> a
    fromNumber (BlendMode -> BlendMode) -> IO BlendMode -> IO BlendMode
    forall (f :: Type -> Type) a b. Functor f => (a -> b) -> f a -> f b
    <$> Ptr BlendMode -> IO BlendMode
    forall a. Storable a => Ptr a -> IO a
    peek Ptr BlendMode
    x

      setSurfaceBlendMode :: a -> m ()
    setSurfaceBlendMode a
    bm =
        Text -> Text -> m CInt -> m ()
    forall (m :: Type -> Type) a.
    (MonadIO m, Num a, Ord a) =>
    Text -> Text -> m a -> m ()
    throwIfNeg_ Text
    "SDL.Video.Renderer.setSurfaceBlendMode" Text
    "SDL_SetSurfaceBlendMode" (m CInt -> m ()) -> m CInt -> m ()
    forall a b. (a -> b) -> a -> b
    $
        Ptr Surface -> BlendMode -> m CInt
    forall (m :: Type -> Type).
    MonadIO m =>
    Ptr Surface -> BlendMode -> m CInt
    Raw.setSurfaceBlendMode Ptr Surface
    s (a -> BlendMode
    forall a b. ToNumber a b => a -> b
    toNumber a
    bm)

    -- | 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 @<https://wiki.libsdl.org/SDL_SetRenderTarget SDL_SetRenderTarget>@ and @<https://wiki.libsdl.org/SDL_GetRenderTarget SDL_GetRenderTarget>@ for C documentation.
    rendererRenderTarget :: Renderer -> StateVar (Maybe Texture)
    rendererRenderTarget :: Renderer -> StateVar (Maybe Texture)
    rendererRenderTarget (Renderer Renderer
    r) = IO (Maybe Texture)
    -> (Maybe Texture -> IO ()) -> StateVar (Maybe Texture)
    forall a. IO a -> (a -> IO ()) -> StateVar a
    makeStateVar IO (Maybe Texture)
    getRenderTarget Maybe Texture -> IO ()
    forall {m :: Type -> Type}. MonadIO m => Maybe Texture -> m ()
    setRenderTarget
      where
      getRenderTarget :: IO (Maybe Texture)
    getRenderTarget = do
        Renderer
    t <- Renderer -> IO Renderer
    forall (m :: Type -> Type). MonadIO m => Renderer -> m Renderer
    Raw.getRenderTarget Renderer
    r
        Maybe Texture -> IO (Maybe Texture)
    forall a. a -> IO a
    forall (m :: Type -> Type) a. Monad m => a -> m a
    return (Maybe Texture -> IO (Maybe Texture))
    -> Maybe Texture -> IO (Maybe Texture)
    forall a b. (a -> b) -> a -> b
    $
          if Renderer
    t Renderer -> Renderer -> Bool
    forall a. Eq a => a -> a -> Bool
    == Renderer
    forall a. Ptr a
    nullPtr
            then Maybe Texture
    forall a. Maybe a
    Nothing
            else Texture -> Maybe Texture
    forall a. a -> Maybe a
    Just (Renderer -> Texture
    Texture Renderer
    t)

      setRenderTarget :: Maybe Texture -> m ()
    setRenderTarget Maybe Texture
    texture =
        Text -> Text -> m CInt -> m ()
    forall (m :: Type -> Type) a.
    (MonadIO m, Num a, Ord a) =>
    Text -> Text -> m a -> m ()
    throwIfNeg_ Text
    "SDL.Video.Renderer.setRenderTarget" Text
    "SDL_SetRenderTarget" (m CInt -> m ()) -> m CInt -> m ()
    forall a b. (a -> b) -> a -> b
    $
        case Maybe Texture
    texture of
          Maybe Texture
    Nothing -> Renderer -> Renderer -> m CInt
    forall (m :: Type -> Type).
    MonadIO m =>
    Renderer -> Renderer -> m CInt
    Raw.setRenderTarget Renderer
    r Renderer
    forall a. Ptr a
    nullPtr
          Just (Texture Renderer
    t) -> Renderer -> Renderer -> m CInt
    forall (m :: Type -> Type).
    MonadIO m =>
    Renderer -> Renderer -> m CInt
    Raw.setRenderTarget Renderer
    r Renderer
    t

    -- | Get or set the device independent resolution for rendering.
    --
    -- This 'StateVar' can be modified using '$=' and the current value retrieved with 'get'.
    --
    -- See @<https://wiki.libsdl.org/SDL_RenderSetLogicalSize SDL_RenderSetLogicalSize>@ and @<https://wiki.libsdl.org/SDL_RenderGetLogicalSize SDL_RenderGetLogicalSize>@ for C documentation.
    rendererLogicalSize :: Renderer -> StateVar (Maybe (V2 CInt))
    rendererLogicalSize :: Renderer -> StateVar (Maybe (V2 CInt))
    rendererLogicalSize (Renderer Renderer
    r) = IO (Maybe (V2 CInt))
    -> (Maybe (V2 CInt) -> IO ()) -> StateVar (Maybe (V2 CInt))
    forall a. IO a -> (a -> IO ()) -> StateVar a
    makeStateVar IO (Maybe (V2 CInt))
    renderGetLogicalSize Maybe (V2 CInt) -> IO ()
    forall {m :: Type -> Type}. MonadIO m => Maybe (V2 CInt) -> m ()
    renderSetLogicalSize
      where
      renderGetLogicalSize :: IO (Maybe (V2 CInt))
    renderGetLogicalSize = IO (Maybe (V2 CInt)) -> IO (Maybe (V2 CInt))
    forall a. IO a -> IO a
    forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
    liftIO (IO (Maybe (V2 CInt)) -> IO (Maybe (V2 CInt)))
    -> IO (Maybe (V2 CInt)) -> IO (Maybe (V2 CInt))
    forall a b. (a -> b) -> a -> b
    $
        (Ptr CInt -> IO (Maybe (V2 CInt))) -> IO (Maybe (V2 CInt))
    forall a b. Storable a => (Ptr a -> IO b) -> IO b
    alloca ((Ptr CInt -> IO (Maybe (V2 CInt))) -> IO (Maybe (V2 CInt)))
    -> (Ptr CInt -> IO (Maybe (V2 CInt))) -> IO (Maybe (V2 CInt))
    forall a b. (a -> b) -> a -> b
    $ \Ptr CInt
    w -> do
        (Ptr CInt -> IO (Maybe (V2 CInt))) -> IO (Maybe (V2 CInt))
    forall a b. Storable a => (Ptr a -> IO b) -> IO b
    alloca ((Ptr CInt -> IO (Maybe (V2 CInt))) -> IO (Maybe (V2 CInt)))
    -> (Ptr CInt -> IO (Maybe (V2 CInt))) -> IO (Maybe (V2 CInt))
    forall a b. (a -> b) -> a -> b
    $ \Ptr CInt
    h -> do
          Renderer -> Ptr CInt -> Ptr CInt -> IO ()
    forall (m :: Type -> Type).
    MonadIO m =>
    Renderer -> Ptr CInt -> Ptr CInt -> m ()
    Raw.renderGetLogicalSize Renderer
    r Ptr CInt
    w Ptr CInt
    h
          V2 CInt
    v <- CInt -> CInt -> V2 CInt
    forall a. a -> a -> V2 a
    V2 (CInt -> CInt -> V2 CInt) -> IO CInt -> IO (CInt -> V2 CInt)
    forall (f :: Type -> Type) a b. Functor f => (a -> b) -> f a -> f b
    <$> Ptr CInt -> IO CInt
    forall a. Storable a => Ptr a -> IO a
    peek Ptr CInt
    w IO (CInt -> V2 CInt) -> IO CInt -> IO (V2 CInt)
    forall a b. IO (a -> b) -> IO a -> IO b
    forall (f :: Type -> Type) a b.
    Applicative f =>
    f (a -> b) -> f a -> f b
    <*> Ptr CInt -> IO CInt
    forall a. Storable a => Ptr a -> IO a
    peek Ptr CInt
    h
          Maybe (V2 CInt) -> IO (Maybe (V2 CInt))
    forall a. a -> IO a
    forall (m :: Type -> Type) a. Monad m => a -> m a
    return (Maybe (V2 CInt) -> IO (Maybe (V2 CInt)))
    -> Maybe (V2 CInt) -> IO (Maybe (V2 CInt))
    forall a b. (a -> b) -> a -> b
    $ if V2 CInt
    v V2 CInt -> V2 CInt -> Bool
    forall a. Eq a => a -> a -> Bool
    == V2 CInt
    0 then Maybe (V2 CInt)
    forall a. Maybe a
    Nothing else V2 CInt -> Maybe (V2 CInt)
    forall a. a -> Maybe a
    Just V2 CInt
    v

      renderSetLogicalSize :: Maybe (V2 CInt) -> m ()
    renderSetLogicalSize Maybe (V2 CInt)
    v =
        Text -> Text -> m CInt -> m ()
    forall (m :: Type -> Type) a.
    (MonadIO m, Num a, Ord a) =>
    Text -> Text -> m a -> m ()
    throwIfNeg_ Text
    "SDL.Video.renderSetLogicalSize" Text
    "SDL_RenderSetLogicalSize" (m CInt -> m ()) -> m CInt -> m ()
    forall a b. (a -> b) -> a -> b
    $ do
          let (CInt
    x,CInt
    y) = case Maybe (V2 CInt)
    v of Just (V2 CInt
    vx CInt
    vy) -> (CInt
    vx, CInt
    vy)
                                Maybe (V2 CInt)
    Nothing -> (CInt
    0,CInt
    0)
          Renderer -> CInt -> CInt -> m CInt
    forall (m :: Type -> Type).
    MonadIO m =>
    Renderer -> CInt -> CInt -> m CInt
    Raw.renderSetLogicalSize Renderer
    r CInt
    x CInt
    y

    -- | Determine whether a window supports the use of render targets.
    --
    -- See @<https://wiki.libsdl.org/SDL_RenderTargetSupported SDL_RenderTargetSupported>@ for C documentation.
    renderTargetSupported :: (MonadIO m) => Renderer -> m Bool
    renderTargetSupported :: forall (m :: Type -> Type). MonadIO m => Renderer -> m Bool
    renderTargetSupported (Renderer Renderer
    r) = Renderer -> m Bool
    forall (m :: Type -> Type). MonadIO m => Renderer -> m Bool
    Raw.renderTargetSupported Renderer
    r

    -- | Convert the given the enumerated pixel format to a bpp value and RGBA masks.
    --
    -- See @<https://wiki.libsdl.org/SDL_PixelFormatEnumToMasks SDL_PixelFormatEnumToMasks>@ for C documentation.
    pixelFormatToMasks :: (MonadIO m) => PixelFormat -> m (CInt, V4 Word32)
    pixelFormatToMasks :: forall (m :: Type -> Type).
    MonadIO m =>
    PixelFormat -> m (CInt, V4 BlendMode)
    pixelFormatToMasks PixelFormat
    pf = IO (CInt, V4 BlendMode) -> m (CInt, V4 BlendMode)
    forall a. IO a -> m a
    forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
    liftIO (IO (CInt, V4 BlendMode) -> m (CInt, V4 BlendMode))
    -> IO (CInt, V4 BlendMode) -> m (CInt, V4 BlendMode)
    forall a b. (a -> b) -> a -> b
    $
      (Ptr CInt -> IO (CInt, V4 BlendMode)) -> IO (CInt, V4 BlendMode)
    forall a b. Storable a => (Ptr a -> IO b) -> IO b
    alloca ((Ptr CInt -> IO (CInt, V4 BlendMode)) -> IO (CInt, V4 BlendMode))
    -> (Ptr CInt -> IO (CInt, V4 BlendMode)) -> IO (CInt, V4 BlendMode)
    forall a b. (a -> b) -> a -> b
    $ \Ptr CInt
    bpp ->
      (Ptr BlendMode -> IO (CInt, V4 BlendMode))
    -> IO (CInt, V4 BlendMode)
    forall a b. Storable a => (Ptr a -> IO b) -> IO b
    alloca ((Ptr BlendMode -> IO (CInt, V4 BlendMode))
     -> IO (CInt, V4 BlendMode))
    -> (Ptr BlendMode -> IO (CInt, V4 BlendMode))
    -> IO (CInt, V4 BlendMode)
    forall a b. (a -> b) -> a -> b
    $ \Ptr BlendMode
    r ->
      (Ptr BlendMode -> IO (CInt, V4 BlendMode))
    -> IO (CInt, V4 BlendMode)
    forall a b. Storable a => (Ptr a -> IO b) -> IO b
    alloca ((Ptr BlendMode -> IO (CInt, V4 BlendMode))
     -> IO (CInt, V4 BlendMode))
    -> (Ptr BlendMode -> IO (CInt, V4 BlendMode))
    -> IO (CInt, V4 BlendMode)
    forall a b. (a -> b) -> a -> b
    $ \Ptr BlendMode
    g ->
      (Ptr BlendMode -> IO (CInt, V4 BlendMode))
    -> IO (CInt, V4 BlendMode)
    forall a b. Storable a => (Ptr a -> IO b) -> IO b
    alloca ((Ptr BlendMode -> IO (CInt, V4 BlendMode))
     -> IO (CInt, V4 BlendMode))
    -> (Ptr BlendMode -> IO (CInt, V4 BlendMode))
    -> IO (CInt, V4 BlendMode)
    forall a b. (a -> b) -> a -> b
    $ \Ptr BlendMode
    b ->
      (Ptr BlendMode -> IO (CInt, V4 BlendMode))
    -> IO (CInt, V4 BlendMode)
    forall a b. Storable a => (Ptr a -> IO b) -> IO b
    alloca ((Ptr BlendMode -> IO (CInt, V4 BlendMode))
     -> IO (CInt, V4 BlendMode))
    -> (Ptr BlendMode -> IO (CInt, V4 BlendMode))
    -> IO (CInt, V4 BlendMode)
    forall a b. (a -> b) -> a -> b
    $ \Ptr BlendMode
    a -> do
        (Bool -> Bool) -> Text -> Text -> IO Bool -> IO ()
    forall (m :: Type -> Type) a.
    MonadIO m =>
    (a -> Bool) -> Text -> Text -> m a -> m ()
    throwIf_ Bool -> Bool
    not Text
    "SDL.Video.pixelFormatEnumToMasks" Text
    "SDL_PixelFormatEnumToMasks" (IO Bool -> IO ()) -> IO Bool -> IO ()
    forall a b. (a -> b) -> a -> b
    $
          BlendMode
    -> Ptr CInt
    -> Ptr BlendMode
    -> Ptr BlendMode
    -> Ptr BlendMode
    -> Ptr BlendMode
    -> IO Bool
    forall (m :: Type -> Type).
    MonadIO m =>
    BlendMode
    -> Ptr CInt
    -> Ptr BlendMode
    -> Ptr BlendMode
    -> Ptr BlendMode
    -> Ptr BlendMode
    -> m Bool
    Raw.pixelFormatEnumToMasks (PixelFormat -> BlendMode
    forall a b. ToNumber a b => a -> b
    toNumber PixelFormat
    pf) Ptr CInt
    bpp Ptr BlendMode
    r Ptr BlendMode
    g Ptr BlendMode
    b Ptr BlendMode
    a
        CInt
    -> BlendMode
    -> BlendMode
    -> BlendMode
    -> BlendMode
    -> (CInt, V4 BlendMode)
    forall {a} {a}. a -> a -> a -> a -> a -> (a, V4 a)
    wrap (CInt
     -> BlendMode
     -> BlendMode
     -> BlendMode
     -> BlendMode
     -> (CInt, V4 BlendMode))
    -> IO CInt
    -> IO
         (BlendMode
          -> BlendMode -> BlendMode -> BlendMode -> (CInt, V4 BlendMode))
    forall (f :: Type -> Type) a b. Functor f => (a -> b) -> f a -> f b
    <$> Ptr CInt -> IO CInt
    forall a. Storable a => Ptr a -> IO a
    peek Ptr CInt
    bpp IO
      (BlendMode
       -> BlendMode -> BlendMode -> BlendMode -> (CInt, V4 BlendMode))
    -> IO BlendMode
    -> IO (BlendMode -> BlendMode -> BlendMode -> (CInt, V4 BlendMode))
    forall a b. IO (a -> b) -> IO a -> IO b
    forall (f :: Type -> Type) a b.
    Applicative f =>
    f (a -> b) -> f a -> f b
    <*> Ptr BlendMode -> IO BlendMode
    forall a. Storable a => Ptr a -> IO a
    peek Ptr BlendMode
    r IO (BlendMode -> BlendMode -> BlendMode -> (CInt, V4 BlendMode))
    -> IO BlendMode
    -> IO (BlendMode -> BlendMode -> (CInt, V4 BlendMode))
    forall a b. IO (a -> b) -> IO a -> IO b
    forall (f :: Type -> Type) a b.
    Applicative f =>
    f (a -> b) -> f a -> f b
    <*> Ptr BlendMode -> IO BlendMode
    forall a. Storable a => Ptr a -> IO a
    peek Ptr BlendMode
    g IO (BlendMode -> BlendMode -> (CInt, V4 BlendMode))
    -> IO BlendMode -> IO (BlendMode -> (CInt, V4 BlendMode))
    forall a b. IO (a -> b) -> IO a -> IO b
    forall (f :: Type -> Type) a b.
    Applicative f =>
    f (a -> b) -> f a -> f b
    <*> Ptr BlendMode -> IO BlendMode
    forall a. Storable a => Ptr a -> IO a
    peek Ptr BlendMode
    b IO (BlendMode -> (CInt, V4 BlendMode))
    -> IO BlendMode -> IO (CInt, V4 BlendMode)
    forall a b. IO (a -> b) -> IO a -> IO b
    forall (f :: Type -> Type) a b.
    Applicative f =>
    f (a -> b) -> f a -> f b
    <*> Ptr BlendMode -> IO BlendMode
    forall a. Storable a => Ptr a -> IO a
    peek Ptr BlendMode
    a
        where
          wrap :: a -> a -> a -> a -> a -> (a, V4 a)
    wrap a
    bpp a
    r a
    g a
    b a
    a = (a
    bpp, a -> a -> a -> a -> V4 a
    forall a. a -> a -> a -> a -> V4 a
    V4 a
    r a
    g a
    b a
    a)

    -- | Convert a bpp value and RGBA masks to an enumerated pixel format.
    --
    -- See @<https://wiki.libsdl.org/SDL_MasksToPixelFormatEnum SDL_MasksToPixelFormatEnum>@ for C documentation.
    masksToPixelFormat :: (MonadIO m) => CInt -> V4 Word32 -> m PixelFormat
    masksToPixelFormat :: forall (m :: Type -> Type).
    MonadIO m =>
    CInt -> V4 BlendMode -> m PixelFormat
    masksToPixelFormat CInt
    bpp (V4 BlendMode
    r BlendMode
    g BlendMode
    b BlendMode
    a) = IO PixelFormat -> m PixelFormat
    forall a. IO a -> m a
    forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
    liftIO (IO PixelFormat -> m PixelFormat)
    -> IO PixelFormat -> m PixelFormat
    forall a b. (a -> b) -> a -> b
    $
      BlendMode -> PixelFormat
    forall a b. FromNumber a b => b -> a
    fromNumber (BlendMode -> PixelFormat) -> IO BlendMode -> IO PixelFormat
    forall (f :: Type -> Type) a b. Functor f => (a -> b) -> f a -> f b
    <$> CInt
    -> BlendMode -> BlendMode -> BlendMode -> BlendMode -> IO BlendMode
    forall (m :: Type -> Type).
    MonadIO m =>
    CInt
    -> BlendMode -> BlendMode -> BlendMode -> BlendMode -> m BlendMode
    Raw.masksToPixelFormatEnum CInt
    bpp BlendMode
    r BlendMode
    g BlendMode
    b BlendMode
    a