packages feed

sdl2 2.5.5.0 → 2.5.5.1

raw patch · 19 files changed

+259/−131 lines, 19 filesdep ~bytestringdep ~text

Dependency ranges changed: bytestring, text

Files

ChangeLog.md view
@@ -1,3 +1,14 @@+2.5.X.Y+=======++2.5.5.1+=======++* Added `getTicks64`+* Added `rendererIntegerScale`+* Added unboxed Vector instances for Rectangle+* Updated dependency ranges+ 2.5.5.0 ======= 
examples/EventWatch.hs view
@@ -51,4 +51,15 @@         |  keyboardEventKeyMotion keyboardEvent == Pressed &&            keysymKeycode (keyboardEventKeysym keyboardEvent) == KeycodeQ         -> return ()+      KeyboardEvent keyboardEvent+        |  keyboardEventKeyMotion keyboardEvent == Pressed+        -> print (keyboardEventKeysym keyboardEvent) >> waitEvent >>= go+      MouseMotionEvent mouseMotionEvent+        -> print mouseMotionEvent >> waitEvent >>= go+      MouseButtonEvent mouseButtonEvent+        -> print mouseButtonEvent >> waitEvent >>= go+      MouseWheelEvent mouseWheelEvent+      -> print mouseWheelEvent >> waitEvent >>= go+      QuitEvent+        -> return ()       _ -> waitEvent >>= go
sdl2.cabal view
@@ -1,5 +1,5 @@ name:                sdl2-version:             2.5.5.0+version:             2.5.5.1 synopsis:            Both high- and low-level bindings to the SDL library (version 2.0.6+). description:   This package contains bindings to the SDL 2 library, in both high- and@@ -145,10 +145,10 @@    build-depends:     base >= 4.7 && < 5,-    bytestring >= 0.10.4.0 && < 0.12,+    bytestring >= 0.10.4.0 && < 0.13,     exceptions >= 0.4 && < 0.11,     StateVar >= 1.1.0.0 && < 1.3,-    text >= 1.1.0.0 && < 2.1,+    text >= 1.1.0.0 && < 2.2,     transformers >= 0.2 && < 0.7,     vector >= 0.10.9.0 && < 0.14 @@ -156,7 +156,7 @@     cpp-options: -Dnolinear   else     build-depends:-      linear >= 1.10.1.2 && < 1.23+      linear >= 1.10.1.2 && < 1.24    if impl(ghc >= 8.6)     default-extensions: NoStarIsType
src/SDL/Audio.hs view
@@ -140,7 +140,7 @@ -- | Attempt to open the closest matching 'AudioDevice', as specified by the -- given 'OpenDeviceSpec'. ----- See @<https://wiki.libsdl.org/SDL_OpenAudioDevice SDL_OpenAudioDevice>@ for C documentation.+-- See @<https://wiki.libsdl.org/SDL2/SDL_OpenAudioDevice SDL_OpenAudioDevice>@ for C documentation. openAudioDevice :: MonadIO m => OpenDeviceSpec -> m (AudioDevice, AudioSpec) openAudioDevice OpenDeviceSpec{..} = liftIO $   maybeWith (BS.useAsCString . Text.encodeUtf8) openDeviceName $ \cDevName -> do@@ -224,7 +224,7 @@  -- | ----- See @<https://wiki.libsdl.org/SDL_CloseAudioDevice SDL_CloseAudioDevice>@ for C documentation.+-- See @<https://wiki.libsdl.org/SDL2/SDL_CloseAudioDevice SDL_CloseAudioDevice>@ for C documentation. closeAudioDevice :: MonadIO m => AudioDevice -> m () closeAudioDevice (AudioDevice d) = Raw.closeAudioDevice d 
src/SDL/Event.hs view
@@ -889,7 +889,7 @@ -- -- 'pumpEvents' gathers all the pending input information from devices and places it in the event queue. Without calls to 'pumpEvents' no events would ever be placed on the queue. Often the need for calls to 'pumpEvents' is hidden from the user since 'pollEvent' and 'waitEvent' implicitly call 'pumpEvents'. However, if you are not polling or waiting for events (e.g. you are filtering them), then you must call 'pumpEvents' to force an event queue update. ----- See @<https://wiki.libsdl.org/SDL_PumpEvents SDL_PumpEvents>@ for C documentation.+-- See @<https://wiki.libsdl.org/SDL2/SDL_PumpEvents SDL_PumpEvents>@ for C documentation. pumpEvents :: MonadIO m => m () pumpEvents = Raw.pumpEvents @@ -901,7 +901,7 @@ -- | Trigger an 'EventWatchCallback' when an event is added to the SDL -- event queue. ----- See @<https://wiki.libsdl.org/SDL_AddEventWatch>@ for C documentation.+-- See @<https://wiki.libsdl.org/SDL2/SDL_AddEventWatch>@ for C documentation. addEventWatch :: MonadIO m => EventWatchCallback -> m EventWatch addEventWatch callback = liftIO $ do   rawFilter <- Raw.mkEventFilter wrappedCb@@ -918,7 +918,7 @@  -- | Remove an 'EventWatch'. ----- See @<https://wiki.libsdl.org/SDL_DelEventWatch>@ for C documentation.+-- See @<https://wiki.libsdl.org/SDL2/SDL_DelEventWatch>@ for C documentation. delEventWatch :: MonadIO m => EventWatch -> m () delEventWatch = liftIO . runEventWatchRemoval 
src/SDL/Hint.hs view
@@ -136,7 +136,7 @@   deriving (Bounded, Data, Enum, Eq, Generic, Ord, Read, Show, Typeable)  -- | The 'Hint' type exports a well-typed interface to SDL's concept of--- <https://wiki.libsdl.org/CategoryHints hints>. This type has instances for+-- <https://wiki.libsdl.org/SDL2/CategoryHints hints>. This type has instances for -- both 'HasGetter' and 'HasSetter', allowing you to get and set hints. Note that -- the 'HasSetter' interface is fairly relaxed - if a hint cannot be set, the -- failure will be silently discarded. For more feedback and control when setting
src/SDL/Input/GameController.hs view
@@ -83,7 +83,7 @@  {- | Open a controller so that you can start receiving events from interaction with this controller. - See @<https://wiki.libsdl.org/SDL_GameControllerOpen SDL_GameControllerOpen>@ for C documentation.+ See @<https://wiki.libsdl.org/SDL2/SDL_GameControllerOpen SDL_GameControllerOpen>@ for C documentation. -} openController   :: (Functor m, MonadIO m)@@ -97,14 +97,14 @@  {- | Close a controller previously opened with 'openController'. - See @<https://wiki.libsdl.org/SDL_GameControllerClose SDL_GameControllerClose>@ for C documentation.+ See @<https://wiki.libsdl.org/SDL2/SDL_GameControllerClose SDL_GameControllerClose>@ for C documentation. -} closeController :: MonadIO m => GameController -> m () closeController (GameController j) = Raw.gameControllerClose j  {- | Check if a controller has been opened and is currently connected. - See @<https://wiki.libsdl.org/SDL_GameControllerGetAttached SDL_GameControllerGetAttached>@ for C documentation.+ See @<https://wiki.libsdl.org/SDL2/SDL_GameControllerGetAttached SDL_GameControllerGetAttached>@ for C documentation. -} controllerAttached :: MonadIO m => GameController -> m Bool controllerAttached (GameController c) = Raw.gameControllerGetAttached c@@ -112,7 +112,7 @@ {- | Get the instance ID of an opened controller. The instance ID is used to identify the controller  in future SDL events. - See @<https://wiki.libsdl.org/SDL_GameControllerInstanceID SDL_GameControllerInstanceID>@ for C documentation.+ See @<https://wiki.libsdl.org/SDL2/SDL_GameControllerInstanceID SDL_GameControllerInstanceID>@ for C documentation. -} getControllerID :: MonadIO m => GameController -> m Int32 getControllerID (GameController c) =@@ -121,7 +121,7 @@  {- | Get the current mapping of a Game Controller. - See @<https://wiki.libsdl.org/SDL_GameControllerMapping SDL_GameControllerMapping>@ for C documentation.+ See @<https://wiki.libsdl.org/SDL2/SDL_GameControllerMapping SDL_GameControllerMapping>@ for C documentation. -} controllerMapping :: MonadIO m => GameController -> m Text controllerMapping (GameController c) = liftIO $ do@@ -133,7 +133,7 @@ {- | Add support for controllers that SDL is unaware of or to cause an existing controller to  have a different binding. - See @<https://wiki.libsdl.org/SDL_GameControllerAddMapping SDL_GameControllerAddMapping>@ for C documentation.+ See @<https://wiki.libsdl.org/SDL2/SDL_GameControllerAddMapping SDL_GameControllerAddMapping>@ for C documentation. -} addControllerMapping :: MonadIO m => BS.ByteString -> m () addControllerMapping mapping =@@ -148,7 +148,7 @@  @<https://raw.githubusercontent.com/gabomdq/SDL_GameControllerDB/master/gamecontrollerdb.txt here>@  (on GitHub). - See @<https://wiki.libsdl.org/SDL_GameControllerAddMappingsFromFile SDL_GameControllerAddMappingsFromFile>@ for C documentation.+ See @<https://wiki.libsdl.org/SDL2/SDL_GameControllerAddMappingsFromFile SDL_GameControllerAddMappingsFromFile>@ for C documentation. -} addControllerMappingsFromFile :: MonadIO m => FilePath -> m () addControllerMappingsFromFile mappingFile =@@ -158,7 +158,7 @@  {- | Get the current state of an axis control on a game controller. - See @<https://wiki.libsdl.org/SDL_GameControllerGetAxis SDL_GameControllerGetAxis>@ for C documentation.+ See @<https://wiki.libsdl.org/SDL2/SDL_GameControllerGetAxis SDL_GameControllerGetAxis>@ for C documentation. -} controllerAxis :: MonadIO m => GameController -> ControllerAxis -> m Int16 controllerAxis (GameController c) axis =@@ -166,7 +166,7 @@  {- | Get the current state of a button on a game controller. - See @<https://wiki.libsdl.org/SDL_GameControllerGetButton SDL_GameControllerGetButton>@ for C documentation.+ See @<https://wiki.libsdl.org/SDL2/SDL_GameControllerGetButton SDL_GameControllerGetButton>@ for C documentation. -} controllerButton :: MonadIO m => GameController -> ControllerButton -> m ControllerButtonState controllerButton (GameController c) button =
src/SDL/Input/Joystick.hs view
@@ -71,7 +71,7 @@  -- | Count the number of joysticks attached to the system. ----- See @<https://wiki.libsdl.org/SDL_NumJoysticks SDL_NumJoysticks>@ for C documentation.+-- See @<https://wiki.libsdl.org/SDL2/SDL_NumJoysticks SDL_NumJoysticks>@ for C documentation. numJoysticks :: MonadIO m => m (CInt) numJoysticks = throwIfNeg "SDL.Input.Joystick.availableJoysticks" "SDL_NumJoysticks" Raw.numJoysticks @@ -89,7 +89,7 @@  -- | Open a joystick so that you can start receiving events from interaction with this joystick. ----- See @<https://wiki.libsdl.org/SDL_JoystickOpen SDL_JoystickOpen>@ for C documentation.+-- See @<https://wiki.libsdl.org/SDL2/SDL_JoystickOpen SDL_JoystickOpen>@ for C documentation. openJoystick :: (Functor m,MonadIO m)              => JoystickDevice -- ^ The device to open. Use 'availableJoysticks' to find 'JoystickDevices's              -> m Joystick@@ -100,14 +100,14 @@  -- | Close a joystick previously opened with 'openJoystick'. ----- See @<https://wiki.libsdl.org/SDL_JoystickClose SDL_JoystickClose>@ for C documentation.+-- See @<https://wiki.libsdl.org/SDL2/SDL_JoystickClose SDL_JoystickClose>@ for C documentation. closeJoystick :: MonadIO m => Joystick -> m () closeJoystick (Joystick j) = Raw.joystickClose j  -- | Get the instance ID of an opened joystick. The instance ID is used to identify the joystick -- in future SDL events. ----- See @<https://wiki.libsdl.org/SDL_JoystickInstanceID SDL_JoystickInstanceID>@ for C documentation.+-- See @<https://wiki.libsdl.org/SDL2/SDL_JoystickInstanceID SDL_JoystickInstanceID>@ for C documentation. getJoystickID :: MonadIO m => Joystick -> m Raw.JoystickID getJoystickID (Joystick j) =   throwIfNeg "SDL.Input.Joystick.getJoystickID" "SDL_JoystickInstanceID" $@@ -115,7 +115,7 @@  -- | Determine if a given button is currently held. ----- See @<https://wiki.libsdl.org/SDL_JoystickGetButton SDL_JoystickGetButton>@ for C documentation.+-- See @<https://wiki.libsdl.org/SDL2/SDL_JoystickGetButton SDL_JoystickGetButton>@ for C documentation. buttonPressed :: (Functor m, MonadIO m)               => Joystick               -> CInt -- ^ The index of the button. You can use 'numButtons' to determine how many buttons a given joystick has.@@ -124,7 +124,7 @@  -- | Get the ball axis change since the last poll. ----- See @<https://wiki.libsdl.org/SDL_JoystickGetBall SDL_JoystickGetBall>@ for C documentation.+-- See @<https://wiki.libsdl.org/SDL2/SDL_JoystickGetBall SDL_JoystickGetBall>@ for C documentation. ballDelta :: MonadIO m           => Joystick           -> CInt -- ^ The index of the joystick ball. You can use 'numBalls' to determine how many balls a given joystick has.@@ -145,25 +145,25 @@ -- -- Some joysticks use axes 2 and 3 for extra buttons. ----- See @<https://wiki.libsdl.org/SDL_JoystickGetAxis SDL_JoystickGetAxis>@ for C documentation.+-- See @<https://wiki.libsdl.org/SDL2/SDL_JoystickGetAxis SDL_JoystickGetAxis>@ for C documentation. axisPosition :: MonadIO m => Joystick -> CInt -> m Int16 axisPosition (Joystick j) axisIndex = Raw.joystickGetAxis j axisIndex  -- | Get the number of general axis controls on a joystick. ----- See @<https://wiki.libsdl.org/SDL_JoystickNumAxes SDL_JoystickNumAxes>@ for C documentation.+-- See @<https://wiki.libsdl.org/SDL2/SDL_JoystickNumAxes SDL_JoystickNumAxes>@ for C documentation. numAxes :: (MonadIO m) => Joystick -> m CInt numAxes (Joystick j) = liftIO $ throwIfNeg "SDL.Input.Joystick.numAxis" "SDL_JoystickNumAxes" (Raw.joystickNumAxes j)  -- | Get the number of buttons on a joystick. ----- See @<https://wiki.libsdl.org/SDL_JoystickNumButtons SDL_JoystickNumButtons>@ for C documentation.+-- See @<https://wiki.libsdl.org/SDL2/SDL_JoystickNumButtons SDL_JoystickNumButtons>@ for C documentation. numButtons :: (MonadIO m) => Joystick -> m CInt numButtons (Joystick j) = liftIO $ throwIfNeg "SDL.Input.Joystick.numButtons" "SDL_JoystickNumButtons" (Raw.joystickNumButtons j)  -- | Get the number of trackballs on a joystick. ----- See @<https://wiki.libsdl.org/SDL_JoystickNumBalls SDL_JoystickNumBalls>@ for C documentation.+-- See @<https://wiki.libsdl.org/SDL2/SDL_JoystickNumBalls SDL_JoystickNumBalls>@ for C documentation. numBalls :: (MonadIO m) => Joystick -> m CInt numBalls (Joystick j) = liftIO $ throwIfNeg "SDL.Input.Joystick.numBalls" "SDL_JoystickNumBalls" (Raw.joystickNumBalls j) @@ -195,7 +195,7 @@  -- | Get current position of a POV hat on a joystick. ----- See @<https://wiki.libsdl.org/SDL_JoystickGetHat SDL_JoystickGetHat>@ for C documentation.+-- See @<https://wiki.libsdl.org/SDL2/SDL_JoystickGetHat SDL_JoystickGetHat>@ for C documentation. getHat :: (Functor m, MonadIO m)        => Joystick        -> CInt -- ^ The index of the POV hat. You can use 'numHats' to determine how many POV hats a given joystick has.@@ -204,7 +204,7 @@  -- | Get the number of POV hats on a joystick. ----- See @<https://wiki.libsdl.org/https://wiki.libsdl.org/SDL_JoystickNumHats SDL_JoystickNumHats>@ for C documentation.+-- See @<https://wiki.libsdl.org/SDL2/SDL_JoystickNumHats SDL_JoystickNumHats>@ for C documentation. numHats :: (MonadIO m) => Joystick -> m CInt numHats (Joystick j) = liftIO $ throwIfNeg "SDL.Input.Joystick.numHats" "SDL_JoystickNumHats" (Raw.joystickNumHats j) 
src/SDL/Input/Keyboard.hs view
@@ -56,7 +56,7 @@  -- | Get the current key modifier state for the keyboard. The key modifier state is a mask special keys that are held down. ----- See @<https://wiki.libsdl.org/SDL_GetModState SDL_GetModState>@ for C documentation.+-- See @<https://wiki.libsdl.org/SDL2/SDL_GetModState SDL_GetModState>@ for C documentation. getModState :: (Functor m, MonadIO m) => m KeyModifier getModState = fromNumber <$> Raw.getModState @@ -108,7 +108,7 @@ -- | Set the rectangle used to type text inputs and start accepting text input -- events. ----- See @<https://wiki.libsdl.org/SDL_StartTextInput SDL_StartTextInput>@ for C documentation.+-- See @<https://wiki.libsdl.org/SDL2/SDL_StartTextInput SDL_StartTextInput>@ for C documentation. startTextInput :: MonadIO m => Raw.Rect -> m () startTextInput rect = liftIO $ do   alloca $ \ptr -> do@@ -118,25 +118,25 @@  -- | Stop receiving any text input events. ----- See @<https://wiki.libsdl.org/SDL_StopTextInput SDL_StopTextInput>@ for C documentation.+-- See @<https://wiki.libsdl.org/SDL2/SDL_StopTextInput SDL_StopTextInput>@ for C documentation. stopTextInput :: MonadIO m => m () stopTextInput = Raw.stopTextInput  -- | Check whether the platform has screen keyboard support. ----- See @<https://wiki.libsdl.org/SDL_HasScreenKeyboardSupport SDL_HasScreenKeyboardSupport>@ for C documentation.+-- See @<https://wiki.libsdl.org/SDL2/SDL_HasScreenKeyboardSupport SDL_HasScreenKeyboardSupport>@ for C documentation. hasScreenKeyboardSupport :: MonadIO m => m Bool hasScreenKeyboardSupport = Raw.hasScreenKeyboardSupport  -- | Check whether the screen keyboard is shown for the given window. ----- See @<https://wiki.libsdl.org/SDL_IsScreenKeyboardShown SDL_IsScreenKeyboardShown>@ for C documentation.+-- See @<https://wiki.libsdl.org/SDL2/SDL_IsScreenKeyboardShown SDL_IsScreenKeyboardShown>@ for C documentation. isScreenKeyboardShown :: MonadIO m => Window -> m Bool isScreenKeyboardShown (Window w) = Raw.isScreenKeyboardShown w  -- | Get a human-readable name for a scancode. If the scancode doesn't have a name this function returns the empty string. ----- See @<https://wiki.libsdl.org/SDL_GetScancodeName SDL_GetScancodeName>@ for C documentation.+-- See @<https://wiki.libsdl.org/SDL2/SDL_GetScancodeName SDL_GetScancodeName>@ for C documentation. getScancodeName :: MonadIO m => Scancode -> m String getScancodeName scancode = liftIO $ do   name <- Raw.getScancodeName $ toNumber scancode@@ -156,7 +156,7 @@ -- -- This computation generates a mapping from 'Scancode' to 'Bool' - evaluating the function at specific 'Scancode's will inform you as to whether or not that key was held down when 'getKeyboardState' was called. ----- See @<https://wiki.libsdl.org/SDL_GetKeyboardState SDL_GetKeyboardState>@ for C documentation.+-- See @<https://wiki.libsdl.org/SDL2/SDL_GetKeyboardState SDL_GetKeyboardState>@ for C documentation. getKeyboardState :: MonadIO m => m (Scancode -> Bool) getKeyboardState = liftIO $ do   alloca $ \nkeys -> do
src/SDL/Input/Keyboard/Codes.hs view
@@ -1,9 +1,12 @@+{-# LANGUAGE CPP #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE PatternSynonyms #-} +#if MIN_VERSION_base(4,11,0) {-# OPTIONS_GHC -fno-warn-missing-pattern-synonym-signatures #-}+#endif {-# OPTIONS_GHC -fno-warn-missing-signatures #-}  {-|
src/SDL/Input/Mouse.hs view
@@ -68,6 +68,10 @@ import Control.Applicative #endif +#if !MIN_VERSION_base(4,11,0)+import Data.Monoid ((<>))+#endif+ data LocationMode   = AbsoluteLocation   | RelativeLocation@@ -173,7 +177,7 @@ -- -- This 'StateVar' can be modified using '$=' and the current value retrieved with 'get'. ----- See @<https://wiki.libsdl.org/SDL_ShowCursor SDL_ShowCursor>@ and @<https://wiki.libsdl.org/SDL_HideCursor SDL_HideCursor>@ for C documentation.+-- See @<https://wiki.libsdl.org/SDL2/SDL_ShowCursor SDL_ShowCursor>@ and @<https://wiki.libsdl.org/SDL2/SDL_HideCursor SDL_HideCursor>@ for C documentation. cursorVisible :: StateVar Bool cursorVisible = makeStateVar getCursorVisible setCursorVisible   where@@ -245,7 +249,7 @@ -- -- This 'StateVar' can be modified using '$=' and the current value retrieved with 'get'. ----- See @<https://wiki.libsdl.org/SDL_SetCursor SDL_SetCursor>@ and @<https://wiki.libsdl.org/SDL_GetCursor SDL_GetCursor>@ for C documentation.+-- See @<https://wiki.libsdl.org/SDL2/SDL_SetCursor SDL_SetCursor>@ and @<https://wiki.libsdl.org/SDL2/SDL_GetCursor SDL_GetCursor>@ for C documentation. activeCursor :: StateVar Cursor activeCursor = makeStateVar getCursor setCursor   where@@ -341,13 +345,13 @@  -- | Free a cursor created with 'createCursor', 'createColorCusor' and 'createSystemCursor'. ----- See @<https://wiki.libsdl.org/SDL_FreeCursor SDL_FreeCursor>@ for C documentation.+-- See @<https://wiki.libsdl.org/SDL2/SDL_FreeCursor SDL_FreeCursor>@ for C documentation. freeCursor :: MonadIO m => Cursor -> m () freeCursor = Raw.freeCursor . unwrapCursor  -- | Create a color cursor. ----- See @<https://wiki.libsdl.org/SDL_CreateColorCursor SDL_CreateColorCursor>@ for C documentation.+-- See @<https://wiki.libsdl.org/SDL2/SDL_CreateColorCursor SDL_CreateColorCursor>@ for C documentation. createColorCursor :: MonadIO m                   => Surface                   -> Point V2 CInt -- ^ The location of the cursor hot spot@@ -359,7 +363,7 @@  -- | Create system cursor. ----- See @<https://wiki.libsdl.org/SDL_CreateSystemCursor SDL_CreateSystemCursor>@ for C documentation.+-- See @<https://wiki.libsdl.org/SDL2/SDL_CreateSystemCursor SDL_CreateSystemCursor>@ for C documentation. createSystemCursor :: MonadIO m => SystemCursor -> m Cursor createSystemCursor sc =     liftIO . fmap Cursor $
src/SDL/Power.hs view
@@ -27,7 +27,7 @@ -- -- Throws 'SDLException' if the current power state can not be determined. ----- See @<https://wiki.libsdl.org/SDL_GetPowerInfo SDL_GetPowerInfo>@ for C documentation.+-- See @<https://wiki.libsdl.org/SDL2/SDL_GetPowerInfo SDL_GetPowerInfo>@ for C documentation. getPowerInfo :: (Functor m, MonadIO m) => m PowerState getPowerInfo =   liftIO $
src/SDL/Raw/Enum.hsc view
@@ -1,7 +1,10 @@+{-# LANGUAGE CPP #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE PatternSynonyms #-} +#if MIN_VERSION_base(4,11,0) {-# OPTIONS_GHC -fno-warn-missing-pattern-synonym-signatures #-}+#endif {-# OPTIONS_GHC -fno-warn-missing-signatures #-}  module SDL.Raw.Enum (
src/SDL/Raw/Timer.hs view
@@ -1,3 +1,5 @@+{-# LANGUAGE CPP #-}+ module SDL.Raw.Timer (   -- * Timer Support   addTimer,@@ -6,6 +8,10 @@   getPerformanceFrequency,   getTicks,   removeTimer++#ifdef RECENT_ISH+  , getTicks64+#endif ) where  import Control.Monad.IO.Class@@ -21,6 +27,10 @@ foreign import ccall "SDL.h SDL_GetTicks" getTicksFFI :: IO Word32 foreign import ccall "SDL.h SDL_RemoveTimer" removeTimerFFI :: TimerID -> IO Bool +#ifdef RECENT_ISH+foreign import ccall "SDL.h SDL_GetTicks64" getTicks64FFI :: IO Word64+#endif+ addTimer :: MonadIO m => Word32 -> TimerCallback -> Ptr () -> m TimerID addTimer v1 v2 v3 = liftIO $ addTimerFFI v1 v2 v3 {-# INLINE addTimer #-}@@ -44,3 +54,9 @@ removeTimer :: MonadIO m => TimerID -> m Bool removeTimer v1 = liftIO $ removeTimerFFI v1 {-# INLINE removeTimer #-}++#ifdef RECENT_ISH+getTicks64 :: MonadIO m => m Word64+getTicks64 = liftIO getTicks64FFI+{-# INLINE getTicks64 #-}+#endif
src/SDL/Raw/Video.hs view
@@ -134,6 +134,7 @@   renderGeometryRaw, #endif   renderGetClipRect,+  renderGetIntegerScale,   renderGetLogicalSize,   renderGetScale,   renderGetViewport,@@ -141,6 +142,7 @@   renderPresent,   renderReadPixels,   renderSetClipRect,+  renderSetIntegerScale,   renderSetLogicalSize,   renderSetScale,   renderSetViewport,@@ -367,6 +369,7 @@ foreign import ccall "sqlhelper.c SDLHelper_RenderFillRectEx" renderFillRectExFFI :: Renderer -> CInt -> CInt -> CInt -> CInt -> IO CInt foreign import ccall "SDL.h SDL_RenderFillRects" renderFillRectsFFI :: Renderer -> Ptr Rect -> CInt -> IO CInt foreign import ccall "SDL.h SDL_RenderGetClipRect" renderGetClipRectFFI :: Renderer -> Ptr Rect -> IO ()+foreign import ccall "SDL.h SDL_RenderGetIntegerScale" renderGetIntegerScaleFFI :: Renderer -> IO CInt foreign import ccall "SDL.h SDL_RenderGetLogicalSize" renderGetLogicalSizeFFI :: Renderer -> Ptr CInt -> Ptr CInt -> IO () foreign import ccall "SDL.h SDL_RenderGetScale" renderGetScaleFFI :: Renderer -> Ptr CFloat -> Ptr CFloat -> IO () foreign import ccall "SDL.h SDL_RenderGetViewport" renderGetViewportFFI :: Renderer -> Ptr Rect -> IO ()@@ -374,6 +377,7 @@ foreign import ccall "SDL.h SDL_RenderPresent" renderPresentFFI :: Renderer -> IO () foreign import ccall "SDL.h SDL_RenderReadPixels" renderReadPixelsFFI :: Renderer -> Ptr Rect -> Word32 -> Ptr () -> CInt -> IO CInt foreign import ccall "SDL.h SDL_RenderSetClipRect" renderSetClipRectFFI :: Renderer -> Ptr Rect -> IO CInt+foreign import ccall "SDL.h SDL_RenderSetIntegerScale" renderSetIntegerScaleFFI :: Renderer -> CInt -> IO CInt foreign import ccall "SDL.h SDL_RenderSetLogicalSize" renderSetLogicalSizeFFI :: Renderer -> CInt -> CInt -> IO CInt foreign import ccall "SDL.h SDL_RenderSetScale" renderSetScaleFFI :: Renderer -> CFloat -> CFloat -> IO CInt foreign import ccall "SDL.h SDL_RenderSetViewport" renderSetViewportFFI :: Renderer -> Ptr Rect -> IO CInt@@ -967,6 +971,10 @@ renderGetClipRect v1 v2 = liftIO $ renderGetClipRectFFI v1 v2 {-# INLINE renderGetClipRect #-} +renderGetIntegerScale :: MonadIO m => Renderer -> m CInt+renderGetIntegerScale v1 = liftIO $ renderGetIntegerScaleFFI v1+{-# INLINE renderGetIntegerScale #-}+ renderGetLogicalSize :: MonadIO m => Renderer -> Ptr CInt -> Ptr CInt -> m () renderGetLogicalSize v1 v2 v3 = liftIO $ renderGetLogicalSizeFFI v1 v2 v3 {-# INLINE renderGetLogicalSize #-}@@ -994,6 +1002,10 @@ renderSetClipRect :: MonadIO m => Renderer -> Ptr Rect -> m CInt renderSetClipRect v1 v2 = liftIO $ renderSetClipRectFFI v1 v2 {-# INLINE renderSetClipRect #-}++renderSetIntegerScale :: MonadIO m => Renderer -> CInt -> m CInt+renderSetIntegerScale v1 v2 = liftIO $ renderSetIntegerScaleFFI v1 v2+{-# INLINE renderSetIntegerScale #-}  renderSetLogicalSize :: MonadIO m => Renderer -> CInt -> CInt -> m CInt renderSetLogicalSize v1 v2 v3 = liftIO $ renderSetLogicalSizeFFI v1 v2 v3
src/SDL/Time.hs view
@@ -1,6 +1,8 @@+{-# LANGUAGE CPP                #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE CPP #-} module SDL.Time   ( -- * Time Measurement     ticks@@ -13,6 +15,10 @@   , RetriggerTimer(..)   , addTimer   , removeTimer++#ifdef RECENT_ISH+  , ticks64+#endif   ) where  import Control.Monad.IO.Class (MonadIO, liftIO)@@ -29,13 +35,13 @@  -- | Number of milliseconds since library initialization. ----- See @<https://wiki.libsdl.org/SDL_GetTicks SDL_GetTicks>@ for C documentation.+-- See @<https://wiki.libsdl.org/SDL2/SDL_GetTicks SDL_GetTicks>@ for C documentation. ticks :: MonadIO m => m Word32 ticks = Raw.getTicks  -- | The current time in seconds since some arbitrary starting point (consist over the life of the application). ----- This time is derived from the system's performance counter - see @<https://wiki.libsdl.org/SDL_GetPerformanceFrequency SDL_GetPerformanceFrequency>@ and @<https://wiki.libsdl.org/SDL_GetPerformanceCounter SDL_GetPerformanceCounter>@ for C documentation about the implementation.+-- This time is derived from the system's performance counter - see @<https://wiki.libsdl.org/SDL2/SDL_GetPerformanceFrequency SDL_GetPerformanceFrequency>@ and @<https://wiki.libsdl.org/SDL2/SDL_GetPerformanceCounter SDL_GetPerformanceCounter>@ for C documentation about the implementation. time :: (Fractional a, MonadIO m) => m a time = do   freq <- Raw.getPerformanceFrequency@@ -46,7 +52,7 @@ -- -- Users are generally recommended to use 'threadDelay' instead, to take advantage of the abilities of the Haskell runtime. ----- See @<https://wiki.libsdl.org/SDL_Delay SDL_Delay>@ for C documentation.+-- See @<https://wiki.libsdl.org/SDL2/SDL_Delay SDL_Delay>@ for C documentation. delay :: MonadIO m => Word32 -> m () delay = Raw.delay @@ -67,7 +73,7 @@  -- | Set up a callback function to be run on a separate thread after the specified number of milliseconds has elapsed. ----- See @<https://wiki.libsdl.org/SDL_AddTimer SDL_AddTimer>@ for C documentation.+-- See @<https://wiki.libsdl.org/SDL2/SDL_AddTimer SDL_AddTimer>@ for C documentation. addTimer :: MonadIO m => Word32 -> TimerCallback -> m Timer addTimer timeout callback = liftIO $ do     cb <- Raw.mkTimerCallback wrappedCb@@ -90,6 +96,14 @@  -- | Remove a 'Timer'. ----- See @<https://wiki.libsdl.org/SDL_RemoveTimer SDL_RemoveTimer>@ for C documentation.+-- See @<https://wiki.libsdl.org/SDL2/SDL_RemoveTimer SDL_RemoveTimer>@ for C documentation. removeTimer :: MonadIO m => Timer -> m Bool removeTimer f = liftIO $ runTimerRemoval f++#ifdef RECENT_ISH+-- | Number of milliseconds since library initialization.+--+-- See @<https://wiki.libsdl.org/SDL2/SDL_GetTicks64 SDL_GetTicks64>@ for C documentation.+ticks64 :: MonadIO m => m Word64+ticks64 = Raw.getTicks64+#endif
src/SDL/Video.hs view
@@ -321,7 +321,7 @@  -- | Get the size of a window's borders (decorations) around the client area (top, left, bottom, right). ----- See @<https://wiki.libsdl.org/SDL_GetWindowBordersSize SDL_GetWindowBordersSize>@ for C documentation.+-- See @<https://wiki.libsdl.org/SDL2/SDL_GetWindowBordersSize SDL_GetWindowBordersSize>@ for C documentation. getWindowBordersSize :: MonadIO m => Window -> m (Maybe (V4 CInt)) getWindowBordersSize (Window win) =   liftIO $@@ -341,7 +341,7 @@ -- -- This 'StateVar' can be modified using '$=' and the current value retrieved with 'get'. ----- See @<https://wiki.libsdl.org/SDL_SetWindowSize SDL_SetWindowSize>@ and @<https://wiki.libsdl.org/SDL_GetWindowSize SDL_GetWindowSize>@ for C documentation.+-- See @<https://wiki.libsdl.org/SDL2/SDL_SetWindowSize SDL_SetWindowSize>@ and @<https://wiki.libsdl.org/SDL2/SDL_GetWindowSize SDL_GetWindowSize>@ for C documentation. windowSize :: Window -> StateVar (V2 CInt) windowSize (Window win) = makeStateVar getWindowSize setWindowSize   where@@ -358,7 +358,7 @@ -- -- This 'StateVar' can be modified using '$=' and the current value retrieved with 'get'. ----- See @<https://wiki.libsdl.org/SDL_SetWindowTitle SDL_SetWindowTitle>@ and @<https://wiki.libsdl.org/SDL_GetWindowTitle SDL_GetWindowTitle>@ for C documentation.+-- See @<https://wiki.libsdl.org/SDL2/SDL_SetWindowTitle SDL_SetWindowTitle>@ and @<https://wiki.libsdl.org/SDL2/SDL_GetWindowTitle SDL_GetWindowTitle>@ for C documentation. windowTitle :: Window -> StateVar Text windowTitle (Window w) = makeStateVar getWindowTitle setWindowTitle   where@@ -432,13 +432,13 @@  -- | Hide a window. ----- See @<https://wiki.libsdl.org/SDL_HideWindow SDL_HideWindow>@ for C documentation.+-- See @<https://wiki.libsdl.org/SDL2/SDL_HideWindow SDL_HideWindow>@ for C documentation. hideWindow :: MonadIO m => Window -> m () hideWindow (Window w) = Raw.hideWindow w  -- | Raise the window above other windows and set the input focus. ----- See @<https://wiki.libsdl.org/SDL_RaiseWindow SDL_RaiseWindow>@ for C documentation.+-- See @<https://wiki.libsdl.org/SDL2/SDL_RaiseWindow SDL_RaiseWindow>@ for C documentation. raiseWindow :: MonadIO m => Window -> m () raiseWindow (Window w) = Raw.raiseWindow w @@ -455,7 +455,7 @@  -- | Show a window. ----- See @<https://wiki.libsdl.org/SDL_ShowWindow SDL_ShowWindow>@ for C documentation.+-- See @<https://wiki.libsdl.org/SDL2/SDL_ShowWindow SDL_ShowWindow>@ for C documentation. showWindow :: MonadIO m => Window -> m () showWindow (Window w) = Raw.showWindow w @@ -582,7 +582,7 @@ -- -- This 'StateVar' can be modified using '$=' and the current value retrieved with 'get'. ----- See @<https://wiki.libsdl.org/SDL_SetWindowMaximumSize SDL_SetWindowMaximumSize>@ and @<https://wiki.libsdl.org/SDL_GetWindowMaximumSize SDL_GetWindowMaximumSize>@ for C documentation.+-- See @<https://wiki.libsdl.org/SDL2/SDL_SetWindowMaximumSize SDL_SetWindowMaximumSize>@ and @<https://wiki.libsdl.org/SDL2/SDL_GetWindowMaximumSize SDL_GetWindowMaximumSize>@ for C documentation. windowMaximumSize :: Window -> StateVar (V2 CInt) windowMaximumSize (Window win) = makeStateVar getWindowMaximumSize setWindowMaximumSize   where@@ -599,7 +599,7 @@ -- -- This 'StateVar' can be modified using '$=' and the current value retrieved with 'get'. ----- See @<https://wiki.libsdl.org/SDL_SetWindowMinimumSize SDL_SetWindowMinimumSize>@ and @<https://wiki.libsdl.org/SDL_GetWindowMinimumSize SDL_GetWindowMinimumSize>@ for C documentation.+-- See @<https://wiki.libsdl.org/SDL2/SDL_SetWindowMinimumSize SDL_SetWindowMinimumSize>@ and @<https://wiki.libsdl.org/SDL2/SDL_GetWindowMinimumSize SDL_GetWindowMinimumSize>@ for C documentation. windowMinimumSize :: Window -> StateVar (V2 CInt) windowMinimumSize (Window win) = makeStateVar getWindowMinimumSize setWindowMinimumSize   where@@ -616,7 +616,7 @@ -- -- This 'StateVar' can be modified using '$=' and the current value retrieved with 'get'. ----- See @<https://wiki.libsdl.org/SDL_SetWindowOpacity SDL_SetWindowOpacity>@ and @<https://wiki.libsdl.org/SDL_GetWindowOpacity SDL_GetWindowOpacity>@ for C documentation.+-- See @<https://wiki.libsdl.org/SDL2/SDL_SetWindowOpacity SDL_SetWindowOpacity>@ and @<https://wiki.libsdl.org/SDL2/SDL_GetWindowOpacity SDL_GetWindowOpacity>@ for C documentation. windowOpacity :: Window -> StateVar CFloat windowOpacity (Window win) = makeStateVar getWindowOpacity setWindowOpacity   where@@ -636,7 +636,7 @@  -- | Create a 2D software rendering context for the given surface. ----- See @<https://wiki.libsdl.org/SDL_CreateSoftwareRenderer>@+-- See @<https://wiki.libsdl.org/SDL2/SDL_CreateSoftwareRenderer>@ createSoftwareRenderer :: MonadIO m => Surface -> m Renderer createSoftwareRenderer (Surface ptr _) =   liftIO . fmap Renderer $
src/SDL/Video/OpenGL.hs view
@@ -103,7 +103,7 @@ -- Throws 'SDLException' if the window wasn't configured with OpenGL -- support, or if context creation fails. ----- See @<https://wiki.libsdl.org/SDL_GL_CreateContext SDL_GL_CreateContext>@ for C documentation.+-- See @<https://wiki.libsdl.org/SDL2/SDL_GL_CreateContext SDL_GL_CreateContext>@ for C documentation. glCreateContext :: (Functor m, MonadIO m) => Window -> m GLContext glCreateContext (Window w) =   GLContext <$> throwIfNull "SDL.Video.glCreateContext" "SDL_GL_CreateContext"@@ -113,7 +113,7 @@ -- -- Throws 'SDLException' on failure. ----- See @<https://wiki.libsdl.org/SDL_GL_MakeCurrent SDL_GL_MakeCurrent>@ for C documentation.+-- See @<https://wiki.libsdl.org/SDL2/SDL_GL_MakeCurrent SDL_GL_MakeCurrent>@ for C documentation. glMakeCurrent :: (Functor m, MonadIO m) => Window -> GLContext -> m () glMakeCurrent (Window w) (GLContext ctx) =   throwIfNeg_ "SDL.Video.OpenGL.glMakeCurrent" "SDL_GL_MakeCurrent" $@@ -128,7 +128,7 @@ -- The @glFinish@ command will block until the command queue has been fully -- processed. You should call that function before deleting a context. ----- See @<https://wiki.libsdl.org/SDL_GL_DeleteContext SDL_GL_DeleteContext>@ for C documentation.+-- See @<https://wiki.libsdl.org/SDL2/SDL_GL_DeleteContext SDL_GL_DeleteContext>@ for C documentation. glDeleteContext :: MonadIO m => GLContext -> m () glDeleteContext (GLContext ctx) = Raw.glDeleteContext ctx @@ -136,7 +136,7 @@ -- contents of the back buffer are undefined, clear them with @glClear@ or -- equivalent before drawing to them again. ----- See @<https://wiki.libsdl.org/SDL_GL_SwapWindow SDL_GL_SwapWindow>@ for C documentation.+-- See @<https://wiki.libsdl.org/SDL2/SDL_GL_SwapWindow SDL_GL_SwapWindow>@ for C documentation. glSwapWindow :: MonadIO m => Window -> m () glSwapWindow (Window w) = Raw.glSwapWindow w @@ -167,7 +167,7 @@ -- -- This 'StateVar' can be modified using '$=' and the current value retrieved with 'get'. ----- See @<https://wiki.libsdl.org/SDL_GL_SetSwapInterval SDL_GL_SetSwapInterval>@ and @<https://wiki.libsdl.org/SDL_GL_GetSwapInterval SDL_GL_GetSwapInterval>@ for C documentation.+-- See @<https://wiki.libsdl.org/SDL2/SDL_GL_SetSwapInterval SDL_GL_SetSwapInterval>@ and @<https://wiki.libsdl.org/SDL2/SDL_GL_GetSwapInterval SDL_GL_GetSwapInterval>@ for C documentation. swapInterval :: StateVar SwapInterval swapInterval = makeStateVar glGetSwapInterval glSetSwapInterval   where
src/SDL/Video/Renderer.hs view
@@ -7,6 +7,7 @@ {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE PatternSynonyms #-}+{-# LANGUAGE TypeFamilies #-}  -- | "SDL.Video.Renderer" provides a high-level interface to SDL's accelerated 2D rendering library. @@ -55,6 +56,7 @@   , rendererDrawColor   , rendererRenderTarget   , rendererClipRect+  , rendererIntegerScale   , rendererLogicalSize   , rendererScale   , rendererViewport@@ -133,6 +135,7 @@   , getRenderDriverInfo   ) where +import Control.Monad (void) import Control.Monad.IO.Class (MonadIO, liftIO) import Data.Bits import Data.Data (Data)@@ -157,8 +160,11 @@ import qualified Data.ByteString as BS import qualified Data.ByteString.Internal as BSI import qualified Data.Text.Encoding as Text+import qualified Data.Vector.Generic.Base as GV+import qualified Data.Vector.Generic.Mutable.Base as GMV import qualified Data.Vector.Storable as SV import qualified Data.Vector.Storable.Mutable as MSV+import qualified Data.Vector.Unboxed.Base as UV import qualified SDL.Raw as Raw  #if !MIN_VERSION_base(4,8,0)@@ -168,7 +174,7 @@  -- | Perform a fast surface copy to a destination surface. ----- See @<https://wiki.libsdl.org/SDL_BlitSurface SDL_BlitSurface>@ for C documentation.+-- See @<https://wiki.libsdl.org/SDL2/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@@ -184,7 +190,7 @@  -- | Create a texture for a rendering context. ----- See @<https://wiki.libsdl.org/SDL_CreateTexture SDL_CreateTexture>@ for C documentation.+-- See @<https://wiki.libsdl.org/SDL2/SDL_CreateTexture SDL_CreateTexture>@ for C documentation. createTexture :: (Functor m,MonadIO m)               => Renderer -- ^ The rendering context.               -> PixelFormat@@ -198,7 +204,7 @@  -- | Create a texture from an existing surface. ----- See @<https://wiki.libsdl.org/SDL_CreateTextureFromSurface SDL_CreateTextureFromSurface>@ for C documentation.+-- See @<https://wiki.libsdl.org/SDL2/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@@ -210,7 +216,7 @@  -- | 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.+-- See @<https://wiki.libsdl.org/SDL2/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 ()@@ -220,7 +226,7 @@  -- | Unbind an OpenGL\/ES\/ES2 texture from the current context. ----- See @<https://wiki.libsdl.org/SDL_GL_UnbindTexture SDL_GL_UnbindTexture>@ for C documentation.+-- See @<https://wiki.libsdl.org/SDL2/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 ()@@ -230,7 +236,7 @@  -- | Updates texture rectangle with new pixel data. ----- See @<https://wiki.libsdl.org/SDL_UpdateTexture SDL_UpdateTexture>@ for C documentation.+-- See @<https://wiki.libsdl.org/SDL2/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@@ -246,13 +252,13 @@  -- | Destroy the specified texture. ----- See @<https://wiki.libsdl.org/SDL_DestroyTexture SDL_DestroyTexture>@ for the C documentation.+-- See @<https://wiki.libsdl.org/SDL2/SDL_DestroyTexture SDL_DestroyTexture>@ for the C documentation. destroyTexture :: MonadIO m => Texture -> m () destroyTexture (Texture t) = Raw.destroyTexture t  -- | Lock a portion of the texture for *write-only* pixel access. ----- See @<https://wiki.libsdl.org/SDL_LockTexture SDL_LockTexture>@ for C documentation.+-- See @<https://wiki.libsdl.org/SDL2/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@@ -271,13 +277,13 @@ -- -- /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.+-- See @<https://wiki.libsdl.org/SDL2/SDL_UnlockTexture SDL_UnlockTexture>@ for C documentation. unlockTexture :: MonadIO m => Texture -> m () unlockTexture (Texture t) = Raw.unlockTexture t  -- | Set up a surface for directly accessing the pixels. ----- See @<https://wiki.libsdl.org/SDL_LockSurface SDL_LockSurface>@ for C documentation.+-- See @<https://wiki.libsdl.org/SDL2/SDL_LockSurface SDL_LockSurface>@ for C documentation. lockSurface :: MonadIO m => Surface -> m () lockSurface (Surface s _) =   throwIfNeg_ "lockSurface" "SDL_LockSurface" $@@ -285,7 +291,7 @@  -- | Release a surface after directly accessing the pixels. ----- See @<https://wiki.libsdl.org/SDL_UnlockSurface SDL_UnlockSurface>@ for C documentation.+-- See @<https://wiki.libsdl.org/SDL2/SDL_UnlockSurface SDL_UnlockSurface>@ for C documentation. unlockSurface :: MonadIO m => Surface -> m () unlockSurface (Surface s _) = Raw.unlockSurface s @@ -325,7 +331,7 @@  -- | Query the attributes of a texture. ----- See @<https://wiki.libsdl.org/SDL_QueryTexture SDL_QueryTexture>@ for C documentation.+-- See @<https://wiki.libsdl.org/SDL2/SDL_QueryTexture SDL_QueryTexture>@ for C documentation. queryTexture :: MonadIO m => Texture -> m TextureInfo queryTexture (Texture tex) = liftIO $   alloca $ \pfPtr ->@@ -342,7 +348,7 @@  -- | Allocate a new RGB surface. ----- See @<https://wiki.libsdl.org/SDL_CreateRGBSurface SDL_CreateRGBSurface>@ for C documentation.+-- See @<https://wiki.libsdl.org/SDL2/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@@ -355,7 +361,7 @@  -- | Allocate a new RGB surface with existing pixel data. ----- See @<https://wiki.libsdl.org/SDL_CreateRGBSurfaceFrom SDL_CreateRGBSurfaceFrom>@ for C documentation.+-- See @<https://wiki.libsdl.org/SDL2/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@@ -373,7 +379,7 @@ -- -- 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.+-- See @<https://wiki.libsdl.org/SDL2/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.@@ -389,7 +395,7 @@ -- -- 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.+-- See @<https://wiki.libsdl.org/SDL2/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.@@ -408,13 +414,13 @@ -- -- 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.+-- See @<https://wiki.libsdl.org/SDL2/SDL_FreeSurface SDL_FreeSurface>@ for the C documentation. freeSurface :: MonadIO m => Surface -> m () freeSurface (Surface s _) = Raw.freeSurface s  -- | Load a surface from a BMP file. ----- See @<https://wiki.libsdl.org/SDL_LoadBMP SDL_LoadBMP>@ for C documentation.+-- See @<https://wiki.libsdl.org/SDL2/SDL_LoadBMP SDL_LoadBMP>@ for C documentation. loadBMP :: MonadIO m => FilePath -> m Surface loadBMP filePath = liftIO $   fmap unmanagedSurface $@@ -475,7 +481,7 @@  -- | Set a range of colors in a palette. ----- See @<https://wiki.libsdl.org/SDL_SetPaletteColors SDL_SetPaletteColors>@ for C documentation.+-- See @<https://wiki.libsdl.org/SDL2/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@@ -490,7 +496,7 @@  -- | Get the SDL surface associated with the window. ----- See @<https://wiki.libsdl.org/SDL_GetWindowSurface SDL_GetWindowSurface>@ for C documentation.+-- See @<https://wiki.libsdl.org/SDL2/SDL_GetWindowSurface SDL_GetWindowSurface>@ for C documentation. getWindowSurface :: (Functor m, MonadIO m) => Window -> m Surface getWindowSurface (Window w) =   fmap unmanagedSurface $@@ -501,11 +507,11 @@ -- -- 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.+-- See @<https://wiki.libsdl.org/SDL2/SDL_SetRenderDrawBlendMode SDL_SetRenderDrawBlendMode>@ and @<https://wiki.libsdl.org/SDL2/SDL_GetRenderDrawBlendMode SDL_GetRenderDrawBlendMode>@ for C documentation. rendererDrawBlendMode :: Renderer -> StateVar BlendMode rendererDrawBlendMode (Renderer r) = makeStateVar getRenderDrawBlendMode setRenderDrawBlendMode   where-  getRenderDrawBlendMode = liftIO $+  getRenderDrawBlendMode =     alloca $ \bmPtr -> do       throwIfNeg_ "SDL.Video.Renderer.getRenderDrawBlendMode" "SDL_GetRenderDrawBlendMode" $         Raw.getRenderDrawBlendMode r bmPtr@@ -519,11 +525,11 @@ -- -- 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.+-- See @<https://wiki.libsdl.org/SDL2/SDL_SetRenderDrawColor SDL_SetRenderDrawColor>@ and @<https://wiki.libsdl.org/SDL2/SDL_GetRenderDrawColor SDL_GetRenderDrawColor>@ for C documentation. rendererDrawColor :: Renderer -> StateVar (V4 Word8) rendererDrawColor (Renderer re) = makeStateVar getRenderDrawColor setRenderDrawColor   where-  getRenderDrawColor = liftIO $+  getRenderDrawColor =     alloca $ \r ->     alloca $ \g ->     alloca $ \b ->@@ -540,7 +546,7 @@ -- -- 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.+-- See @<https://wiki.libsdl.org/SDL2/SDL_UpdateWindowSurface SDL_UpdateWindowSurface>@ for C documentation. updateWindowSurface :: (Functor m, MonadIO m) => Window -> m () updateWindowSurface (Window w) =   throwIfNeg_ "SDL.Video.updateWindowSurface" "SDL_UpdateWindowSurface" $@@ -601,6 +607,41 @@     poke (castPtr ptr) o     poke (castPtr (ptr `plusPtr` sizeOf o)) s +newtype instance MVector s (Rectangle a) = MV_Rectangle (MVector s (Point V2 a, V2 a))+newtype instance Vector (Rectangle a) = V_Rectangle (Vector (Point V2 a, V2 a))++instance UV.Unbox a => GMV.MVector MVector (Rectangle a) where+  {-# INLINE basicLength #-}+  {-# INLINE basicUnsafeSlice #-}+  {-# INLINE basicOverlaps #-}+  {-# INLINE basicUnsafeNew #-}+  {-# INLINE basicUnsafeRead #-}+  {-# INLINE basicUnsafeWrite #-}+  basicLength (MV_Rectangle v) = GMV.basicLength v+  basicUnsafeSlice m n (MV_Rectangle v) = MV_Rectangle (GMV.basicUnsafeSlice m n v)+  basicOverlaps (MV_Rectangle v) (MV_Rectangle u) = GMV.basicOverlaps v u+  basicUnsafeNew n = MV_Rectangle <$> GMV.basicUnsafeNew n+  basicUnsafeRead (MV_Rectangle v) i = uncurry Rectangle <$> GMV.basicUnsafeRead v i+  basicUnsafeWrite (MV_Rectangle v) i (Rectangle p e) = GMV.basicUnsafeWrite v i (p, e)+#if MIN_VERSION_vector(0,11,0)+  {-# INLINE basicInitialize #-}+  basicInitialize (MV_Rectangle v) = GMV.basicInitialize v+#endif++instance UV.Unbox a => GV.Vector Vector (Rectangle a) where+  {-# INLINE basicUnsafeFreeze #-}+  {-# INLINE basicUnsafeThaw   #-}+  {-# INLINE basicLength       #-}+  {-# INLINE basicUnsafeSlice  #-}+  {-# INLINE basicUnsafeIndexM #-}+  basicUnsafeFreeze (MV_Rectangle v) = V_Rectangle <$> GV.basicUnsafeFreeze v+  basicUnsafeThaw (V_Rectangle v) = MV_Rectangle <$> GV.basicUnsafeThaw v+  basicLength (V_Rectangle v) = GV.basicLength v+  basicUnsafeSlice m n (V_Rectangle v) = V_Rectangle (GV.basicUnsafeSlice m n v)+  basicUnsafeIndexM (V_Rectangle v) i = uncurry Rectangle <$> GV.basicUnsafeIndexM v i++instance UV.Unbox a => UV.Unbox (Rectangle a)+ data Surface = Surface (Ptr Raw.Surface) (Maybe (MSV.IOVector Word8))   deriving (Typeable) @@ -615,7 +656,7 @@  -- | Draw a rectangle outline on the current rendering target. ----- See @<https://wiki.libsdl.org/SDL_RenderDrawRect SDL_RenderDrawRect>@ for C documentation.+-- See @<https://wiki.libsdl.org/SDL2/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.@@ -626,7 +667,7 @@  -- | Draw some number of rectangles on the current rendering target. ----- See @<https://wiki.libsdl.org/SDL_RenderDrawRects SDL_RenderDrawRects>@ for C documentation.+-- See @<https://wiki.libsdl.org/SDL2/SDL_RenderDrawRects SDL_RenderDrawRects>@ for C documentation. drawRects :: MonadIO m => Renderer -> SV.Vector (Rectangle CInt) -> m () drawRects (Renderer r) rects = liftIO $   throwIfNeg_ "SDL.Video.drawRects" "SDL_RenderDrawRects" $@@ -637,7 +678,7 @@  -- | Fill a rectangle on the current rendering target with the drawing color. ----- See @<https://wiki.libsdl.org/SDL_RenderFillRect SDL_RenderFillRect>@ for C documentation.+-- See @<https://wiki.libsdl.org/SDL2/SDL_RenderFillRect SDL_RenderFillRect>@ for C documentation. fillRect ::      MonadIO m   => Renderer@@ -653,7 +694,7 @@  -- | 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.+-- See @<https://wiki.libsdl.org/SDL2/SDL_RenderFillRects SDL_RenderFillRects>@ for C documentation. fillRects :: MonadIO m => Renderer -> SV.Vector (Rectangle CInt) -> m () fillRects (Renderer r) rects = liftIO $   throwIfNeg_ "SDL.Video.fillRects" "SDL_RenderFillRects" $@@ -791,7 +832,7 @@  -- | Clear the current rendering target with the drawing color. ----- See @<https://wiki.libsdl.org/SDL_RenderClear SDL_RenderClear>@ for C documentation.+-- See @<https://wiki.libsdl.org/SDL2/SDL_RenderClear SDL_RenderClear>@ for C documentation. clear :: (Functor m, MonadIO m) => Renderer -> m () clear (Renderer r) =   throwIfNeg_ "SDL.Video.clear" "SDL_RenderClear" $@@ -804,7 +845,7 @@ -- -- 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.+-- See @<https://wiki.libsdl.org/SDL2/SDL_RenderSetScale SDL_RenderSetScale>@ and @<https://wiki.libsdl.org/SDL2/SDL_RenderGetScale SDL_RenderGetScale>@ for C documentation. rendererScale :: Renderer -> StateVar (V2 CFloat) rendererScale (Renderer r) = makeStateVar renderGetScale renderSetScale   where@@ -812,7 +853,7 @@     throwIfNeg_ "SDL.Video.renderSetScale" "SDL_RenderSetScale" $     Raw.renderSetScale r x y -  renderGetScale = liftIO $+  renderGetScale =     alloca $ \w ->     alloca $ \h -> do       Raw.renderGetScale r w h@@ -822,16 +863,15 @@ -- -- 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.+-- See @<https://wiki.libsdl.org/SDL2/SDL_RenderSetClipRect SDL_RenderSetClipRect>@ and @<https://wiki.libsdl.org/SDL2/SDL_RenderGetClipRect SDL_RenderGetClipRect>@ for C documentation. rendererClipRect :: Renderer -> StateVar (Maybe (Rectangle CInt)) rendererClipRect (Renderer r) = makeStateVar renderGetClipRect renderSetClipRect   where-  renderGetClipRect = liftIO $+  renderGetClipRect =     alloca $ \rPtr -> do       Raw.renderGetClipRect r rPtr       maybePeek peek (castPtr rPtr)   renderSetClipRect rect =-    liftIO $     throwIfNeg_ "SDL.Video.renderSetClipRect" "SDL_RenderSetClipRect" $     maybeWith with rect $ Raw.renderSetClipRect r . castPtr @@ -839,17 +879,16 @@ -- -- 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.+-- See @<https://wiki.libsdl.org/SDL2/SDL_RenderSetViewport SDL_RenderSetViewport>@ and @<https://wiki.libsdl.org/SDL2/SDL_RenderGetViewport SDL_RenderGetViewport>@ for C documentation. rendererViewport :: Renderer -> StateVar (Maybe (Rectangle CInt)) rendererViewport (Renderer r) = makeStateVar renderGetViewport renderSetViewport   where-  renderGetViewport = liftIO $+  renderGetViewport =     alloca $ \rect -> do       Raw.renderGetViewport r rect       maybePeek peek (castPtr rect)    renderSetViewport rect =-    liftIO $     throwIfNeg_ "SDL.Video.renderSetViewport" "SDL_RenderSetViewport" $     maybeWith with rect $ Raw.renderSetViewport r . castPtr @@ -861,13 +900,13 @@ -- -- 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.+-- See @<https://wiki.libsdl.org/SDL2/SDL_RenderPresent SDL_RenderPresent>@ for C documentation. present :: MonadIO m => Renderer -> m () present (Renderer r) = Raw.renderPresent r  -- | Copy a portion of the texture to the current rendering target. ----- See @<https://wiki.libsdl.org/SDL_RenderCopy SDL_RenderCopy>@ for C documentation.+-- See @<https://wiki.libsdl.org/SDL2/SDL_RenderCopy SDL_RenderCopy>@ for C documentation. copy :: MonadIO m      => Renderer -- ^ The rendering context      -> Texture -- ^ The source texture@@ -883,7 +922,7 @@  -- | 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.+-- See @<https://wiki.libsdl.org/SDL2/SDL_RenderCopyEx SDL_RenderCopyEx>@ for C documentation. copyEx :: MonadIO m        => Renderer -- ^ The rendering context        -> Texture -- ^ The source texture@@ -906,7 +945,7 @@  -- | Draw a line on the current rendering target. ----- See @<https://wiki.libsdl.org/SDL_RenderDrawLine SDL_RenderDrawLine>@ for C documentation.+-- See @<https://wiki.libsdl.org/SDL2/SDL_RenderDrawLine SDL_RenderDrawLine>@ for C documentation. drawLine :: (Functor m,MonadIO m)          => Renderer          -> Point V2 CInt -- ^ The start point of the line@@ -918,7 +957,7 @@  -- | Draw a series of connected lines on the current rendering target. ----- See @<https://wiki.libsdl.org/SDL_RenderDrawLines SDL_RenderDrawLines>@ for C documentation.+-- See @<https://wiki.libsdl.org/SDL2/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.@@ -933,7 +972,7 @@  -- | Draw a point on the current rendering target. ----- See @<https://wiki.libsdl.org/SDL_RenderDrawPoint SDL_RenderDrawPoint>@ for C documentation.+-- See @<https://wiki.libsdl.org/SDL2/SDL_RenderDrawPoint SDL_RenderDrawPoint>@ for C documentation. drawPoint :: (Functor m, MonadIO m) => Renderer -> Point V2 CInt -> m () drawPoint (Renderer r) (P (V2 x y)) =   throwIfNeg_ "SDL.Video.drawPoint" "SDL_RenderDrawPoint" $@@ -941,7 +980,7 @@  -- | Draw multiple points on the current rendering target. ----- See @<https://wiki.libsdl.org/SDL_RenderDrawPoints SDL_RenderDrawPoints>@ for C documentation.+-- See @<https://wiki.libsdl.org/SDL2/SDL_RenderDrawPoints SDL_RenderDrawPoints>@ for C documentation. drawPoints :: MonadIO m => Renderer -> SV.Vector (Point V2 CInt) -> m () drawPoints (Renderer r) points =   liftIO $@@ -955,7 +994,7 @@ -- -- 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.+-- See @<https://wiki.libsdl.org/SDL2/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@@ -967,7 +1006,7 @@  -- | Perform a scaled surface copy to a destination surface. ----- See @<https://wiki.libsdl.org/SDL_BlitScaled SDL_BlitScaled>@ for C documentation.+-- See @<https://wiki.libsdl.org/SDL2/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@@ -985,12 +1024,11 @@ -- -- 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.+-- See @<https://wiki.libsdl.org/SDL2/SDL_SetColorKey SDL_SetColorKey>@ and @<https://wiki.libsdl.org/SDL2/SDL_GetColorKey SDL_GetColorKey>@ for C documentation. surfaceColorKey :: Surface -> StateVar (Maybe (V4 Word8)) surfaceColorKey (Surface s _) = makeStateVar getColorKey setColorKey   where   getColorKey =-    liftIO $     alloca $ \keyPtr -> do       ret <- Raw.getColorKey s keyPtr       if ret == -1@@ -1004,7 +1042,6 @@                     do Raw.getRGBA mapped format r g b a                        Just <$> (V4 <$> peek r <*> peek g <*> peek b <*> peek a)   setColorKey key =-    liftIO $     throwIfNeg_ "SDL.Video.Renderer.setColorKey" "SDL_SetColorKey" $     case key of       Nothing ->@@ -1026,11 +1063,11 @@ -- -- 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.+-- See @<https://wiki.libsdl.org/SDL2/SDL_SetTextureColorMod SDL_SetTextureColorMod>@ and @<https://wiki.libsdl.org/SDL2/SDL_GetTextureColorMod SDL_GetTextureColorMod>@ for C documentation. textureColorMod :: Texture -> StateVar (V3 Word8) textureColorMod (Texture t) = makeStateVar getTextureColorMod setTextureColorMod   where-  getTextureColorMod = liftIO $+  getTextureColorMod =     alloca $ \r ->     alloca $ \g ->     alloca $ \b -> do@@ -1241,7 +1278,7 @@  -- | Get information about a rendering context. ----- See @<https://wiki.libsdl.org/SDL_GetRendererInfo SDL_GetRendererInfo>@ for C documentation.+-- See @<https://wiki.libsdl.org/SDL2/SDL_GetRendererInfo SDL_GetRendererInfo>@ for C documentation. getRendererInfo :: MonadIO m => Renderer -> m RendererInfo getRendererInfo (Renderer renderer) = liftIO $   alloca $ \rptr -> do@@ -1251,7 +1288,7 @@  -- | 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.+-- See @<https://wiki.libsdl.org/SDL2/SDL_GetRenderDriverInfo SDL_GetRenderDriverInfo>@ for C documentation. getRenderDriverInfo :: MonadIO m => m [RendererInfo] getRenderDriverInfo = liftIO $ do   count <- Raw.getNumRenderDrivers@@ -1266,11 +1303,11 @@ -- -- 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.+-- See @<https://wiki.libsdl.org/SDL2/SDL_SetTextureAlphaMod SDL_SetTextureAlphaMod>@ and @<https://wiki.libsdl.org/SDL2/SDL_GetTextureAlphaMod SDL_GetTextureAlphaMod>@ for C documentation. textureAlphaMod :: Texture -> StateVar Word8 textureAlphaMod (Texture t) = makeStateVar getTextureAlphaMod setTextureAlphaMod   where-  getTextureAlphaMod = liftIO $+  getTextureAlphaMod =     alloca $ \x -> do       throwIfNeg_ "SDL.Video.Renderer.getTextureAlphaMod" "SDL_GetTextureAlphaMod" $         Raw.getTextureAlphaMod t x@@ -1284,11 +1321,11 @@ -- -- 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.+-- See @<https://wiki.libsdl.org/SDL2/SDL_SetTextureBlendMode SDL_SetTextureBlendMode>@ and @<https://wiki.libsdl.org/SDL2/SDL_GetTextureBlendMode SDL_GetTextureBlendMode>@ for C documentation. textureBlendMode :: Texture -> StateVar BlendMode textureBlendMode (Texture t) = makeStateVar getTextureBlendMode setTextureBlendMode   where-  getTextureBlendMode = liftIO $+  getTextureBlendMode =     alloca $ \x -> do       throwIfNeg_ "SDL.Video.Renderer.getTextureBlendMode" "SDL_GetTextureBlendMode" $         Raw.getTextureBlendMode t x@@ -1302,11 +1339,11 @@ -- -- 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.+-- See @<https://wiki.libsdl.org/SDL2/SDL_SetSurfaceBlendMode SDL_SetSurfaceBlendMode>@ and @<https://wiki.libsdl.org/SDL2/SDL_GetSurfaceBlendMode SDL_GetSurfaceBlendMode>@ for C documentation. surfaceBlendMode :: Surface -> StateVar BlendMode surfaceBlendMode (Surface s _) = makeStateVar getSurfaceBlendMode setSurfaceBlendMode   where-  getSurfaceBlendMode = liftIO $+  getSurfaceBlendMode =     alloca $ \x -> do       throwIfNeg_ "SDL.Video.Renderer.getSurfaceBlendMode" "SDL_GetSurfaceBlendMode" $         Raw.getSurfaceBlendMode s x@@ -1320,7 +1357,7 @@ -- -- 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.+-- See @<https://wiki.libsdl.org/SDL2/SDL_SetRenderTarget SDL_SetRenderTarget>@ and @<https://wiki.libsdl.org/SDL2/SDL_GetRenderTarget SDL_GetRenderTarget>@ for C documentation. rendererRenderTarget :: Renderer -> StateVar (Maybe Texture) rendererRenderTarget (Renderer r) = makeStateVar getRenderTarget setRenderTarget   where@@ -1337,15 +1374,32 @@       Nothing -> Raw.setRenderTarget r nullPtr       Just (Texture t) -> Raw.setRenderTarget r t --- | Get or set the device independent resolution for rendering.+-- | Get or set whether to force integer scales for resolution-independent rendering.+-- It may be desirable to enable integer scales when using device independent resolution+-- via 'rendererLogicalSize' so that pixel sizing is consistent. -- -- 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.+-- See @<https://wiki.libsdl.org/SDL2/SDL_RenderSetIntegerScale SDL_RenderSetIntegerScale>@ and @<https://wiki.libsdl.org/SDL2/SDL_RenderGetIntegerScale SDL_RenderGetIntegerScale>@ for C documentation.+rendererIntegerScale :: Renderer -> StateVar Bool+rendererIntegerScale (Renderer r) = makeStateVar renderGetIntegerScale renderSetIntegerScale+  where+  renderGetIntegerScale = (== 1) <$> Raw.renderGetIntegerScale r++  renderSetIntegerScale True = void $ Raw.renderSetIntegerScale r 1+  renderSetIntegerScale False = void $ Raw.renderSetIntegerScale r 0++-- | Get or set the device independent resolution for rendering. When using this setting,+-- it may be desirable to also enable integer scales via 'rendererIntegerScale' so that+-- pixel sizing is consistent.+--+-- This 'StateVar' can be modified using '$=' and the current value retrieved with 'get'.+--+-- See @<https://wiki.libsdl.org/SDL2/SDL_RenderSetLogicalSize SDL_RenderSetLogicalSize>@ and @<https://wiki.libsdl.org/SDL2/SDL_RenderGetLogicalSize SDL_RenderGetLogicalSize>@ for C documentation. rendererLogicalSize :: Renderer -> StateVar (Maybe (V2 CInt)) rendererLogicalSize (Renderer r) = makeStateVar renderGetLogicalSize renderSetLogicalSize   where-  renderGetLogicalSize = liftIO $+  renderGetLogicalSize =     alloca $ \w -> do     alloca $ \h -> do       Raw.renderGetLogicalSize r w h@@ -1360,13 +1414,13 @@  -- | Determine whether a window supports the use of render targets. ----- See @<https://wiki.libsdl.org/SDL_RenderTargetSupported SDL_RenderTargetSupported>@ for C documentation.+-- See @<https://wiki.libsdl.org/SDL2/SDL_RenderTargetSupported SDL_RenderTargetSupported>@ for C documentation. renderTargetSupported :: (MonadIO m) => Renderer -> m Bool renderTargetSupported (Renderer r) = Raw.renderTargetSupported 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.+-- See @<https://wiki.libsdl.org/SDL2/SDL_PixelFormatEnumToMasks SDL_PixelFormatEnumToMasks>@ for C documentation. pixelFormatToMasks :: (MonadIO m) => PixelFormat -> m (CInt, V4 Word32) pixelFormatToMasks pf = liftIO $   alloca $ \bpp ->@@ -1382,7 +1436,7 @@  -- | Convert a bpp value and RGBA masks to an enumerated pixel format. ----- See @<https://wiki.libsdl.org/SDL_MasksToPixelFormatEnum SDL_MasksToPixelFormatEnum>@ for C documentation.+-- See @<https://wiki.libsdl.org/SDL2/SDL_MasksToPixelFormatEnum SDL_MasksToPixelFormatEnum>@ for C documentation. masksToPixelFormat :: (MonadIO m) => CInt -> V4 Word32 -> m PixelFormat masksToPixelFormat bpp (V4 r g b a) = liftIO $   fromNumber <$> Raw.masksToPixelFormatEnum bpp r g b a