-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Both high- and low-level bindings to the SDL library (version 2.0.4+). -- -- This package contains bindings to the SDL 2 library, in both high- and -- low-level forms: -- -- The SDL namespace contains high-level bindings, where -- enumerations are split into sum types, and we perform automatic -- error-checking. -- -- The SDL.Raw namespace contains an almost 1-1 translation of the -- C API into Haskell FFI calls. As such, this does not contain sum types -- nor error checking. Thus this namespace is suitable for building your -- own abstraction over SDL, but is not recommended for day-to-day -- programming. @package sdl2 @version 2.4.0 module SDL.Exception -- | Error details about a failure to call an SDL routine. Almost all -- functions in this library have the ability to produce exceptions of -- this type. Inspection should help you learn more about what has gone -- wrong. data SDLException -- | A call to a low-level SDL C function failed unexpectedly. SDLCallFailed :: !Text -> !Text -> !Text -> SDLException -- | The Haskell routine that was trying to call a C function [sdlExceptionCaller] :: SDLException -> !Text -- | The C function that was called and produced an error [sdlFunction] :: SDLException -> !Text -- | SDL's understanding of what has gone wrong [sdlExceptionError] :: SDLException -> !Text -- | An SDL C function was called with an unexpected argument. SDLUnexpectedArgument :: !Text -> !Text -> !String -> SDLException -- | The Haskell routine that was trying to call a C function [sdlExceptionCaller] :: SDLException -> !Text -- | The C function that was called and produced an error [sdlFunction] :: SDLException -> !Text -- | The argument that SDL failed to understand [sdlUnknownValue] :: SDLException -> !String -- | A hint was attempted to be set, but SDL does not know about this hint. SDLUnknownHintValue :: !String -> !String -> SDLException -- | The hint that could not be set [sdlHint] :: SDLException -> !String -- | The argument that SDL failed to understand [sdlUnknownValue] :: SDLException -> !String instance GHC.Show.Show SDL.Exception.SDLException instance GHC.Read.Read SDL.Exception.SDLException instance GHC.Classes.Ord SDL.Exception.SDLException instance GHC.Generics.Generic SDL.Exception.SDLException instance GHC.Classes.Eq SDL.Exception.SDLException instance Data.Data.Data SDL.Exception.SDLException instance GHC.Exception.Exception SDL.Exception.SDLException module SDL.Internal.Numbered class (Integral b) => FromNumber a b | a -> b fromNumber :: FromNumber a b => b -> a class (Integral b) => ToNumber a b | a -> b toNumber :: ToNumber a b => a -> b module SDL.Internal.Vect -- | A handy wrapper to help distinguish points from vectors at the type -- level newtype Point f a P :: (f a) -> Point f a -- | A 2-dimensional vector -- --
-- >>> pure 1 :: V2 Int -- V2 1 1 ---- --
-- >>> V2 1 2 + V2 3 4 -- V2 4 6 ---- --
-- >>> V2 1 2 * V2 3 4 -- V2 3 8 ---- --
-- >>> sum (V2 1 2) -- 3 --data V2 a V2 :: !a -> !a -> V2 a -- | A 3-dimensional vector data V3 a V3 :: !a -> !a -> !a -> V3 a -- | A 4-dimensional vector. data V4 a V4 :: !a -> !a -> !a -> !a -> V4 a instance GHC.Generics.Generic1 SDL.Internal.Vect.V4 instance GHC.Generics.Generic (SDL.Internal.Vect.V4 a) instance Data.Data.Data a => Data.Data.Data (SDL.Internal.Vect.V4 a) instance GHC.Read.Read a => GHC.Read.Read (SDL.Internal.Vect.V4 a) instance GHC.Show.Show a => GHC.Show.Show (SDL.Internal.Vect.V4 a) instance GHC.Classes.Ord a => GHC.Classes.Ord (SDL.Internal.Vect.V4 a) instance GHC.Classes.Eq a => GHC.Classes.Eq (SDL.Internal.Vect.V4 a) instance GHC.Generics.Generic1 SDL.Internal.Vect.V3 instance GHC.Generics.Generic (SDL.Internal.Vect.V3 a) instance Data.Data.Data a => Data.Data.Data (SDL.Internal.Vect.V3 a) instance GHC.Read.Read a => GHC.Read.Read (SDL.Internal.Vect.V3 a) instance GHC.Show.Show a => GHC.Show.Show (SDL.Internal.Vect.V3 a) instance GHC.Classes.Ord a => GHC.Classes.Ord (SDL.Internal.Vect.V3 a) instance GHC.Classes.Eq a => GHC.Classes.Eq (SDL.Internal.Vect.V3 a) instance GHC.Generics.Generic1 SDL.Internal.Vect.V2 instance GHC.Generics.Generic (SDL.Internal.Vect.V2 a) instance Data.Data.Data a => Data.Data.Data (SDL.Internal.Vect.V2 a) instance GHC.Read.Read a => GHC.Read.Read (SDL.Internal.Vect.V2 a) instance GHC.Show.Show a => GHC.Show.Show (SDL.Internal.Vect.V2 a) instance GHC.Classes.Ord a => GHC.Classes.Ord (SDL.Internal.Vect.V2 a) instance GHC.Classes.Eq a => GHC.Classes.Eq (SDL.Internal.Vect.V2 a) instance (Data.Typeable.Internal.Typeable f, Data.Typeable.Internal.Typeable a, Data.Data.Data (f a)) => Data.Data.Data (SDL.Internal.Vect.Point f a) instance GHC.Generics.Generic1 (SDL.Internal.Vect.Point f) instance GHC.Generics.Generic (SDL.Internal.Vect.Point f a) instance Foreign.Storable.Storable (f a) => Foreign.Storable.Storable (SDL.Internal.Vect.Point f a) instance GHC.Arr.Ix (f a) => GHC.Arr.Ix (SDL.Internal.Vect.Point f a) instance GHC.Num.Num (f a) => GHC.Num.Num (SDL.Internal.Vect.Point f a) instance GHC.Real.Fractional (f a) => GHC.Real.Fractional (SDL.Internal.Vect.Point f a) instance Data.Traversable.Traversable f => Data.Traversable.Traversable (SDL.Internal.Vect.Point f) instance Data.Foldable.Foldable f => Data.Foldable.Foldable (SDL.Internal.Vect.Point f) instance GHC.Base.Applicative f => GHC.Base.Applicative (SDL.Internal.Vect.Point f) instance GHC.Base.Functor f => GHC.Base.Functor (SDL.Internal.Vect.Point f) instance GHC.Base.Monad f => GHC.Base.Monad (SDL.Internal.Vect.Point f) instance GHC.Read.Read (f a) => GHC.Read.Read (SDL.Internal.Vect.Point f a) instance GHC.Show.Show (f a) => GHC.Show.Show (SDL.Internal.Vect.Point f a) instance GHC.Classes.Ord (f a) => GHC.Classes.Ord (SDL.Internal.Vect.Point f a) instance GHC.Classes.Eq (f a) => GHC.Classes.Eq (SDL.Internal.Vect.Point f a) instance GHC.Base.Functor SDL.Internal.Vect.V4 instance Data.Foldable.Foldable SDL.Internal.Vect.V4 instance Data.Traversable.Traversable SDL.Internal.Vect.V4 instance GHC.Base.Applicative SDL.Internal.Vect.V4 instance GHC.Base.Monad SDL.Internal.Vect.V4 instance GHC.Num.Num a => GHC.Num.Num (SDL.Internal.Vect.V4 a) instance GHC.Real.Fractional a => GHC.Real.Fractional (SDL.Internal.Vect.V4 a) instance GHC.Float.Floating a => GHC.Float.Floating (SDL.Internal.Vect.V4 a) instance Foreign.Storable.Storable a => Foreign.Storable.Storable (SDL.Internal.Vect.V4 a) instance GHC.Arr.Ix a => GHC.Arr.Ix (SDL.Internal.Vect.V4 a) instance Data.Vector.Unboxed.Base.Unbox a => Data.Vector.Unboxed.Base.Unbox (SDL.Internal.Vect.V4 a) instance Data.Vector.Unboxed.Base.Unbox a => Data.Vector.Generic.Mutable.Base.MVector Data.Vector.Unboxed.Base.MVector (SDL.Internal.Vect.V4 a) instance Data.Vector.Unboxed.Base.Unbox a => Data.Vector.Generic.Base.Vector Data.Vector.Unboxed.Base.Vector (SDL.Internal.Vect.V4 a) instance Control.Monad.Zip.MonadZip SDL.Internal.Vect.V4 instance Control.Monad.Fix.MonadFix SDL.Internal.Vect.V4 instance GHC.Enum.Bounded a => GHC.Enum.Bounded (SDL.Internal.Vect.V4 a) instance GHC.Base.Functor SDL.Internal.Vect.V3 instance Data.Foldable.Foldable SDL.Internal.Vect.V3 instance Data.Traversable.Traversable SDL.Internal.Vect.V3 instance GHC.Base.Applicative SDL.Internal.Vect.V3 instance GHC.Base.Monad SDL.Internal.Vect.V3 instance GHC.Num.Num a => GHC.Num.Num (SDL.Internal.Vect.V3 a) instance GHC.Real.Fractional a => GHC.Real.Fractional (SDL.Internal.Vect.V3 a) instance GHC.Float.Floating a => GHC.Float.Floating (SDL.Internal.Vect.V3 a) instance Foreign.Storable.Storable a => Foreign.Storable.Storable (SDL.Internal.Vect.V3 a) instance GHC.Arr.Ix a => GHC.Arr.Ix (SDL.Internal.Vect.V3 a) instance Data.Vector.Unboxed.Base.Unbox a => Data.Vector.Unboxed.Base.Unbox (SDL.Internal.Vect.V3 a) instance Data.Vector.Unboxed.Base.Unbox a => Data.Vector.Generic.Mutable.Base.MVector Data.Vector.Unboxed.Base.MVector (SDL.Internal.Vect.V3 a) instance Data.Vector.Unboxed.Base.Unbox a => Data.Vector.Generic.Base.Vector Data.Vector.Unboxed.Base.Vector (SDL.Internal.Vect.V3 a) instance Control.Monad.Zip.MonadZip SDL.Internal.Vect.V3 instance Control.Monad.Fix.MonadFix SDL.Internal.Vect.V3 instance GHC.Enum.Bounded a => GHC.Enum.Bounded (SDL.Internal.Vect.V3 a) instance GHC.Base.Functor SDL.Internal.Vect.V2 instance Data.Foldable.Foldable SDL.Internal.Vect.V2 instance Data.Traversable.Traversable SDL.Internal.Vect.V2 instance GHC.Base.Applicative SDL.Internal.Vect.V2 instance GHC.Base.Monad SDL.Internal.Vect.V2 instance GHC.Num.Num a => GHC.Num.Num (SDL.Internal.Vect.V2 a) instance GHC.Real.Fractional a => GHC.Real.Fractional (SDL.Internal.Vect.V2 a) instance GHC.Float.Floating a => GHC.Float.Floating (SDL.Internal.Vect.V2 a) instance Foreign.Storable.Storable a => Foreign.Storable.Storable (SDL.Internal.Vect.V2 a) instance GHC.Arr.Ix a => GHC.Arr.Ix (SDL.Internal.Vect.V2 a) instance Data.Vector.Unboxed.Base.Unbox a => Data.Vector.Unboxed.Base.Unbox (SDL.Internal.Vect.V2 a) instance Data.Vector.Unboxed.Base.Unbox a => Data.Vector.Generic.Mutable.Base.MVector Data.Vector.Unboxed.Base.MVector (SDL.Internal.Vect.V2 a) instance Data.Vector.Unboxed.Base.Unbox a => Data.Vector.Generic.Base.Vector Data.Vector.Unboxed.Base.Vector (SDL.Internal.Vect.V2 a) instance Control.Monad.Zip.MonadZip SDL.Internal.Vect.V2 instance Control.Monad.Fix.MonadFix SDL.Internal.Vect.V2 instance GHC.Enum.Bounded a => GHC.Enum.Bounded (SDL.Internal.Vect.V2 a) instance Data.Vector.Unboxed.Base.Unbox (f a) => Data.Vector.Unboxed.Base.Unbox (SDL.Internal.Vect.Point f a) instance Data.Vector.Unboxed.Base.Unbox (f a) => Data.Vector.Generic.Mutable.Base.MVector Data.Vector.Unboxed.Base.MVector (SDL.Internal.Vect.Point f a) instance Data.Vector.Unboxed.Base.Unbox (f a) => Data.Vector.Generic.Base.Vector Data.Vector.Unboxed.Base.Vector (SDL.Internal.Vect.Point f a) module SDL.Raw.Enum type AudioFormat = (Word16) type AudioStatus = (Word32) type BlendMode = (Word32) type EventAction = (Word32) type GameControllerAxis = (Int32) type GameControllerButton = (Int32) type GLattr = (Word32) type HintPriority = (Word32) type InitFlag = Word32 type JoystickPowerLevel = (Int32) type Keycode = (Int32) type Keymod = (Word32) type LogPriority = (Word32) type PowerState = (Word32) type RendererFlip = (Word32) type Scancode = (Word32) type SystemCursor = (Word32) type ThreadPriority = (Word32) -- | An enumeration of scancodes and keycodes, allowing you to pattern -- match on keyboard keys. -- -- This module uses a relatively new GHC feature called -- PatternSynonyms in order to provide pattern matches over the -- underlying Scancode or Keycode. We do this so that you -- are also able to work with vendor-specific or otherwise unknown codes. module SDL.Input.Keyboard.Codes newtype Scancode Scancode :: Word32 -> Scancode [unwrapScancode] :: Scancode -> Word32 newtype Keycode Keycode :: Int32 -> Keycode [unwrapKeycode] :: Keycode -> Int32 instance GHC.Show.Show SDL.Input.Keyboard.Codes.Keycode instance GHC.Generics.Generic SDL.Input.Keyboard.Codes.Keycode instance GHC.Read.Read SDL.Input.Keyboard.Codes.Keycode instance GHC.Classes.Ord SDL.Input.Keyboard.Codes.Keycode instance GHC.Classes.Eq SDL.Input.Keyboard.Codes.Keycode instance Data.Data.Data SDL.Input.Keyboard.Codes.Keycode instance GHC.Enum.Bounded SDL.Input.Keyboard.Codes.Keycode instance GHC.Show.Show SDL.Input.Keyboard.Codes.Scancode instance GHC.Generics.Generic SDL.Input.Keyboard.Codes.Scancode instance GHC.Read.Read SDL.Input.Keyboard.Codes.Scancode instance GHC.Classes.Ord SDL.Input.Keyboard.Codes.Scancode instance GHC.Classes.Eq SDL.Input.Keyboard.Codes.Scancode instance Data.Data.Data SDL.Input.Keyboard.Codes.Scancode instance GHC.Enum.Bounded SDL.Input.Keyboard.Codes.Scancode instance SDL.Internal.Numbered.FromNumber SDL.Input.Keyboard.Codes.Keycode GHC.Int.Int32 instance SDL.Internal.Numbered.ToNumber SDL.Input.Keyboard.Codes.Keycode GHC.Int.Int32 instance SDL.Internal.Numbered.FromNumber SDL.Input.Keyboard.Codes.Scancode GHC.Word.Word32 instance SDL.Internal.Numbered.ToNumber SDL.Input.Keyboard.Codes.Scancode GHC.Word.Word32 module SDL.Raw.Error -- | Note: the CString is only valid until the next SDL function -- call. If you need to preserve the error message, make a copy of it. newtype SDLError SDLError :: CString -> SDLError throwError :: (MonadThrow m, MonadIO m) => m () clearError :: MonadIO m => m () getError :: MonadIO m => m CString setError :: MonadIO m => CString -> m CInt instance GHC.Show.Show SDL.Raw.Error.SDLError instance GHC.Classes.Eq SDL.Raw.Error.SDLError instance GHC.Exception.Exception SDL.Raw.Error.SDLError module SDL.Raw.Platform getPlatform :: MonadIO m => m CString module SDL.Raw.Power getPowerInfo :: MonadIO m => Ptr CInt -> Ptr CInt -> m PowerState module SDL.Raw.Types type AudioCallback = FunPtr (Ptr () -> Ptr Word8 -> CInt -> IO ()) type EventFilter = FunPtr (Ptr () -> Ptr Event -> IO CInt) type HintCallback = FunPtr (Ptr () -> CString -> CString -> CString -> IO ()) type LogOutputFunction = FunPtr (Ptr () -> CInt -> LogPriority -> CString -> IO ()) type ThreadFunction = FunPtr (Ptr () -> IO CInt) type TimerCallback = FunPtr (Word32 -> Ptr () -> IO Word32) -- | The storage associated with the resulting FunPtr has to be -- released with freeHaskellFunPtr when it is no longer required. mkAudioCallback :: (Ptr () -> Ptr Word8 -> CInt -> IO ()) -> IO AudioCallback -- | The storage associated with the resulting FunPtr has to be -- released with freeHaskellFunPtr when it is no longer required. mkEventFilter :: (Ptr () -> Ptr Event -> IO CInt) -> IO EventFilter -- | The storage associated with the resulting FunPtr has to be -- released with freeHaskellFunPtr when it is no longer required. mkHintCallback :: (Ptr () -> CString -> CString -> CString -> IO ()) -> IO HintCallback -- | The storage associated with the resulting FunPtr has to be -- released with freeHaskellFunPtr when it is no longer required. mkLogOutputFunction :: (Ptr () -> CInt -> LogPriority -> CString -> IO ()) -> IO LogOutputFunction -- | The storage associated with the resulting FunPtr has to be -- released with freeHaskellFunPtr when it is no longer required. mkThreadFunction :: (Ptr () -> IO CInt) -> IO ThreadFunction -- | The storage associated with the resulting FunPtr has to be -- released with freeHaskellFunPtr when it is no longer required. mkTimerCallback :: (Word32 -> Ptr () -> IO Word32) -> IO TimerCallback type AudioDeviceID = Word32 type AudioFormat = (Word16) type Cond = Ptr () type Cursor = Ptr () type FingerID = Int64 type GameController = Ptr () type GestureID = Int64 type GLContext = Ptr () type Haptic = Ptr () type Joystick = Ptr () type JoystickID = Int32 type Mutex = Ptr () type Renderer = Ptr () type Sem = Ptr () type SpinLock = CInt type SysWMinfo = Ptr () type SysWMmsg = Ptr () type Texture = Ptr () type Thread = Ptr () type ThreadID = CULong type TimerID = CInt type TLSID = CUInt type TouchID = Int64 type Window = Ptr () data Atomic Atomic :: !CInt -> Atomic [atomicValue] :: Atomic -> !CInt data AudioCVT AudioCVT :: !CInt -> !AudioFormat -> !AudioFormat -> !CDouble -> !(Ptr Word8) -> !CInt -> !CInt -> !CInt -> !CDouble -> AudioCVT [audioCVTNeeded] :: AudioCVT -> !CInt [audioCVTSrcFormat] :: AudioCVT -> !AudioFormat [audioCVTDstFormat] :: AudioCVT -> !AudioFormat [audioCVTRateIncr] :: AudioCVT -> !CDouble [audioCVTBuf] :: AudioCVT -> !(Ptr Word8) [audioCVTLen] :: AudioCVT -> !CInt [audioCVTLenCvt] :: AudioCVT -> !CInt [audioCVTLenMult] :: AudioCVT -> !CInt [audioCVTLenRatio] :: AudioCVT -> !CDouble data AudioSpec AudioSpec :: !CInt -> !AudioFormat -> !Word8 -> !Word8 -> !Word16 -> !Word32 -> !AudioCallback -> !(Ptr ()) -> AudioSpec [audioSpecFreq] :: AudioSpec -> !CInt [audioSpecFormat] :: AudioSpec -> !AudioFormat [audioSpecChannels] :: AudioSpec -> !Word8 [audioSpecSilence] :: AudioSpec -> !Word8 [audioSpecSamples] :: AudioSpec -> !Word16 [audioSpecSize] :: AudioSpec -> !Word32 [audioSpecCallback] :: AudioSpec -> !AudioCallback [audioSpecUserdata] :: AudioSpec -> !(Ptr ()) data Color Color :: !Word8 -> !Word8 -> !Word8 -> !Word8 -> Color [colorR] :: Color -> !Word8 [colorG] :: Color -> !Word8 [colorB] :: Color -> !Word8 [colorA] :: Color -> !Word8 data DisplayMode DisplayMode :: !Word32 -> !CInt -> !CInt -> !CInt -> !(Ptr ()) -> DisplayMode [displayModeFormat] :: DisplayMode -> !Word32 [displayModeW] :: DisplayMode -> !CInt [displayModeH] :: DisplayMode -> !CInt [displayModeRefreshRate] :: DisplayMode -> !CInt [displayModeDriverData] :: DisplayMode -> !(Ptr ()) data Event WindowEvent :: !Word32 -> !Word32 -> !Word32 -> !Word8 -> !Int32 -> !Int32 -> Event [eventType] :: Event -> !Word32 [eventTimestamp] :: Event -> !Word32 [windowEventWindowID] :: Event -> !Word32 [windowEventEvent] :: Event -> !Word8 [windowEventData1] :: Event -> !Int32 [windowEventData2] :: Event -> !Int32 KeyboardEvent :: !Word32 -> !Word32 -> !Word32 -> !Word8 -> !Word8 -> !Keysym -> Event [eventType] :: Event -> !Word32 [eventTimestamp] :: Event -> !Word32 [keyboardEventWindowID] :: Event -> !Word32 [keyboardEventState] :: Event -> !Word8 [keyboardEventRepeat] :: Event -> !Word8 [keyboardEventKeysym] :: Event -> !Keysym TextEditingEvent :: !Word32 -> !Word32 -> !Word32 -> ![CChar] -> !Int32 -> !Int32 -> Event [eventType] :: Event -> !Word32 [eventTimestamp] :: Event -> !Word32 [textEditingEventWindowID] :: Event -> !Word32 [textEditingEventText] :: Event -> ![CChar] [textEditingEventStart] :: Event -> !Int32 [textEditingEventLength] :: Event -> !Int32 TextInputEvent :: !Word32 -> !Word32 -> !Word32 -> ![CChar] -> Event [eventType] :: Event -> !Word32 [eventTimestamp] :: Event -> !Word32 [textInputEventWindowID] :: Event -> !Word32 [textInputEventText] :: Event -> ![CChar] KeymapChangedEvent :: !Word32 -> !Word32 -> Event [eventType] :: Event -> !Word32 [eventTimestamp] :: Event -> !Word32 MouseMotionEvent :: !Word32 -> !Word32 -> !Word32 -> !Word32 -> !Word32 -> !Int32 -> !Int32 -> !Int32 -> !Int32 -> Event [eventType] :: Event -> !Word32 [eventTimestamp] :: Event -> !Word32 [mouseMotionEventWindowID] :: Event -> !Word32 [mouseMotionEventWhich] :: Event -> !Word32 [mouseMotionEventState] :: Event -> !Word32 [mouseMotionEventX] :: Event -> !Int32 [mouseMotionEventY] :: Event -> !Int32 [mouseMotionEventXRel] :: Event -> !Int32 [mouseMotionEventYRel] :: Event -> !Int32 MouseButtonEvent :: !Word32 -> !Word32 -> !Word32 -> !Word32 -> !Word8 -> !Word8 -> !Word8 -> !Int32 -> !Int32 -> Event [eventType] :: Event -> !Word32 [eventTimestamp] :: Event -> !Word32 [mouseButtonEventWindowID] :: Event -> !Word32 [mouseButtonEventWhich] :: Event -> !Word32 [mouseButtonEventButton] :: Event -> !Word8 [mouseButtonEventState] :: Event -> !Word8 [mouseButtonEventClicks] :: Event -> !Word8 [mouseButtonEventX] :: Event -> !Int32 [mouseButtonEventY] :: Event -> !Int32 MouseWheelEvent :: !Word32 -> !Word32 -> !Word32 -> !Word32 -> !Int32 -> !Int32 -> !Word32 -> Event [eventType] :: Event -> !Word32 [eventTimestamp] :: Event -> !Word32 [mouseWheelEventWindowID] :: Event -> !Word32 [mouseWheelEventWhich] :: Event -> !Word32 [mouseWheelEventX] :: Event -> !Int32 [mouseWheelEventY] :: Event -> !Int32 [mouseWheelEventDirection] :: Event -> !Word32 JoyAxisEvent :: !Word32 -> !Word32 -> !JoystickID -> !Word8 -> !Int16 -> Event [eventType] :: Event -> !Word32 [eventTimestamp] :: Event -> !Word32 [joyAxisEventWhich] :: Event -> !JoystickID [joyAxisEventAxis] :: Event -> !Word8 [joyAxisEventValue] :: Event -> !Int16 JoyBallEvent :: !Word32 -> !Word32 -> !JoystickID -> !Word8 -> !Int16 -> !Int16 -> Event [eventType] :: Event -> !Word32 [eventTimestamp] :: Event -> !Word32 [joyBallEventWhich] :: Event -> !JoystickID [joyBallEventBall] :: Event -> !Word8 [joyBallEventXRel] :: Event -> !Int16 [joyBallEventYRel] :: Event -> !Int16 JoyHatEvent :: !Word32 -> !Word32 -> !JoystickID -> !Word8 -> !Word8 -> Event [eventType] :: Event -> !Word32 [eventTimestamp] :: Event -> !Word32 [joyHatEventWhich] :: Event -> !JoystickID [joyHatEventHat] :: Event -> !Word8 [joyHatEventValue] :: Event -> !Word8 JoyButtonEvent :: !Word32 -> !Word32 -> !JoystickID -> !Word8 -> !Word8 -> Event [eventType] :: Event -> !Word32 [eventTimestamp] :: Event -> !Word32 [joyButtonEventWhich] :: Event -> !JoystickID [joyButtonEventButton] :: Event -> !Word8 [joyButtonEventState] :: Event -> !Word8 JoyDeviceEvent :: !Word32 -> !Word32 -> !Int32 -> Event [eventType] :: Event -> !Word32 [eventTimestamp] :: Event -> !Word32 [joyDeviceEventWhich] :: Event -> !Int32 ControllerAxisEvent :: !Word32 -> !Word32 -> !JoystickID -> !Word8 -> !Int16 -> Event [eventType] :: Event -> !Word32 [eventTimestamp] :: Event -> !Word32 [controllerAxisEventWhich] :: Event -> !JoystickID [controllerAxisEventAxis] :: Event -> !Word8 [controllerAxisEventValue] :: Event -> !Int16 ControllerButtonEvent :: !Word32 -> !Word32 -> !JoystickID -> !Word8 -> !Word8 -> Event [eventType] :: Event -> !Word32 [eventTimestamp] :: Event -> !Word32 [controllerButtonEventWhich] :: Event -> !JoystickID [controllerButtonEventButton] :: Event -> !Word8 [controllerButtonEventState] :: Event -> !Word8 ControllerDeviceEvent :: !Word32 -> !Word32 -> !Int32 -> Event [eventType] :: Event -> !Word32 [eventTimestamp] :: Event -> !Word32 [controllerDeviceEventWhich] :: Event -> !Int32 AudioDeviceEvent :: !Word32 -> !Word32 -> !Word32 -> !Word8 -> Event [eventType] :: Event -> !Word32 [eventTimestamp] :: Event -> !Word32 [audioDeviceEventWhich] :: Event -> !Word32 [audioDeviceEventIsCapture] :: Event -> !Word8 QuitEvent :: !Word32 -> !Word32 -> Event [eventType] :: Event -> !Word32 [eventTimestamp] :: Event -> !Word32 UserEvent :: !Word32 -> !Word32 -> !Word32 -> !Int32 -> !(Ptr ()) -> !(Ptr ()) -> Event [eventType] :: Event -> !Word32 [eventTimestamp] :: Event -> !Word32 [userEventWindowID] :: Event -> !Word32 [userEventCode] :: Event -> !Int32 [userEventData1] :: Event -> !(Ptr ()) [userEventData2] :: Event -> !(Ptr ()) SysWMEvent :: !Word32 -> !Word32 -> !SysWMmsg -> Event [eventType] :: Event -> !Word32 [eventTimestamp] :: Event -> !Word32 [sysWMEventMsg] :: Event -> !SysWMmsg TouchFingerEvent :: !Word32 -> !Word32 -> !TouchID -> !FingerID -> !CFloat -> !CFloat -> !CFloat -> !CFloat -> !CFloat -> Event [eventType] :: Event -> !Word32 [eventTimestamp] :: Event -> !Word32 [touchFingerEventTouchID] :: Event -> !TouchID [touchFingerEventFingerID] :: Event -> !FingerID [touchFingerEventX] :: Event -> !CFloat [touchFingerEventY] :: Event -> !CFloat [touchFingerEventDX] :: Event -> !CFloat [touchFingerEventDY] :: Event -> !CFloat [touchFingerEventPressure] :: Event -> !CFloat MultiGestureEvent :: !Word32 -> !Word32 -> !TouchID -> !CFloat -> !CFloat -> !CFloat -> !CFloat -> !Word16 -> Event [eventType] :: Event -> !Word32 [eventTimestamp] :: Event -> !Word32 [multiGestureEventTouchID] :: Event -> !TouchID [multiGestureEventDTheta] :: Event -> !CFloat [multiGestureEventDDist] :: Event -> !CFloat [multiGestureEventX] :: Event -> !CFloat [multiGestureEventY] :: Event -> !CFloat [multiGestureEventNumFingers] :: Event -> !Word16 DollarGestureEvent :: !Word32 -> !Word32 -> !TouchID -> !GestureID -> !Word32 -> !CFloat -> !CFloat -> !CFloat -> Event [eventType] :: Event -> !Word32 [eventTimestamp] :: Event -> !Word32 [dollarGestureEventTouchID] :: Event -> !TouchID [dollarGestureEventGestureID] :: Event -> !GestureID [dollarGestureEventNumFingers] :: Event -> !Word32 [dollarGestureEventError] :: Event -> !CFloat [dollarGestureEventX] :: Event -> !CFloat [dollarGestureEventY] :: Event -> !CFloat DropEvent :: !Word32 -> !Word32 -> !CString -> Event [eventType] :: Event -> !Word32 [eventTimestamp] :: Event -> !Word32 [dropEventFile] :: Event -> !CString ClipboardUpdateEvent :: !Word32 -> !Word32 -> Event [eventType] :: Event -> !Word32 [eventTimestamp] :: Event -> !Word32 UnknownEvent :: !Word32 -> !Word32 -> Event [eventType] :: Event -> !Word32 [eventTimestamp] :: Event -> !Word32 data Finger Finger :: !FingerID -> !CFloat -> !CFloat -> !CFloat -> Finger [fingerID] :: Finger -> !FingerID [fingerX] :: Finger -> !CFloat [fingerY] :: Finger -> !CFloat [fingerPressure] :: Finger -> !CFloat data GameControllerButtonBind GameControllerButtonBindNone :: GameControllerButtonBind GameControllerButtonBindButton :: !CInt -> GameControllerButtonBind [gameControllerButtonBindButton] :: GameControllerButtonBind -> !CInt GameControllerButtonBindAxis :: !CInt -> GameControllerButtonBind [gameControllerButtonBindAxis] :: GameControllerButtonBind -> !CInt GameControllerButtonBindHat :: !CInt -> !CInt -> GameControllerButtonBind [gameControllerButtonBindHat] :: GameControllerButtonBind -> !CInt [gameControllerButtonBindHatMask] :: GameControllerButtonBind -> !CInt data HapticDirection HapticDirection :: !Word8 -> !Int32 -> !Int32 -> !Int32 -> HapticDirection [hapticDirectionType] :: HapticDirection -> !Word8 [hapticDirectionX] :: HapticDirection -> !Int32 [hapticDirectionY] :: HapticDirection -> !Int32 [hapticDirectionZ] :: HapticDirection -> !Int32 data HapticEffect HapticConstant :: !Word16 -> !HapticDirection -> !Word32 -> !Word16 -> !Word16 -> !Word16 -> !Int16 -> !Word16 -> !Word16 -> !Word16 -> !Word16 -> HapticEffect [hapticEffectType] :: HapticEffect -> !Word16 [hapticConstantDirection] :: HapticEffect -> !HapticDirection [hapticConstantLength] :: HapticEffect -> !Word32 [hapticConstantDelay] :: HapticEffect -> !Word16 [hapticConstantButton] :: HapticEffect -> !Word16 [hapticConstantInterval] :: HapticEffect -> !Word16 [hapticConstantLevel] :: HapticEffect -> !Int16 [hapticConstantAttackLength] :: HapticEffect -> !Word16 [hapticConstantAttackLevel] :: HapticEffect -> !Word16 [hapticConstantFadeLength] :: HapticEffect -> !Word16 [hapticConstantFadeLevel] :: HapticEffect -> !Word16 HapticPeriodic :: !Word16 -> !HapticDirection -> !Word32 -> !Word16 -> !Word16 -> !Word16 -> !Word16 -> !Int16 -> !Int16 -> !Word16 -> !Word16 -> !Word16 -> !Word16 -> !Word16 -> HapticEffect [hapticEffectType] :: HapticEffect -> !Word16 [hapticPeriodicDirection] :: HapticEffect -> !HapticDirection [hapticPeriodicLength] :: HapticEffect -> !Word32 [hapticPeriodicDelay] :: HapticEffect -> !Word16 [hapticPeriodicButton] :: HapticEffect -> !Word16 [hapticPeriodicInterval] :: HapticEffect -> !Word16 [hapticPeriodicPeriod] :: HapticEffect -> !Word16 [hapticPeriodicMagnitude] :: HapticEffect -> !Int16 [hapticPeriodicOffset] :: HapticEffect -> !Int16 [hapticPeriodicPhase] :: HapticEffect -> !Word16 [hapticPeriodicAttackLength] :: HapticEffect -> !Word16 [hapticPeriodicAttackLevel] :: HapticEffect -> !Word16 [hapticPeriodicFadeLength] :: HapticEffect -> !Word16 [hapticPeriodicFadeLevel] :: HapticEffect -> !Word16 HapticCondition :: !Word16 -> !Word32 -> !Word16 -> !Word16 -> !Word16 -> ![Word16] -> ![Word16] -> ![Int16] -> ![Int16] -> ![Word16] -> ![Int16] -> HapticEffect [hapticEffectType] :: HapticEffect -> !Word16 [hapticConditionLength] :: HapticEffect -> !Word32 [hapticConditionDelay] :: HapticEffect -> !Word16 [hapticConditionButton] :: HapticEffect -> !Word16 [hapticConditionInterval] :: HapticEffect -> !Word16 [hapticConditionRightSat] :: HapticEffect -> ![Word16] [hapticConditionLeftSat] :: HapticEffect -> ![Word16] [hapticConditionRightCoeff] :: HapticEffect -> ![Int16] [hapticConditionLeftCoeff] :: HapticEffect -> ![Int16] [hapticConditionDeadband] :: HapticEffect -> ![Word16] [hapticConditionCenter] :: HapticEffect -> ![Int16] HapticRamp :: !Word16 -> !HapticDirection -> !Word32 -> !Word16 -> !Word16 -> !Word16 -> !Int16 -> !Int16 -> !Word16 -> !Word16 -> !Word16 -> !Word16 -> HapticEffect [hapticEffectType] :: HapticEffect -> !Word16 [hapticRampDirection] :: HapticEffect -> !HapticDirection [hapticRampLength] :: HapticEffect -> !Word32 [hapticRampDelay] :: HapticEffect -> !Word16 [hapticRampButton] :: HapticEffect -> !Word16 [hapticRampInterval] :: HapticEffect -> !Word16 [hapticRampStart] :: HapticEffect -> !Int16 [hapticRampEnd] :: HapticEffect -> !Int16 [hapticRampAttackLength] :: HapticEffect -> !Word16 [hapticRampAttackLevel] :: HapticEffect -> !Word16 [hapticRampFadeLength] :: HapticEffect -> !Word16 [hapticRampFadeLevel] :: HapticEffect -> !Word16 HapticLeftRight :: !Word16 -> !Word32 -> !Word16 -> !Word16 -> HapticEffect [hapticEffectType] :: HapticEffect -> !Word16 [hapticLeftRightLength] :: HapticEffect -> !Word32 [hapticLeftRightLargeMagnitude] :: HapticEffect -> !Word16 [hapticLeftRightSmallMagnitude] :: HapticEffect -> !Word16 HapticCustom :: !Word16 -> !HapticDirection -> !Word32 -> !Word16 -> !Word16 -> !Word16 -> !Word8 -> !Word16 -> !Word16 -> !(Ptr Word16) -> !Word16 -> !Word16 -> !Word16 -> !Word16 -> HapticEffect [hapticEffectType] :: HapticEffect -> !Word16 [hapticCustomDirection] :: HapticEffect -> !HapticDirection [hapticCustomLength] :: HapticEffect -> !Word32 [hapticCustomDelay] :: HapticEffect -> !Word16 [hapticCustomButton] :: HapticEffect -> !Word16 [hapticCustomInterval] :: HapticEffect -> !Word16 [hapticCustomChannels] :: HapticEffect -> !Word8 [hapticCustomPeriod] :: HapticEffect -> !Word16 [hapticCustomSamples] :: HapticEffect -> !Word16 [hapticCustomData] :: HapticEffect -> !(Ptr Word16) [hapticCustomAttackLength] :: HapticEffect -> !Word16 [hapticCustomAttackLevel] :: HapticEffect -> !Word16 [hapticCustomFadeLength] :: HapticEffect -> !Word16 [hapticCustomFadeLevel] :: HapticEffect -> !Word16 data JoystickGUID JoystickGUID :: ![Word8] -> JoystickGUID [joystickGUID] :: JoystickGUID -> ![Word8] data Keysym Keysym :: !Scancode -> !Keycode -> !Word16 -> Keysym [keysymScancode] :: Keysym -> !Scancode [keysymKeycode] :: Keysym -> !Keycode [keysymMod] :: Keysym -> !Word16 data MessageBoxButtonData MessageBoxButtonData :: !Word32 -> !CInt -> !CString -> MessageBoxButtonData [messageBoxButtonDataFlags] :: MessageBoxButtonData -> !Word32 [messageBoxButtonButtonID] :: MessageBoxButtonData -> !CInt [messageBoxButtonText] :: MessageBoxButtonData -> !CString data MessageBoxColor MessageBoxColor :: !Word8 -> !Word8 -> !Word8 -> MessageBoxColor [messageBoxColorR] :: MessageBoxColor -> !Word8 [messageBoxColorG] :: MessageBoxColor -> !Word8 [messageBoxColorB] :: MessageBoxColor -> !Word8 data MessageBoxColorScheme MessageBoxColorScheme :: !MessageBoxColor -> !MessageBoxColor -> !MessageBoxColor -> !MessageBoxColor -> !MessageBoxColor -> MessageBoxColorScheme [messageBoxColorSchemeColorBackground] :: MessageBoxColorScheme -> !MessageBoxColor [messageBoxColorSchemeColorText] :: MessageBoxColorScheme -> !MessageBoxColor [messageBoxColorSchemeColorButtonBorder] :: MessageBoxColorScheme -> !MessageBoxColor [messageBoxColorSchemeColorButtonBackground] :: MessageBoxColorScheme -> !MessageBoxColor [messageBoxColorSchemeColorButtonSelected] :: MessageBoxColorScheme -> !MessageBoxColor data MessageBoxData MessageBoxData :: !Word32 -> !Window -> !CString -> !CString -> !CInt -> !(Ptr MessageBoxButtonData) -> !(Ptr MessageBoxColorScheme) -> MessageBoxData [messageBoxDataFlags] :: MessageBoxData -> !Word32 [messageBoxDataWindow] :: MessageBoxData -> !Window [messageBoxDataTitle] :: MessageBoxData -> !CString [messageBoxDataMessage] :: MessageBoxData -> !CString [messageBoxDataNumButtons] :: MessageBoxData -> !CInt [messageBoxDataButtons] :: MessageBoxData -> !(Ptr MessageBoxButtonData) [messageBoxDataColorScheme] :: MessageBoxData -> !(Ptr MessageBoxColorScheme) data Palette Palette :: !CInt -> !(Ptr Color) -> Palette [paletteNColors] :: Palette -> !CInt [paletteColors] :: Palette -> !(Ptr Color) data PixelFormat PixelFormat :: !Word32 -> !(Ptr Palette) -> !Word8 -> !Word8 -> !Word32 -> !Word32 -> !Word32 -> !Word32 -> PixelFormat [pixelFormatFormat] :: PixelFormat -> !Word32 [pixelFormatPalette] :: PixelFormat -> !(Ptr Palette) [pixelFormatBitsPerPixel] :: PixelFormat -> !Word8 [pixelFormatBytesPerPixel] :: PixelFormat -> !Word8 [pixelFormatRMask] :: PixelFormat -> !Word32 [pixelFormatGMask] :: PixelFormat -> !Word32 [pixelFormatBMask] :: PixelFormat -> !Word32 [pixelFormatAMask] :: PixelFormat -> !Word32 data Point Point :: !CInt -> !CInt -> Point [pointX] :: Point -> !CInt [pointY] :: Point -> !CInt data Rect Rect :: !CInt -> !CInt -> !CInt -> !CInt -> Rect [rectX] :: Rect -> !CInt [rectY] :: Rect -> !CInt [rectW] :: Rect -> !CInt [rectH] :: Rect -> !CInt data RendererInfo RendererInfo :: !CString -> !Word32 -> !Word32 -> ![Word32] -> !CInt -> !CInt -> RendererInfo [rendererInfoName] :: RendererInfo -> !CString [rendererInfoFlags] :: RendererInfo -> !Word32 [rendererInfoNumTextureFormats] :: RendererInfo -> !Word32 [rendererInfoTextureFormats] :: RendererInfo -> ![Word32] [rendererInfoMaxTextureWidth] :: RendererInfo -> !CInt [rendererInfoMaxTextureHeight] :: RendererInfo -> !CInt data RWops RWops :: !(FunPtr (Ptr RWops -> IO Int64)) -> !(FunPtr (Ptr RWops -> Int64 -> CInt -> IO Int64)) -> !(FunPtr (Ptr RWops -> Ptr () -> CSize -> CSize -> IO CSize)) -> !(FunPtr (Ptr RWops -> Ptr () -> CSize -> CSize -> IO CSize)) -> !(FunPtr (Ptr RWops -> IO CInt)) -> !Word32 -> RWops [rwopsSize] :: RWops -> !(FunPtr (Ptr RWops -> IO Int64)) [rwopsSeek] :: RWops -> !(FunPtr (Ptr RWops -> Int64 -> CInt -> IO Int64)) [rwopsRead] :: RWops -> !(FunPtr (Ptr RWops -> Ptr () -> CSize -> CSize -> IO CSize)) [rwopsWrite] :: RWops -> !(FunPtr (Ptr RWops -> Ptr () -> CSize -> CSize -> IO CSize)) [rwopsClose] :: RWops -> !(FunPtr (Ptr RWops -> IO CInt)) [rwopsType] :: RWops -> !Word32 data Surface Surface :: !(Ptr PixelFormat) -> !CInt -> !CInt -> !(Ptr ()) -> !(Ptr ()) -> !Rect -> !CInt -> Surface [surfaceFormat] :: Surface -> !(Ptr PixelFormat) [surfaceW] :: Surface -> !CInt [surfaceH] :: Surface -> !CInt [surfacePixels] :: Surface -> !(Ptr ()) [surfaceUserdata] :: Surface -> !(Ptr ()) [surfaceClipRect] :: Surface -> !Rect [surfaceRefcount] :: Surface -> !CInt data Version Version :: !Word8 -> !Word8 -> !Word8 -> Version [versionMajor] :: Version -> !Word8 [versionMinor] :: Version -> !Word8 [versionPatch] :: Version -> !Word8 instance GHC.Show.Show SDL.Raw.Types.Version instance GHC.Classes.Eq SDL.Raw.Types.Version instance GHC.Show.Show SDL.Raw.Types.Surface instance GHC.Classes.Eq SDL.Raw.Types.Surface instance GHC.Show.Show SDL.Raw.Types.RWops instance GHC.Classes.Eq SDL.Raw.Types.RWops instance GHC.Show.Show SDL.Raw.Types.RendererInfo instance GHC.Classes.Eq SDL.Raw.Types.RendererInfo instance GHC.Show.Show SDL.Raw.Types.Rect instance GHC.Classes.Eq SDL.Raw.Types.Rect instance GHC.Show.Show SDL.Raw.Types.Point instance GHC.Classes.Eq SDL.Raw.Types.Point instance GHC.Show.Show SDL.Raw.Types.PixelFormat instance GHC.Classes.Eq SDL.Raw.Types.PixelFormat instance GHC.Show.Show SDL.Raw.Types.Palette instance GHC.Classes.Eq SDL.Raw.Types.Palette instance GHC.Show.Show SDL.Raw.Types.MessageBoxData instance GHC.Classes.Eq SDL.Raw.Types.MessageBoxData instance GHC.Show.Show SDL.Raw.Types.MessageBoxColorScheme instance GHC.Classes.Eq SDL.Raw.Types.MessageBoxColorScheme instance GHC.Show.Show SDL.Raw.Types.MessageBoxColor instance GHC.Classes.Eq SDL.Raw.Types.MessageBoxColor instance GHC.Show.Show SDL.Raw.Types.MessageBoxButtonData instance GHC.Classes.Eq SDL.Raw.Types.MessageBoxButtonData instance GHC.Show.Show SDL.Raw.Types.Event instance GHC.Classes.Eq SDL.Raw.Types.Event instance GHC.Show.Show SDL.Raw.Types.Keysym instance GHC.Classes.Eq SDL.Raw.Types.Keysym instance GHC.Show.Show SDL.Raw.Types.JoystickGUID instance GHC.Classes.Eq SDL.Raw.Types.JoystickGUID instance GHC.Show.Show SDL.Raw.Types.HapticEffect instance GHC.Classes.Eq SDL.Raw.Types.HapticEffect instance GHC.Show.Show SDL.Raw.Types.HapticDirection instance GHC.Classes.Eq SDL.Raw.Types.HapticDirection instance GHC.Show.Show SDL.Raw.Types.GameControllerButtonBind instance GHC.Classes.Eq SDL.Raw.Types.GameControllerButtonBind instance GHC.Show.Show SDL.Raw.Types.Finger instance GHC.Classes.Eq SDL.Raw.Types.Finger instance GHC.Show.Show SDL.Raw.Types.DisplayMode instance GHC.Classes.Eq SDL.Raw.Types.DisplayMode instance GHC.Show.Show SDL.Raw.Types.Color instance GHC.Classes.Eq SDL.Raw.Types.Color instance GHC.Show.Show SDL.Raw.Types.AudioSpec instance GHC.Classes.Eq SDL.Raw.Types.AudioSpec instance GHC.Show.Show SDL.Raw.Types.AudioCVT instance GHC.Classes.Eq SDL.Raw.Types.AudioCVT instance GHC.Show.Show SDL.Raw.Types.Atomic instance GHC.Classes.Eq SDL.Raw.Types.Atomic instance Foreign.Storable.Storable SDL.Raw.Types.Version instance Foreign.Storable.Storable SDL.Raw.Types.Surface instance Foreign.Storable.Storable SDL.Raw.Types.RWops instance Foreign.Storable.Storable SDL.Raw.Types.RendererInfo instance Foreign.Storable.Storable SDL.Raw.Types.Rect instance Foreign.Storable.Storable SDL.Raw.Types.Point instance Foreign.Storable.Storable SDL.Raw.Types.PixelFormat instance Foreign.Storable.Storable SDL.Raw.Types.Palette instance Foreign.Storable.Storable SDL.Raw.Types.MessageBoxData instance Foreign.Storable.Storable SDL.Raw.Types.MessageBoxColorScheme instance Foreign.Storable.Storable SDL.Raw.Types.MessageBoxColor instance Foreign.Storable.Storable SDL.Raw.Types.MessageBoxButtonData instance Foreign.Storable.Storable SDL.Raw.Types.Event instance Foreign.Storable.Storable SDL.Raw.Types.Keysym instance Foreign.Storable.Storable SDL.Raw.Types.JoystickGUID instance Foreign.Storable.Storable SDL.Raw.Types.HapticEffect instance Foreign.Storable.Storable SDL.Raw.Types.HapticDirection instance Foreign.Storable.Storable SDL.Raw.Types.GameControllerButtonBind instance Foreign.Storable.Storable SDL.Raw.Types.Finger instance Foreign.Storable.Storable SDL.Raw.Types.DisplayMode instance Foreign.Storable.Storable SDL.Raw.Types.Color instance Foreign.Storable.Storable SDL.Raw.Types.AudioSpec instance Foreign.Storable.Storable SDL.Raw.Types.AudioCVT instance Foreign.Storable.Storable SDL.Raw.Types.Atomic module SDL.Raw.Timer addTimer :: MonadIO m => Word32 -> TimerCallback -> Ptr () -> m TimerID delay :: MonadIO m => Word32 -> m () getPerformanceCounter :: MonadIO m => m Word64 getPerformanceFrequency :: MonadIO m => m Word64 getTicks :: MonadIO m => m Word32 removeTimer :: MonadIO m => TimerID -> m Bool module SDL.Raw.Thread createThread :: MonadIO m => ThreadFunction -> CString -> m (Ptr ()) detachThread :: MonadIO m => Ptr Thread -> m () getThreadID :: MonadIO m => Ptr Thread -> m ThreadID getThreadName :: MonadIO m => Ptr Thread -> m CString setThreadPriority :: MonadIO m => ThreadPriority -> m CInt tlsCreate :: MonadIO m => m TLSID tlsGet :: MonadIO m => TLSID -> m (Ptr ()) tlsSet :: MonadIO m => TLSID -> Ptr () -> FunPtr (Ptr () -> IO ()) -> m CInt threadID :: MonadIO m => m ThreadID waitThread :: MonadIO m => Ptr Thread -> Ptr CInt -> m () condBroadcast :: MonadIO m => Ptr Cond -> m CInt condSignal :: MonadIO m => Ptr Cond -> m CInt condWait :: MonadIO m => Ptr Cond -> Ptr Mutex -> m CInt condWaitTimeout :: MonadIO m => Ptr Cond -> Ptr Mutex -> Word32 -> m CInt createCond :: MonadIO m => m (Ptr Cond) createMutex :: MonadIO m => m (Ptr Mutex) createSemaphore :: MonadIO m => Word32 -> m (Ptr Sem) destroyCond :: MonadIO m => Ptr Cond -> m () destroyMutex :: MonadIO m => Ptr Mutex -> m () destroySemaphore :: MonadIO m => Ptr Sem -> m () lockMutex :: MonadIO m => Ptr Mutex -> m CInt semPost :: MonadIO m => Ptr Sem -> m CInt semTryWait :: MonadIO m => Ptr Sem -> m CInt semValue :: MonadIO m => Ptr Sem -> m Word32 semWait :: MonadIO m => Ptr Sem -> m CInt semWaitTimeout :: MonadIO m => Ptr Sem -> Word32 -> m CInt tryLockMutex :: MonadIO m => Ptr Mutex -> m CInt unlockMutex :: MonadIO m => Ptr Mutex -> m CInt atomicAdd :: MonadIO m => Ptr Atomic -> CInt -> m CInt atomicCAS :: MonadIO m => Ptr Atomic -> CInt -> CInt -> m Bool atomicCASPtr :: MonadIO m => Ptr (Ptr ()) -> Ptr () -> Ptr () -> m Bool atomicDecRef :: Ptr Atomic -> IO Bool atomicGet :: MonadIO m => Ptr Atomic -> m CInt atomicGetPtr :: MonadIO m => Ptr (Ptr ()) -> m (Ptr ()) atomicIncRef :: Ptr Atomic -> IO CInt atomicLock :: MonadIO m => Ptr SpinLock -> m () atomicSet :: MonadIO m => Ptr Atomic -> CInt -> m CInt atomicSetPtr :: MonadIO m => Ptr (Ptr ()) -> Ptr () -> m (Ptr ()) atomicTryLock :: MonadIO m => Ptr SpinLock -> m Bool atomicUnlock :: MonadIO m => Ptr SpinLock -> m () module SDL.Raw.Haptic hapticClose :: MonadIO m => Haptic -> m () hapticDestroyEffect :: MonadIO m => Haptic -> CInt -> m () hapticEffectSupported :: MonadIO m => Haptic -> Ptr HapticEffect -> m CInt hapticGetEffectStatus :: MonadIO m => Haptic -> CInt -> m CInt hapticIndex :: MonadIO m => Haptic -> m CInt hapticName :: MonadIO m => CInt -> m CString hapticNewEffect :: MonadIO m => Haptic -> Ptr HapticEffect -> m CInt hapticNumAxes :: MonadIO m => Haptic -> m CInt hapticNumEffects :: MonadIO m => Haptic -> m CInt hapticNumEffectsPlaying :: MonadIO m => Haptic -> m CInt hapticOpen :: MonadIO m => CInt -> m Haptic hapticOpenFromJoystick :: MonadIO m => Joystick -> m Haptic hapticOpenFromMouse :: MonadIO m => m Haptic hapticOpened :: MonadIO m => CInt -> m CInt hapticPause :: MonadIO m => Haptic -> m CInt hapticQuery :: MonadIO m => Haptic -> m CUInt hapticRumbleInit :: MonadIO m => Haptic -> m CInt hapticRumblePlay :: MonadIO m => Haptic -> CFloat -> Word32 -> m CInt hapticRumbleStop :: MonadIO m => Haptic -> m CInt hapticRumbleSupported :: MonadIO m => Haptic -> m CInt hapticRunEffect :: MonadIO m => Haptic -> CInt -> Word32 -> m CInt hapticSetAutocenter :: MonadIO m => Haptic -> CInt -> m CInt hapticSetGain :: MonadIO m => Haptic -> CInt -> m CInt hapticStopAll :: MonadIO m => Haptic -> m CInt hapticStopEffect :: MonadIO m => Haptic -> CInt -> m CInt hapticUnpause :: MonadIO m => Haptic -> m CInt hapticUpdateEffect :: MonadIO m => Haptic -> CInt -> Ptr HapticEffect -> m CInt joystickIsHaptic :: MonadIO m => Joystick -> m CInt mouseIsHaptic :: MonadIO m => m CInt numHaptics :: MonadIO m => m CInt module SDL.Raw.Filesystem getBasePath :: MonadIO m => m CString getPrefPath :: MonadIO m => CString -> CString -> m CString allocRW :: MonadIO m => m (Ptr RWops) freeRW :: MonadIO m => Ptr RWops -> m () rwFromConstMem :: MonadIO m => Ptr () -> CInt -> m (Ptr RWops) rwFromFP :: MonadIO m => Ptr () -> Bool -> m (Ptr RWops) rwFromFile :: MonadIO m => CString -> CString -> m (Ptr RWops) rwFromMem :: MonadIO m => Ptr () -> CInt -> m (Ptr RWops) rwClose :: MonadIO m => Ptr RWops -> m CInt rwRead :: MonadIO m => Ptr RWops -> Ptr () -> CSize -> CSize -> m CSize rwSeek :: MonadIO m => Ptr RWops -> Int64 -> CInt -> m Int64 rwTell :: MonadIO m => Ptr RWops -> m Int64 rwWrite :: MonadIO m => Ptr RWops -> Ptr () -> CSize -> CSize -> m CSize readBE16 :: MonadIO m => Ptr RWops -> m Word16 readBE32 :: MonadIO m => Ptr RWops -> m Word32 readBE64 :: MonadIO m => Ptr RWops -> m Word64 readLE16 :: MonadIO m => Ptr RWops -> m Word16 readLE32 :: MonadIO m => Ptr RWops -> m Word32 readLE64 :: MonadIO m => Ptr RWops -> m Word64 writeBE16 :: MonadIO m => Ptr RWops -> Word16 -> m CSize writeBE32 :: MonadIO m => Ptr RWops -> Word32 -> m CSize writeBE64 :: MonadIO m => Ptr RWops -> Word64 -> m CSize writeLE16 :: MonadIO m => Ptr RWops -> Word16 -> m CSize writeLE32 :: MonadIO m => Ptr RWops -> Word32 -> m CSize writeLE64 :: MonadIO m => Ptr RWops -> Word64 -> m CSize module SDL.Raw.Event addEventWatch :: MonadIO m => EventFilter -> Ptr () -> m () delEventWatch :: MonadIO m => EventFilter -> Ptr () -> m () eventState :: MonadIO m => Word32 -> CInt -> m Word8 filterEvents :: MonadIO m => EventFilter -> Ptr () -> m () flushEvent :: MonadIO m => Word32 -> m () flushEvents :: MonadIO m => Word32 -> Word32 -> m () getEventFilter :: MonadIO m => Ptr EventFilter -> Ptr (Ptr ()) -> m Bool getNumTouchDevices :: MonadIO m => m CInt getNumTouchFingers :: MonadIO m => TouchID -> m CInt getTouchDevice :: MonadIO m => CInt -> m TouchID getTouchFinger :: MonadIO m => TouchID -> CInt -> m (Ptr Finger) hasEvent :: MonadIO m => Word32 -> m Bool hasEvents :: MonadIO m => Word32 -> Word32 -> m Bool loadDollarTemplates :: MonadIO m => TouchID -> Ptr RWops -> m CInt peepEvents :: MonadIO m => Ptr Event -> CInt -> EventAction -> Word32 -> Word32 -> m CInt pollEvent :: MonadIO m => Ptr Event -> m CInt pumpEvents :: MonadIO m => m () pushEvent :: MonadIO m => Ptr Event -> m CInt quitRequested :: MonadIO m => m Bool recordGesture :: MonadIO m => TouchID -> m CInt registerEvents :: MonadIO m => CInt -> m Word32 saveAllDollarTemplates :: MonadIO m => Ptr RWops -> m CInt saveDollarTemplate :: MonadIO m => GestureID -> Ptr RWops -> m CInt setEventFilter :: MonadIO m => EventFilter -> Ptr () -> m () waitEvent :: MonadIO m => Ptr Event -> m CInt waitEventTimeout :: MonadIO m => Ptr Event -> CInt -> m CInt getKeyFromName :: MonadIO m => CString -> m Keycode getKeyFromScancode :: MonadIO m => Scancode -> m Keycode getKeyName :: MonadIO m => Keycode -> m CString getKeyboardFocus :: MonadIO m => m Window getKeyboardState :: MonadIO m => Ptr CInt -> m (Ptr Word8) getModState :: MonadIO m => m Keymod getScancodeFromKey :: MonadIO m => Keycode -> m Scancode getScancodeFromName :: MonadIO m => CString -> m Scancode getScancodeName :: MonadIO m => Scancode -> m CString hasScreenKeyboardSupport :: MonadIO m => m Bool isScreenKeyboardShown :: MonadIO m => Window -> m Bool isTextInputActive :: MonadIO m => m Bool setModState :: MonadIO m => Keymod -> m () setTextInputRect :: MonadIO m => Ptr Rect -> m () startTextInput :: MonadIO m => m () stopTextInput :: MonadIO m => m () captureMouse :: MonadIO m => Bool -> m CInt createColorCursor :: MonadIO m => Ptr Surface -> CInt -> CInt -> m Cursor createCursor :: MonadIO m => Ptr Word8 -> Ptr Word8 -> CInt -> CInt -> CInt -> CInt -> m Cursor createSystemCursor :: MonadIO m => SystemCursor -> m Cursor freeCursor :: MonadIO m => Cursor -> m () getCursor :: MonadIO m => m Cursor getDefaultCursor :: MonadIO m => m Cursor getGlobalMouseState :: MonadIO m => Ptr CInt -> Ptr CInt -> m Word32 getMouseFocus :: MonadIO m => m Window getMouseState :: MonadIO m => Ptr CInt -> Ptr CInt -> m Word32 getRelativeMouseMode :: MonadIO m => m Bool getRelativeMouseState :: MonadIO m => Ptr CInt -> Ptr CInt -> m Word32 setCursor :: MonadIO m => Cursor -> m () setRelativeMouseMode :: MonadIO m => Bool -> m CInt showCursor :: MonadIO m => CInt -> m CInt warpMouseGlobal :: MonadIO m => CInt -> CInt -> m CInt warpMouseInWindow :: MonadIO m => Window -> CInt -> CInt -> m () joystickClose :: MonadIO m => Joystick -> m () joystickCurrentPowerLevel :: MonadIO m => Joystick -> m JoystickPowerLevel joystickEventState :: MonadIO m => CInt -> m CInt joystickFromInstanceID :: MonadIO m => JoystickID -> m Joystick joystickGetAttached :: MonadIO m => Joystick -> m Bool joystickGetAxis :: MonadIO m => Joystick -> CInt -> m Int16 joystickGetBall :: MonadIO m => Joystick -> CInt -> Ptr CInt -> Ptr CInt -> m CInt joystickGetButton :: MonadIO m => Joystick -> CInt -> m Word8 joystickGetDeviceGUID :: MonadIO m => CInt -> m JoystickGUID joystickGetGUID :: MonadIO m => Joystick -> m JoystickGUID joystickGetGUIDFromString :: MonadIO m => CString -> m JoystickGUID joystickGetGUIDString :: MonadIO m => JoystickGUID -> CString -> CInt -> m () joystickGetHat :: MonadIO m => Joystick -> CInt -> m Word8 joystickInstanceID :: MonadIO m => Joystick -> m JoystickID joystickName :: MonadIO m => Joystick -> m CString joystickNameForIndex :: MonadIO m => CInt -> m CString joystickNumAxes :: MonadIO m => Joystick -> m CInt joystickNumBalls :: MonadIO m => Joystick -> m CInt joystickNumButtons :: MonadIO m => Joystick -> m CInt joystickNumHats :: MonadIO m => Joystick -> m CInt joystickOpen :: MonadIO m => CInt -> m Joystick joystickUpdate :: MonadIO m => m () numJoysticks :: MonadIO m => m CInt gameControllerAddMapping :: MonadIO m => CString -> m CInt gameControllerAddMappingsFromFile :: MonadIO m => CString -> m CInt gameControllerAddMappingsFromRW :: MonadIO m => Ptr RWops -> CInt -> m CInt gameControllerClose :: MonadIO m => GameController -> m () gameControllerEventState :: MonadIO m => CInt -> m CInt gameControllerFromInstanceID :: MonadIO m => JoystickID -> m GameController gameControllerGetAttached :: MonadIO m => GameController -> m Bool gameControllerGetAxis :: MonadIO m => GameController -> GameControllerAxis -> m Int16 gameControllerGetAxisFromString :: MonadIO m => CString -> m GameControllerAxis gameControllerGetBindForAxis :: MonadIO m => GameController -> GameControllerAxis -> m GameControllerButtonBind gameControllerGetBindForButton :: MonadIO m => GameController -> GameControllerButton -> m GameControllerButtonBind gameControllerGetButton :: MonadIO m => GameController -> GameControllerButton -> m Word8 gameControllerGetButtonFromString :: MonadIO m => CString -> m GameControllerButton gameControllerGetJoystick :: MonadIO m => GameController -> m Joystick gameControllerGetStringForAxis :: MonadIO m => GameControllerAxis -> m CString gameControllerGetStringForButton :: MonadIO m => GameControllerButton -> m CString gameControllerMapping :: MonadIO m => GameController -> m CString gameControllerMappingForGUID :: MonadIO m => JoystickGUID -> m CString gameControllerName :: MonadIO m => GameController -> m CString gameControllerNameForIndex :: MonadIO m => CInt -> m CString gameControllerOpen :: MonadIO m => CInt -> m GameController gameControllerUpdate :: MonadIO m => m () isGameController :: MonadIO m => CInt -> m Bool module SDL.Raw.Basic init :: MonadIO m => InitFlag -> m CInt initSubSystem :: MonadIO m => InitFlag -> m CInt quit :: MonadIO m => m () quitSubSystem :: MonadIO m => InitFlag -> m () setMainReady :: MonadIO m => m () wasInit :: MonadIO m => InitFlag -> m InitFlag free :: MonadIO m => Ptr () -> m () addHintCallback :: MonadIO m => CString -> HintCallback -> Ptr () -> m () clearHints :: MonadIO m => m () delHintCallback :: MonadIO m => CString -> HintCallback -> Ptr () -> m () getHint :: MonadIO m => CString -> m CString setHint :: MonadIO m => CString -> CString -> m Bool setHintWithPriority :: MonadIO m => CString -> CString -> HintPriority -> m Bool log :: CString -> IO () logCritical :: CInt -> CString -> IO () logDebug :: CInt -> CString -> IO () logError :: CInt -> CString -> IO () logGetOutputFunction :: MonadIO m => Ptr LogOutputFunction -> Ptr (Ptr ()) -> m () logGetPriority :: MonadIO m => CInt -> m LogPriority logInfo :: CInt -> CString -> IO () logMessage :: MonadIO m => CInt -> LogPriority -> CString -> m () logResetPriorities :: MonadIO m => m () logSetAllPriority :: MonadIO m => LogPriority -> m () logSetOutputFunction :: MonadIO m => LogOutputFunction -> Ptr () -> m () logSetPriority :: MonadIO m => CInt -> LogPriority -> m () logVerbose :: CInt -> CString -> IO () logWarn :: CInt -> CString -> IO () getRevision :: MonadIO m => m CString getRevisionNumber :: MonadIO m => m CInt getVersion :: MonadIO m => Ptr Version -> m () module SDL.Raw.Audio audioInit :: MonadIO m => CString -> m CInt audioQuit :: MonadIO m => m () buildAudioCVT :: MonadIO m => Ptr AudioCVT -> AudioFormat -> Word8 -> CInt -> AudioFormat -> Word8 -> CInt -> m CInt clearQueuedAudio :: MonadIO m => AudioDeviceID -> m () closeAudio :: MonadIO m => m () closeAudioDevice :: MonadIO m => AudioDeviceID -> m () convertAudio :: MonadIO m => Ptr AudioCVT -> m CInt freeWAV :: MonadIO m => Ptr Word8 -> m () getAudioDeviceName :: MonadIO m => CInt -> CInt -> m CString getAudioDeviceStatus :: MonadIO m => AudioDeviceID -> m AudioStatus getAudioDriver :: MonadIO m => CInt -> m CString getAudioStatus :: MonadIO m => m AudioStatus getCurrentAudioDriver :: MonadIO m => m CString getNumAudioDevices :: MonadIO m => CInt -> m CInt getNumAudioDrivers :: MonadIO m => m CInt getQueuedAudioSize :: MonadIO m => AudioDeviceID -> m Word32 loadWAV :: MonadIO m => CString -> Ptr AudioSpec -> Ptr (Ptr Word8) -> Ptr Word32 -> m (Ptr AudioSpec) loadWAV_RW :: MonadIO m => Ptr RWops -> CInt -> Ptr AudioSpec -> Ptr (Ptr Word8) -> Ptr Word32 -> m (Ptr AudioSpec) lockAudio :: MonadIO m => m () lockAudioDevice :: MonadIO m => AudioDeviceID -> m () mixAudio :: MonadIO m => Ptr Word8 -> Ptr Word8 -> Word32 -> CInt -> m () mixAudioFormat :: MonadIO m => Ptr Word8 -> Ptr Word8 -> AudioFormat -> Word32 -> CInt -> m () openAudio :: MonadIO m => Ptr AudioSpec -> Ptr AudioSpec -> m CInt openAudioDevice :: MonadIO m => CString -> CInt -> Ptr AudioSpec -> Ptr AudioSpec -> CInt -> m AudioDeviceID pauseAudio :: MonadIO m => CInt -> m () pauseAudioDevice :: MonadIO m => AudioDeviceID -> CInt -> m () queueAudio :: MonadIO m => AudioDeviceID -> Ptr () -> Word32 -> m CInt unlockAudio :: MonadIO m => m () unlockAudioDevice :: MonadIO m => AudioDeviceID -> m () module SDL.Raw.Video createWindow :: MonadIO m => CString -> CInt -> CInt -> CInt -> CInt -> Word32 -> m Window createWindowAndRenderer :: MonadIO m => CInt -> CInt -> Word32 -> Ptr Window -> Ptr Renderer -> m CInt createWindowFrom :: MonadIO m => Ptr () -> m Window destroyWindow :: MonadIO m => Window -> m () disableScreenSaver :: MonadIO m => m () enableScreenSaver :: MonadIO m => m () glBindTexture :: MonadIO m => Texture -> Ptr CFloat -> Ptr CFloat -> m CInt glCreateContext :: MonadIO m => Window -> m GLContext glDeleteContext :: MonadIO m => GLContext -> m () glExtensionSupported :: MonadIO m => CString -> m Bool glGetAttribute :: MonadIO m => GLattr -> Ptr CInt -> m CInt glGetCurrentContext :: MonadIO m => m GLContext glGetCurrentWindow :: MonadIO m => m Window glGetDrawableSize :: MonadIO m => Window -> Ptr CInt -> Ptr CInt -> m () glGetProcAddress :: MonadIO m => CString -> m (Ptr ()) glGetSwapInterval :: MonadIO m => m CInt glLoadLibrary :: MonadIO m => CString -> m CInt glMakeCurrent :: MonadIO m => Window -> GLContext -> m CInt glResetAttributes :: MonadIO m => m () glSetAttribute :: MonadIO m => GLattr -> CInt -> m CInt glSetSwapInterval :: MonadIO m => CInt -> m CInt glSwapWindow :: MonadIO m => Window -> m () glUnbindTexture :: MonadIO m => Texture -> m CInt glUnloadLibrary :: MonadIO m => m () getClosestDisplayMode :: MonadIO m => CInt -> Ptr DisplayMode -> Ptr DisplayMode -> m (Ptr DisplayMode) getCurrentDisplayMode :: MonadIO m => CInt -> Ptr DisplayMode -> m CInt getCurrentVideoDriver :: MonadIO m => m CString getDesktopDisplayMode :: MonadIO m => CInt -> Ptr DisplayMode -> m CInt getDisplayBounds :: MonadIO m => CInt -> Ptr Rect -> m CInt getDisplayDPI :: MonadIO m => CInt -> Ptr CFloat -> Ptr CFloat -> Ptr CFloat -> m CInt getDisplayMode :: MonadIO m => CInt -> CInt -> Ptr DisplayMode -> m CInt getDisplayName :: MonadIO m => CInt -> m CString getGrabbedWindow :: MonadIO m => m Window getNumDisplayModes :: MonadIO m => CInt -> m CInt getNumVideoDisplays :: MonadIO m => m CInt getNumVideoDrivers :: MonadIO m => m CInt getVideoDriver :: MonadIO m => CInt -> m CString getWindowBrightness :: MonadIO m => Window -> m CFloat getWindowData :: MonadIO m => Window -> CString -> m (Ptr ()) getWindowDisplayIndex :: MonadIO m => Window -> m CInt getWindowDisplayMode :: MonadIO m => Window -> Ptr DisplayMode -> m CInt getWindowFlags :: MonadIO m => Window -> m Word32 getWindowFromID :: MonadIO m => Word32 -> m Window getWindowGammaRamp :: MonadIO m => Window -> Ptr Word16 -> Ptr Word16 -> Ptr Word16 -> m CInt getWindowGrab :: MonadIO m => Window -> m Bool getWindowID :: MonadIO m => Window -> m Word32 getWindowMaximumSize :: MonadIO m => Window -> Ptr CInt -> Ptr CInt -> m () getWindowMinimumSize :: MonadIO m => Window -> Ptr CInt -> Ptr CInt -> m () getWindowPixelFormat :: MonadIO m => Window -> m Word32 getWindowPosition :: MonadIO m => Window -> Ptr CInt -> Ptr CInt -> m () getWindowSize :: MonadIO m => Window -> Ptr CInt -> Ptr CInt -> m () getWindowSurface :: MonadIO m => Window -> m (Ptr Surface) getWindowTitle :: MonadIO m => Window -> m CString hideWindow :: MonadIO m => Window -> m () isScreenSaverEnabled :: MonadIO m => m Bool maximizeWindow :: MonadIO m => Window -> m () minimizeWindow :: MonadIO m => Window -> m () raiseWindow :: MonadIO m => Window -> m () restoreWindow :: MonadIO m => Window -> m () setWindowBordered :: MonadIO m => Window -> Bool -> m () setWindowBrightness :: MonadIO m => Window -> CFloat -> m CInt setWindowData :: MonadIO m => Window -> CString -> Ptr () -> m (Ptr ()) setWindowDisplayMode :: MonadIO m => Window -> Ptr DisplayMode -> m CInt setWindowFullscreen :: MonadIO m => Window -> Word32 -> m CInt setWindowGammaRamp :: MonadIO m => Window -> Ptr Word16 -> Ptr Word16 -> Ptr Word16 -> m CInt setWindowGrab :: MonadIO m => Window -> Bool -> m () setWindowIcon :: MonadIO m => Window -> Ptr Surface -> m () setWindowMaximumSize :: MonadIO m => Window -> CInt -> CInt -> m () setWindowMinimumSize :: MonadIO m => Window -> CInt -> CInt -> m () setWindowPosition :: MonadIO m => Window -> CInt -> CInt -> m () setWindowSize :: MonadIO m => Window -> CInt -> CInt -> m () setWindowTitle :: MonadIO m => Window -> CString -> m () showMessageBox :: MonadIO m => Ptr MessageBoxData -> Ptr CInt -> m CInt showSimpleMessageBox :: MonadIO m => Word32 -> CString -> CString -> Window -> m CInt showWindow :: MonadIO m => Window -> m () updateWindowSurface :: MonadIO m => Window -> m CInt updateWindowSurfaceRects :: MonadIO m => Window -> Ptr Rect -> CInt -> m CInt videoInit :: MonadIO m => CString -> m CInt videoQuit :: MonadIO m => m () createRenderer :: MonadIO m => Window -> CInt -> Word32 -> m Renderer createSoftwareRenderer :: MonadIO m => Ptr Surface -> m Renderer createTexture :: MonadIO m => Renderer -> Word32 -> CInt -> CInt -> CInt -> m Texture createTextureFromSurface :: MonadIO m => Renderer -> Ptr Surface -> m Texture destroyRenderer :: MonadIO m => Renderer -> m () destroyTexture :: MonadIO m => Texture -> m () getNumRenderDrivers :: MonadIO m => m CInt getRenderDrawBlendMode :: MonadIO m => Renderer -> Ptr BlendMode -> m Int getRenderDrawColor :: MonadIO m => Renderer -> Ptr Word8 -> Ptr Word8 -> Ptr Word8 -> Ptr Word8 -> m CInt getRenderDriverInfo :: MonadIO m => CInt -> Ptr RendererInfo -> m CInt getRenderTarget :: MonadIO m => Renderer -> m Texture getRenderer :: MonadIO m => Window -> m Renderer getRendererInfo :: MonadIO m => Renderer -> Ptr RendererInfo -> m CInt getRendererOutputSize :: MonadIO m => Renderer -> Ptr CInt -> Ptr CInt -> m CInt getTextureAlphaMod :: MonadIO m => Texture -> Ptr Word8 -> m CInt getTextureBlendMode :: MonadIO m => Texture -> Ptr BlendMode -> m CInt getTextureColorMod :: MonadIO m => Texture -> Ptr Word8 -> Ptr Word8 -> Ptr Word8 -> m CInt lockTexture :: MonadIO m => Texture -> Ptr Rect -> Ptr (Ptr ()) -> Ptr CInt -> m CInt queryTexture :: MonadIO m => Texture -> Ptr Word32 -> Ptr CInt -> Ptr CInt -> Ptr CInt -> m CInt renderClear :: MonadIO m => Renderer -> m CInt renderCopy :: MonadIO m => Renderer -> Texture -> Ptr Rect -> Ptr Rect -> m CInt renderCopyEx :: MonadIO m => Renderer -> Texture -> Ptr Rect -> Ptr Rect -> CDouble -> Ptr Point -> RendererFlip -> m CInt renderDrawLine :: MonadIO m => Renderer -> CInt -> CInt -> CInt -> CInt -> m CInt renderDrawLines :: MonadIO m => Renderer -> Ptr Point -> CInt -> m CInt renderDrawPoint :: MonadIO m => Renderer -> CInt -> CInt -> m CInt renderDrawPoints :: MonadIO m => Renderer -> Ptr Point -> CInt -> m CInt renderDrawRect :: MonadIO m => Renderer -> Ptr Rect -> m CInt renderDrawRects :: MonadIO m => Renderer -> Ptr Rect -> CInt -> m CInt renderFillRect :: MonadIO m => Renderer -> Ptr Rect -> m CInt renderFillRects :: MonadIO m => Renderer -> Ptr Rect -> CInt -> m CInt renderGetClipRect :: MonadIO m => Renderer -> Ptr Rect -> m () renderGetLogicalSize :: MonadIO m => Renderer -> Ptr CInt -> Ptr CInt -> m () renderGetScale :: MonadIO m => Renderer -> Ptr CFloat -> Ptr CFloat -> m () renderGetViewport :: MonadIO m => Renderer -> Ptr Rect -> m () renderIsClipEnabled :: MonadIO m => Renderer -> m Bool renderPresent :: MonadIO m => Renderer -> m () renderReadPixels :: MonadIO m => Renderer -> Ptr Rect -> Word32 -> Ptr () -> CInt -> m CInt renderSetClipRect :: MonadIO m => Renderer -> Ptr Rect -> m CInt renderSetLogicalSize :: MonadIO m => Renderer -> CInt -> CInt -> m CInt renderSetScale :: MonadIO m => Renderer -> CFloat -> CFloat -> m CInt renderSetViewport :: MonadIO m => Renderer -> Ptr Rect -> m CInt renderTargetSupported :: MonadIO m => Renderer -> m Bool setRenderDrawBlendMode :: MonadIO m => Renderer -> BlendMode -> m CInt setRenderDrawColor :: MonadIO m => Renderer -> Word8 -> Word8 -> Word8 -> Word8 -> m CInt setRenderTarget :: MonadIO m => Renderer -> Texture -> m CInt setTextureAlphaMod :: MonadIO m => Texture -> Word8 -> m CInt setTextureBlendMode :: MonadIO m => Texture -> BlendMode -> m CInt setTextureColorMod :: MonadIO m => Texture -> Word8 -> Word8 -> Word8 -> m CInt unlockTexture :: MonadIO m => Texture -> m () updateTexture :: MonadIO m => Texture -> Ptr Rect -> Ptr () -> CInt -> m CInt updateYUVTexture :: MonadIO m => Texture -> Ptr Rect -> Ptr Word8 -> CInt -> Ptr Word8 -> CInt -> Ptr Word8 -> CInt -> m CInt allocFormat :: MonadIO m => Word32 -> m (Ptr PixelFormat) allocPalette :: MonadIO m => CInt -> m (Ptr Palette) calculateGammaRamp :: MonadIO m => CFloat -> Ptr Word16 -> m () freeFormat :: MonadIO m => Ptr PixelFormat -> m () freePalette :: MonadIO m => Ptr Palette -> m () getPixelFormatName :: MonadIO m => Word32 -> m CString getRGB :: MonadIO m => Word32 -> Ptr PixelFormat -> Ptr Word8 -> Ptr Word8 -> Ptr Word8 -> m () getRGBA :: MonadIO m => Word32 -> Ptr PixelFormat -> Ptr Word8 -> Ptr Word8 -> Ptr Word8 -> Ptr Word8 -> m () mapRGB :: MonadIO m => Ptr PixelFormat -> Word8 -> Word8 -> Word8 -> m Word32 mapRGBA :: MonadIO m => Ptr PixelFormat -> Word8 -> Word8 -> Word8 -> Word8 -> m Word32 masksToPixelFormatEnum :: MonadIO m => CInt -> Word32 -> Word32 -> Word32 -> Word32 -> m Word32 pixelFormatEnumToMasks :: MonadIO m => Word32 -> Ptr CInt -> Ptr Word32 -> Ptr Word32 -> Ptr Word32 -> Ptr Word32 -> m Bool setPaletteColors :: MonadIO m => Ptr Palette -> Ptr Color -> CInt -> CInt -> m CInt setPixelFormatPalette :: MonadIO m => Ptr PixelFormat -> Ptr Palette -> m CInt enclosePoints :: MonadIO m => Ptr Point -> CInt -> Ptr Rect -> Ptr Rect -> m Bool hasIntersection :: MonadIO m => Ptr Rect -> Ptr Rect -> m Bool intersectRect :: MonadIO m => Ptr Rect -> Ptr Rect -> Ptr Rect -> m Bool intersectRectAndLine :: MonadIO m => Ptr Rect -> Ptr CInt -> Ptr CInt -> Ptr CInt -> Ptr CInt -> m Bool unionRect :: MonadIO m => Ptr Rect -> Ptr Rect -> Ptr Rect -> m () blitScaled :: MonadIO m => Ptr Surface -> Ptr Rect -> Ptr Surface -> Ptr Rect -> m CInt blitSurface :: MonadIO m => Ptr Surface -> Ptr Rect -> Ptr Surface -> Ptr Rect -> m CInt convertPixels :: MonadIO m => CInt -> CInt -> Word32 -> Ptr () -> CInt -> Word32 -> Ptr () -> CInt -> m CInt convertSurface :: MonadIO m => Ptr Surface -> Ptr PixelFormat -> Word32 -> m (Ptr Surface) convertSurfaceFormat :: MonadIO m => Ptr Surface -> Word32 -> Word32 -> m (Ptr Surface) createRGBSurface :: MonadIO m => Word32 -> CInt -> CInt -> CInt -> Word32 -> Word32 -> Word32 -> Word32 -> m (Ptr Surface) createRGBSurfaceFrom :: MonadIO m => Ptr () -> CInt -> CInt -> CInt -> CInt -> Word32 -> Word32 -> Word32 -> Word32 -> m (Ptr Surface) fillRect :: MonadIO m => Ptr Surface -> Ptr Rect -> Word32 -> m CInt fillRects :: MonadIO m => Ptr Surface -> Ptr Rect -> CInt -> Word32 -> m CInt freeSurface :: MonadIO m => Ptr Surface -> m () getClipRect :: MonadIO m => Ptr Surface -> Ptr Rect -> m () getColorKey :: MonadIO m => Ptr Surface -> Ptr Word32 -> m CInt getSurfaceAlphaMod :: MonadIO m => Ptr Surface -> Ptr Word8 -> m CInt getSurfaceBlendMode :: MonadIO m => Ptr Surface -> Ptr BlendMode -> m CInt getSurfaceColorMod :: MonadIO m => Ptr Surface -> Ptr Word8 -> Ptr Word8 -> Ptr Word8 -> m CInt loadBMP :: MonadIO m => CString -> m (Ptr Surface) loadBMP_RW :: MonadIO m => Ptr RWops -> CInt -> m (Ptr Surface) lockSurface :: MonadIO m => Ptr Surface -> m CInt lowerBlit :: MonadIO m => Ptr Surface -> Ptr Rect -> Ptr Surface -> Ptr Rect -> m CInt lowerBlitScaled :: MonadIO m => Ptr Surface -> Ptr Rect -> Ptr Surface -> Ptr Rect -> m CInt saveBMP :: MonadIO m => Ptr Surface -> CString -> m CInt saveBMP_RW :: MonadIO m => Ptr Surface -> Ptr RWops -> CInt -> m CInt setClipRect :: MonadIO m => Ptr Surface -> Ptr Rect -> m Bool setColorKey :: MonadIO m => Ptr Surface -> CInt -> Word32 -> m CInt setSurfaceAlphaMod :: MonadIO m => Ptr Surface -> Word8 -> m CInt setSurfaceBlendMode :: MonadIO m => Ptr Surface -> BlendMode -> m CInt setSurfaceColorMod :: MonadIO m => Ptr Surface -> Word8 -> Word8 -> Word8 -> m CInt setSurfacePalette :: MonadIO m => Ptr Surface -> Ptr Palette -> m CInt setSurfaceRLE :: MonadIO m => Ptr Surface -> CInt -> m CInt unlockSurface :: MonadIO m => Ptr Surface -> m () getWindowWMInfo :: MonadIO m => Window -> SysWMinfo -> m Bool getClipboardText :: MonadIO m => m CString hasClipboardText :: MonadIO m => m Bool setClipboardText :: MonadIO m => CString -> m CInt -- | Raw low-level FFI bindings to the sdl2 C library. Ease of use is not a -- design factor, use SDL instead if you can. module SDL.Raw module SDL.Power -- | Current power supply details. -- -- Throws SDLException if the current power state can not be -- determined. -- -- See SDL_GetPowerInfo for C documentation. getPowerInfo :: (Functor m, MonadIO m) => m PowerState -- | Information about the power supply for the user's environment data PowerState -- | The user is on a battery powered device. See BatteryState for -- charge information, and Charge for charge information Battery :: BatteryState -> Charge -> PowerState -- | The user is on a device connected to the mains. Mains :: PowerState -- | SDL could not determine the power for the device. UnknownPowerState :: PowerState -- | Information on battery consumption for battery powered devices data BatteryState -- | The battery is currently being drained. Draining :: BatteryState -- | The battery is fully charged. Charged :: BatteryState -- | The device is plugged in and the battery is charging. Charging :: BatteryState -- | Information about how much charge a battery has. data Charge Charge :: Maybe CInt -> Maybe CInt -> Charge -- | How many seconds of battery life is left [chargeSecondsLeft] :: Charge -> Maybe CInt -- | The percentage of battery charged [chargePercent] :: Charge -> Maybe CInt instance GHC.Show.Show SDL.Power.PowerState instance GHC.Read.Read SDL.Power.PowerState instance GHC.Classes.Ord SDL.Power.PowerState instance GHC.Generics.Generic SDL.Power.PowerState instance GHC.Classes.Eq SDL.Power.PowerState instance GHC.Show.Show SDL.Power.Charge instance GHC.Read.Read SDL.Power.Charge instance GHC.Classes.Ord SDL.Power.Charge instance GHC.Generics.Generic SDL.Power.Charge instance GHC.Classes.Eq SDL.Power.Charge instance GHC.Show.Show SDL.Power.BatteryState instance GHC.Read.Read SDL.Power.BatteryState instance GHC.Classes.Ord SDL.Power.BatteryState instance GHC.Generics.Generic SDL.Power.BatteryState instance GHC.Classes.Eq SDL.Power.BatteryState instance GHC.Enum.Enum SDL.Power.BatteryState instance Data.Data.Data SDL.Power.BatteryState instance GHC.Enum.Bounded SDL.Power.BatteryState module SDL.Internal.Types newtype Joystick Joystick :: Joystick -> Joystick [joystickPtr] :: Joystick -> Joystick newtype Window Window :: (Window) -> Window -- | An SDL rendering device. This can be created with -- createRenderer. newtype Renderer Renderer :: Renderer -> Renderer instance GHC.Show.Show SDL.Internal.Types.Renderer instance GHC.Classes.Ord SDL.Internal.Types.Renderer instance GHC.Generics.Generic SDL.Internal.Types.Renderer instance GHC.Classes.Eq SDL.Internal.Types.Renderer instance Data.Data.Data SDL.Internal.Types.Renderer instance GHC.Show.Show SDL.Internal.Types.Window instance GHC.Classes.Ord SDL.Internal.Types.Window instance GHC.Generics.Generic SDL.Internal.Types.Window instance GHC.Classes.Eq SDL.Internal.Types.Window instance Data.Data.Data SDL.Internal.Types.Window instance GHC.Show.Show SDL.Internal.Types.Joystick instance GHC.Classes.Ord SDL.Internal.Types.Joystick instance GHC.Generics.Generic SDL.Internal.Types.Joystick instance GHC.Classes.Eq SDL.Internal.Types.Joystick instance Data.Data.Data SDL.Internal.Types.Joystick module SDL.Input.Keyboard -- | Get the current key modifier state for the keyboard. The key modifier -- state is a mask special keys that are held down. -- -- See SDL_GetModState for C documentation. getModState :: (Functor m, MonadIO m) => m KeyModifier -- | Information about which keys are currently held down. Use -- getModState to generate this information. data KeyModifier KeyModifier :: Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> KeyModifier [keyModifierLeftShift] :: KeyModifier -> Bool [keyModifierRightShift] :: KeyModifier -> Bool [keyModifierLeftCtrl] :: KeyModifier -> Bool [keyModifierRightCtrl] :: KeyModifier -> Bool [keyModifierLeftAlt] :: KeyModifier -> Bool [keyModifierRightAlt] :: KeyModifier -> Bool [keyModifierLeftGUI] :: KeyModifier -> Bool [keyModifierRightGUI] :: KeyModifier -> Bool [keyModifierNumLock] :: KeyModifier -> Bool [keyModifierCapsLock] :: KeyModifier -> Bool [keyModifierAltGr] :: KeyModifier -> Bool -- | Get a snapshot of the current state of the keyboard. -- -- This computation generates a mapping from Scancode to -- Bool - evaluating the function at specific Scancodes -- will inform you as to whether or not that key was held down when -- getKeyboardState was called. -- -- See SDL_GetKeyboardState for C documentation. getKeyboardState :: MonadIO m => m (Scancode -> Bool) -- | Set the rectangle used to type text inputs and start accepting text -- input events. -- -- See SDL_StartTextInput for C documentation. startTextInput :: MonadIO m => Rect -> m () -- | Stop receiving any text input events. -- -- See SDL_StopTextInput for C documentation. stopTextInput :: MonadIO m => m () -- | Check whether the platform has screen keyboard support. -- -- See SDL_HasScreenKeyboardSupport for C documentation. hasScreenKeyboardSupport :: MonadIO m => m Bool -- | Check whether the screen keyboard is shown for the given window. -- -- See SDL_IsScreenKeyboardShown for C documentation. isScreenKeyboardShown :: MonadIO m => Window -> m Bool -- | Get a human-readable name for a scancode. If the scancode doesn't have -- a name this function returns the empty string. -- -- See SDL_GetScancodeName for C documentation. getScancodeName :: MonadIO m => Scancode -> m String newtype Scancode Scancode :: Word32 -> Scancode [unwrapScancode] :: Scancode -> Word32 newtype Keycode Keycode :: Int32 -> Keycode [unwrapKeycode] :: Keycode -> Int32 -- | Information about a key press or key release event. data Keysym Keysym :: Scancode -> Keycode -> KeyModifier -> Keysym -- | The keyboard Scancode [keysymScancode] :: Keysym -> Scancode -- | SDL's virtual key representation for this key [keysymKeycode] :: Keysym -> Keycode -- | A set of modifiers that were held at the time this data was generated [keysymModifier] :: Keysym -> KeyModifier instance GHC.Show.Show SDL.Input.Keyboard.Keysym instance GHC.Read.Read SDL.Input.Keyboard.Keysym instance GHC.Classes.Ord SDL.Input.Keyboard.Keysym instance GHC.Generics.Generic SDL.Input.Keyboard.Keysym instance GHC.Classes.Eq SDL.Input.Keyboard.Keysym instance Data.Data.Data SDL.Input.Keyboard.Keysym instance GHC.Show.Show SDL.Input.Keyboard.KeyModifier instance GHC.Generics.Generic SDL.Input.Keyboard.KeyModifier instance GHC.Read.Read SDL.Input.Keyboard.KeyModifier instance GHC.Classes.Ord SDL.Input.Keyboard.KeyModifier instance GHC.Classes.Eq SDL.Input.Keyboard.KeyModifier instance Data.Data.Data SDL.Input.Keyboard.KeyModifier instance SDL.Internal.Numbered.FromNumber SDL.Input.Keyboard.KeyModifier GHC.Word.Word32 instance SDL.Internal.Numbered.ToNumber SDL.Input.Keyboard.KeyModifier GHC.Word.Word32 module SDL.Internal.Exception fromC :: Show a => Text -> Text -> (a -> Maybe b) -> a -> b getError :: MonadIO m => m Text throwIf :: MonadIO m => (a -> Bool) -> Text -> Text -> m a -> m a throwIf_ :: MonadIO m => (a -> Bool) -> Text -> Text -> m a -> m () throwIf0 :: (Eq a, MonadIO m, Num a) => Text -> Text -> m a -> m a throwIfNeg :: (MonadIO m, Num a, Ord a) => Text -> Text -> m a -> m a throwIfNeg_ :: (MonadIO m, Num a, Ord a) => Text -> Text -> m a -> m () throwIfNot0 :: (Eq a, MonadIO m, Num a) => Text -> Text -> m a -> m a throwIfNot0_ :: (Eq a, MonadIO m, Num a) => Text -> Text -> m a -> m () throwIfNull :: (MonadIO m) => Text -> Text -> m (Ptr a) -> m (Ptr a) module SDL.Filesystem -- | An absolute path to the application data directory. -- -- The path is guaranteed to end with a path separator. -- -- Throws SDLException on failure, or if the platform does not -- implement this functionality. getBasePath :: MonadIO m => m Text -- | A path to a unique per user and per application directory for the -- given organization and application name, intended for writing -- preferences and other personal files. -- -- The path is guaranteed to end with a path separator. -- -- You should assume the path returned by this function is the only safe -- place to write files to. -- -- Throws SDLException on failure. getPrefPath :: MonadIO m => Text -> Text -> m Text -- | SDL.Audio provides a high-level API to SDL's audio device -- capabilities. module SDL.Audio -- | An open audio device. These can be created via openAudioDevice -- and should be closed with closeAudioDevice data AudioDevice -- | Attempt to open the closest matching AudioDevice, as specified -- by the given OpenDeviceSpec. -- -- See SDL_OpenAudioDevice for C documentation. openAudioDevice :: MonadIO m => OpenDeviceSpec -> m (AudioDevice, AudioSpec) -- | See SDL_CloseAudioDevice for C documentation. closeAudioDevice :: MonadIO m => AudioDevice -> m () -- | A specification to openAudioDevice, indicating the desired -- output format. Note that many of these properties are -- Changeable, meaning that you can choose whether or not SDL -- should interpret your specification as an unbreakable request -- (Mandate), or as an approximation Desire. data OpenDeviceSpec OpenDeviceSpec :: !(Changeable CInt) -> !(Changeable (AudioFormat sampleType)) -> !(Changeable Channels) -> !Word16 -> forall actualSampleType. AudioFormat actualSampleType -> IOVector actualSampleType -> IO () -> !AudioDeviceUsage -> !(Maybe Text) -> OpenDeviceSpec -- | The output audio frequency in herts. [openDeviceFreq] :: OpenDeviceSpec -> !(Changeable CInt) -- | The format of audio that will be sampled from the output buffer. [openDeviceFormat] :: OpenDeviceSpec -> !(Changeable (AudioFormat sampleType)) -- | The amount of audio channels. [openDeviceChannels] :: OpenDeviceSpec -> !(Changeable Channels) -- | Output audio buffer size in samples. This should be a power of 2. [openDeviceSamples] :: OpenDeviceSpec -> !Word16 -- | A callback to invoke whenever new sample data is required. The -- callback will be passed a single MVector that must be filled -- with audio data. [openDeviceCallback] :: OpenDeviceSpec -> forall actualSampleType. AudioFormat actualSampleType -> IOVector actualSampleType -> IO () -- | How you intend to use the opened AudioDevice - either for -- outputting or capturing audio. [openDeviceUsage] :: OpenDeviceSpec -> !AudioDeviceUsage -- | The name of the AudioDevice that should be opened. If -- Nothing, any suitable AudioDevice will be used. [openDeviceName] :: OpenDeviceSpec -> !(Maybe Text) -- | How you intend to use an AudioDevice data AudioDeviceUsage -- | The device will be used for sample playback. ForPlayback :: AudioDeviceUsage -- | The device will be used for sample capture. ForCapture :: AudioDeviceUsage -- | How many channels audio should be played on data Channels -- | A single speaker configuration Mono :: Channels -- | A traditional left/right stereo system Stereo :: Channels Quad :: Channels -- |
-- AudioFormat UnsignedInteger Sample8Bit Native :: AudioFormat Word8 ---- -- Indicating that an 8-bit audio format in the platforms native -- endianness uses a buffer of Word8 values. data AudioFormat sampleType [Signed8BitAudio] :: AudioFormat Int8 [Unsigned8BitAudio] :: AudioFormat Word8 [Signed16BitLEAudio] :: AudioFormat Int16 [Signed16BitBEAudio] :: AudioFormat Int16 [Signed16BitNativeAudio] :: AudioFormat Int16 [Unsigned16BitLEAudio] :: AudioFormat Word16 [Unsigned16BitBEAudio] :: AudioFormat Word16 [Unsigned16BitNativeAudio] :: AudioFormat Word16 [Signed32BitLEAudio] :: AudioFormat Int32 [Signed32BitBEAudio] :: AudioFormat Int32 [Signed32BitNativeAudio] :: AudioFormat Int32 [FloatingLEAudio] :: AudioFormat Float [FloatingBEAudio] :: AudioFormat Float [FloatingNativeAudio] :: AudioFormat Float -- | Enumerate all AudioDevices attached to this system, that can be -- used as specified by the given AudioDeviceUsage. SDL cannot -- always guarantee that this list can be produced, in which case -- Nothing will be returned. getAudioDeviceNames :: MonadIO m => AudioDeviceUsage -> m (Maybe (Vector Text)) -- | AudioSpec is the concrete specification of how an -- AudioDevice was sucessfully opened. Unlike -- OpenDeviceSpec, which specifies what you want, -- AudioSpec specifies what you have. data AudioSpec -- | DSP frequency (samples per second) audioSpecFreq :: AudioSpec -> CInt -- | Audio data format audioSpecFormat :: AudioSpec -> (AudioFormat sampleType) -- | Number of separate sound channels audioSpecChannels :: AudioSpec -> Channels -- | Calculated udio buffer silence value audioSpecSilence :: AudioSpec -> Word8 -- | Calculated audio buffer size in bytes audioSpecSize :: AudioSpec -> Word32 -- | The function to call when the audio device needs more data audioSpecCallback :: AudioSpec -> AudioFormat sampleType -> IOVector sampleType -> IO () -- | Obtain a list of all possible audio drivers for this system. These -- drivers can be used to specificially initialize the audio system. getAudioDrivers :: MonadIO m => m (Vector AudioDriver) -- | Query SDL for the name of the currently initialized audio driver, if -- possible. This will return Nothing if no driver has been -- initialized. currentAudioDriver :: MonadIO m => m (Maybe Text) -- | An abstract description of an audio driver on the host machine. data AudioDriver -- | Get the human readable name of an AudioDriver audioDriverName :: AudioDriver -> Text -- | Explicitly initialize the audio system against a specific -- AudioDriver. Note that most users will not need to do this, as -- the normal initialization routines will already take care of this for -- you. audioInit :: MonadIO m => AudioDriver -> m () instance GHC.Show.Show SDL.Audio.AudioDriver instance GHC.Classes.Eq SDL.Audio.AudioDriver instance GHC.Show.Show SDL.Audio.AudioDeviceStatus instance GHC.Generics.Generic SDL.Audio.AudioDeviceStatus instance Data.Data.Data SDL.Audio.AudioDeviceStatus instance GHC.Read.Read SDL.Audio.AudioDeviceStatus instance GHC.Classes.Ord SDL.Audio.AudioDeviceStatus instance GHC.Classes.Eq SDL.Audio.AudioDeviceStatus instance GHC.Enum.Enum SDL.Audio.AudioDeviceStatus instance GHC.Enum.Bounded SDL.Audio.AudioDeviceStatus instance GHC.Show.Show SDL.Audio.PlaybackState instance GHC.Generics.Generic SDL.Audio.PlaybackState instance Data.Data.Data SDL.Audio.PlaybackState instance GHC.Read.Read SDL.Audio.PlaybackState instance GHC.Classes.Ord SDL.Audio.PlaybackState instance GHC.Classes.Eq SDL.Audio.PlaybackState instance GHC.Enum.Enum SDL.Audio.PlaybackState instance GHC.Enum.Bounded SDL.Audio.PlaybackState instance GHC.Show.Show SDL.Audio.LockState instance GHC.Read.Read SDL.Audio.LockState instance GHC.Classes.Ord SDL.Audio.LockState instance GHC.Generics.Generic SDL.Audio.LockState instance GHC.Classes.Eq SDL.Audio.LockState instance GHC.Enum.Enum SDL.Audio.LockState instance Data.Data.Data SDL.Audio.LockState instance GHC.Enum.Bounded SDL.Audio.LockState instance Data.Traversable.Traversable SDL.Audio.Changeable instance GHC.Show.Show a => GHC.Show.Show (SDL.Audio.Changeable a) instance GHC.Read.Read a => GHC.Read.Read (SDL.Audio.Changeable a) instance GHC.Generics.Generic (SDL.Audio.Changeable a) instance GHC.Classes.Eq a => GHC.Classes.Eq (SDL.Audio.Changeable a) instance GHC.Base.Functor SDL.Audio.Changeable instance Data.Foldable.Foldable SDL.Audio.Changeable instance Data.Data.Data a => Data.Data.Data (SDL.Audio.Changeable a) instance GHC.Show.Show SDL.Audio.AudioDeviceUsage instance GHC.Read.Read SDL.Audio.AudioDeviceUsage instance GHC.Classes.Ord SDL.Audio.AudioDeviceUsage instance GHC.Generics.Generic SDL.Audio.AudioDeviceUsage instance GHC.Classes.Eq SDL.Audio.AudioDeviceUsage instance GHC.Enum.Enum SDL.Audio.AudioDeviceUsage instance Data.Data.Data SDL.Audio.AudioDeviceUsage instance GHC.Enum.Bounded SDL.Audio.AudioDeviceUsage instance GHC.Show.Show SDL.Audio.Channels instance GHC.Read.Read SDL.Audio.Channels instance GHC.Classes.Ord SDL.Audio.Channels instance GHC.Generics.Generic SDL.Audio.Channels instance GHC.Classes.Eq SDL.Audio.Channels instance GHC.Enum.Enum SDL.Audio.Channels instance Data.Data.Data SDL.Audio.Channels instance GHC.Enum.Bounded SDL.Audio.Channels instance GHC.Classes.Eq SDL.Audio.AudioDevice instance GHC.Classes.Eq (SDL.Audio.AudioFormat sampleType) instance GHC.Classes.Ord (SDL.Audio.AudioFormat sampleType) instance GHC.Show.Show (SDL.Audio.AudioFormat sampleType) module SDL.Input.GameController -- | Identifies a gamepad button. data ControllerButton ControllerButtonInvalid :: ControllerButton ControllerButtonA :: ControllerButton ControllerButtonB :: ControllerButton ControllerButtonX :: ControllerButton ControllerButtonY :: ControllerButton ControllerButtonBack :: ControllerButton ControllerButtonGuide :: ControllerButton ControllerButtonStart :: ControllerButton ControllerButtonLeftStick :: ControllerButton ControllerButtonRightStick :: ControllerButton ControllerButtonLeftShoulder :: ControllerButton ControllerButtonRightShoulder :: ControllerButton ControllerButtonDpadUp :: ControllerButton ControllerButtonDpadDown :: ControllerButton ControllerButtonDpadLeft :: ControllerButton ControllerButtonDpadRight :: ControllerButton -- | Identifies the state of a controller button. data ControllerButtonState ControllerButtonPressed :: ControllerButtonState ControllerButtonReleased :: ControllerButtonState ControllerButtonInvalidState :: ControllerButtonState -- | Identified whether the game controller was added, removed, or -- remapped. data ControllerDeviceConnection ControllerDeviceAdded :: ControllerDeviceConnection ControllerDeviceRemoved :: ControllerDeviceConnection ControllerDeviceRemapped :: ControllerDeviceConnection instance GHC.Show.Show SDL.Input.GameController.ControllerDeviceConnection instance GHC.Read.Read SDL.Input.GameController.ControllerDeviceConnection instance GHC.Classes.Ord SDL.Input.GameController.ControllerDeviceConnection instance GHC.Generics.Generic SDL.Input.GameController.ControllerDeviceConnection instance GHC.Classes.Eq SDL.Input.GameController.ControllerDeviceConnection instance Data.Data.Data SDL.Input.GameController.ControllerDeviceConnection instance GHC.Show.Show SDL.Input.GameController.ControllerButtonState instance GHC.Read.Read SDL.Input.GameController.ControllerButtonState instance GHC.Classes.Ord SDL.Input.GameController.ControllerButtonState instance GHC.Generics.Generic SDL.Input.GameController.ControllerButtonState instance GHC.Classes.Eq SDL.Input.GameController.ControllerButtonState instance Data.Data.Data SDL.Input.GameController.ControllerButtonState instance GHC.Show.Show SDL.Input.GameController.ControllerButton instance GHC.Read.Read SDL.Input.GameController.ControllerButton instance GHC.Classes.Ord SDL.Input.GameController.ControllerButton instance GHC.Generics.Generic SDL.Input.GameController.ControllerButton instance GHC.Classes.Eq SDL.Input.GameController.ControllerButton instance Data.Data.Data SDL.Input.GameController.ControllerButton instance SDL.Internal.Numbered.FromNumber SDL.Input.GameController.ControllerDeviceConnection GHC.Word.Word32 instance SDL.Internal.Numbered.FromNumber SDL.Input.GameController.ControllerButtonState GHC.Word.Word32 instance SDL.Internal.Numbered.FromNumber SDL.Input.GameController.ControllerButton GHC.Int.Int32 module SDL.Init -- | Initializes SDL and the given subsystems. Do not call any SDL -- functions prior to this one, unless otherwise documented that you may -- do so. -- -- You may call this function again with additional subsystems to -- initialize. -- -- Throws SDLException if initialization fails. initialize :: (Foldable f, Functor m, MonadIO m) => f InitFlag -> m () -- | Equivalent to initialize [minBound .. -- maxBound]. initializeAll :: (Functor m, MonadIO m) => m () data InitFlag InitTimer :: InitFlag InitAudio :: InitFlag InitVideo :: InitFlag InitJoystick :: InitFlag InitHaptic :: InitFlag InitGameController :: InitFlag InitEvents :: InitFlag -- | Quit and shutdown SDL, freeing any resources that may have been in -- use. Do not call any SDL functions after you've called this function, -- unless otherwise documented that you may do so. quit :: MonadIO m => m () -- | The major, minor, and patch versions of the SDL library linked with. -- Does not require initialization. version :: (Integral a, MonadIO m) => m (a, a, a) instance GHC.Show.Show SDL.Init.InitFlag instance GHC.Read.Read SDL.Init.InitFlag instance GHC.Classes.Ord SDL.Init.InitFlag instance GHC.Generics.Generic SDL.Init.InitFlag instance GHC.Classes.Eq SDL.Init.InitFlag instance GHC.Enum.Enum SDL.Init.InitFlag instance Data.Data.Data SDL.Init.InitFlag instance GHC.Enum.Bounded SDL.Init.InitFlag instance SDL.Internal.Numbered.ToNumber SDL.Init.InitFlag GHC.Word.Word32 module SDL.Hint -- | The Hint type exports a well-typed interface to SDL's concept -- of 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 hints, see setHintWithPriority. data Hint :: * -> * [HintAccelerometerAsJoystick] :: Hint AccelerometerJoystickOptions [HintFramebufferAcceleration] :: Hint FramebufferAccelerationOptions [HintMacCTRLClick] :: Hint MacCTRLClickOptions [HintMouseRelativeModeWarp] :: Hint MouseModeWarpOptions [HintRenderDriver] :: Hint RenderDrivers [HintRenderOpenGLShaders] :: Hint RenderOpenGLShaderOptions [HintRenderScaleQuality] :: Hint RenderScaleQuality [HintRenderVSync] :: Hint RenderVSyncOptions [HintVideoWinD3DCompiler] :: Hint VideoWinD3DCompilerOptions -- | Set the value of a hint, applying priority rules for when there is a -- conflict. Ordinarily, a hint will not be set if there is an existing -- override hint or environment variable that takes precedence. setHintWithPriority :: MonadIO m => HintPriority -> Hint v -> v -> m Bool -- | How to deal with setting hints when an existing override or -- environment variable is present. data HintPriority -- | Low priority, used for default values DefaultPriority :: HintPriority -- | Medium priority NormalPriority :: HintPriority -- | High priority OverridePriority :: HintPriority clearHints :: MonadIO m => m () -- | A hint that specifies whether the Android/iOS built-in accelerometer -- should be listed as a joystick device, rather than listing actual -- joysticks only. By default SDL will list real joysticks along with the -- accelerometer as if it were a 3 axis joystick. data AccelerometerJoystickOptions -- | List only real joysticks and accept input from them AccelerometerNotJoystick :: AccelerometerJoystickOptions -- | List real joysticks along with the accelerometer as if it were a 3 -- axis joystick (the default) AccelerometerIsJoystick :: AccelerometerJoystickOptions -- | A hint that specifies how 3D acceleration is used to accelerate the -- SDL screen surface. By default SDL tries to make a best guess whether -- to use acceleration or not on each platform. data FramebufferAccelerationOptions -- | Disable 3D acceleration Disable3D :: FramebufferAccelerationOptions -- | Enable 3D acceleration, using the default renderer Enable3DDefault :: FramebufferAccelerationOptions -- | Enable 3D acceleration using Direct3D Enable3DDirect3D :: FramebufferAccelerationOptions -- | Enable 3D acceleration using OpenGL Enable3DOpenGL :: FramebufferAccelerationOptions -- | Enable 3D acceleration using OpenGLES Enable3DOpenGLES :: FramebufferAccelerationOptions -- | Enable 3D acceleration using OpenGLES2 Enable3DOpenGLES2 :: FramebufferAccelerationOptions -- | Enable 3D acceleration using software rendering Enable3DSoftware :: FramebufferAccelerationOptions -- | A hint that specifies whether ctrl+click should generate a right-click -- event on Mac. By default holding ctrl while left clicking will not -- generate a right click event when on Mac. data MacCTRLClickOptions -- | Disable emulating right click NoRightClick :: MacCTRLClickOptions -- | Enable emulating right click EmulateRightClick :: MacCTRLClickOptions -- | A hint that specifies whether relative mouse mode is implemented using -- mouse warping. By default SDL will use raw input for relative mouse -- mode data MouseModeWarpOptions -- | Relative mouse mode uses the raw input MouseRawInput :: MouseModeWarpOptions -- | Relative mouse mode uses mouse warping MouseWarping :: MouseModeWarpOptions -- | A hint that specifies which render driver to use. By default the first -- one in the list that is available on the current platform is chosen. data RenderDrivers Direct3D :: RenderDrivers OpenGL :: RenderDrivers OpenGLES :: RenderDrivers OpenGLES2 :: RenderDrivers Software :: RenderDrivers -- | A hint that specifies whether the OpenGL render driver uses shaders. -- By default shaders are used if OpenGL supports them. data RenderOpenGLShaderOptions -- | Disable shaders DisableShaders :: RenderOpenGLShaderOptions -- | Enable shaders, if they are available EnableShaders :: RenderOpenGLShaderOptions -- | A hint that specifies scaling quality. By default nearest pixel -- sampling is used. data RenderScaleQuality -- | Nearest pixel sampling ScaleNearest :: RenderScaleQuality -- | linear filtering (supported by OpenGL and Direct3D) ScaleLinear :: RenderScaleQuality -- | Anisotropic filtering (supported by Direct3D) ScaleBest :: RenderScaleQuality -- | A hint that specifies whether sync to vertical refresh is enabled or -- disabled to avoid tearing. By default SDL uses the flag passed into -- calls to create renderers. data RenderVSyncOptions DisableVSync :: RenderVSyncOptions EnableVSync :: RenderVSyncOptions -- | A hint that specifies which shader compiler to preload when using the -- Chrome ANGLE binaries. By default d3dcompiler_46.dll will be -- used. data VideoWinD3DCompilerOptions -- | Use d3dcompiler_46.dll, best for Vista or later D3DVistaOrLater :: VideoWinD3DCompilerOptions -- | Use d3dcompiler_43.dll for XP support D3DXPSupport :: VideoWinD3DCompilerOptions -- | Do not load any library, useful if you compiled ANGLE from source and -- included the compiler in your binaries D3DNone :: VideoWinD3DCompilerOptions instance GHC.Show.Show SDL.Hint.HintPriority instance GHC.Read.Read SDL.Hint.HintPriority instance GHC.Classes.Ord SDL.Hint.HintPriority instance GHC.Generics.Generic SDL.Hint.HintPriority instance GHC.Classes.Eq SDL.Hint.HintPriority instance GHC.Enum.Enum SDL.Hint.HintPriority instance Data.Data.Data SDL.Hint.HintPriority instance GHC.Enum.Bounded SDL.Hint.HintPriority instance GHC.Show.Show SDL.Hint.VideoWinD3DCompilerOptions instance GHC.Read.Read SDL.Hint.VideoWinD3DCompilerOptions instance GHC.Classes.Ord SDL.Hint.VideoWinD3DCompilerOptions instance GHC.Generics.Generic SDL.Hint.VideoWinD3DCompilerOptions instance GHC.Classes.Eq SDL.Hint.VideoWinD3DCompilerOptions instance GHC.Enum.Enum SDL.Hint.VideoWinD3DCompilerOptions instance Data.Data.Data SDL.Hint.VideoWinD3DCompilerOptions instance GHC.Enum.Bounded SDL.Hint.VideoWinD3DCompilerOptions instance GHC.Show.Show SDL.Hint.RenderVSyncOptions instance GHC.Read.Read SDL.Hint.RenderVSyncOptions instance GHC.Classes.Ord SDL.Hint.RenderVSyncOptions instance GHC.Generics.Generic SDL.Hint.RenderVSyncOptions instance GHC.Classes.Eq SDL.Hint.RenderVSyncOptions instance GHC.Enum.Enum SDL.Hint.RenderVSyncOptions instance Data.Data.Data SDL.Hint.RenderVSyncOptions instance GHC.Enum.Bounded SDL.Hint.RenderVSyncOptions instance GHC.Show.Show SDL.Hint.RenderScaleQuality instance GHC.Read.Read SDL.Hint.RenderScaleQuality instance GHC.Classes.Ord SDL.Hint.RenderScaleQuality instance GHC.Generics.Generic SDL.Hint.RenderScaleQuality instance GHC.Classes.Eq SDL.Hint.RenderScaleQuality instance GHC.Enum.Enum SDL.Hint.RenderScaleQuality instance Data.Data.Data SDL.Hint.RenderScaleQuality instance GHC.Enum.Bounded SDL.Hint.RenderScaleQuality instance GHC.Show.Show SDL.Hint.RenderOpenGLShaderOptions instance GHC.Read.Read SDL.Hint.RenderOpenGLShaderOptions instance GHC.Classes.Ord SDL.Hint.RenderOpenGLShaderOptions instance GHC.Generics.Generic SDL.Hint.RenderOpenGLShaderOptions instance GHC.Classes.Eq SDL.Hint.RenderOpenGLShaderOptions instance GHC.Enum.Enum SDL.Hint.RenderOpenGLShaderOptions instance Data.Data.Data SDL.Hint.RenderOpenGLShaderOptions instance GHC.Enum.Bounded SDL.Hint.RenderOpenGLShaderOptions instance GHC.Show.Show SDL.Hint.RenderDrivers instance GHC.Read.Read SDL.Hint.RenderDrivers instance GHC.Classes.Ord SDL.Hint.RenderDrivers instance GHC.Generics.Generic SDL.Hint.RenderDrivers instance GHC.Classes.Eq SDL.Hint.RenderDrivers instance GHC.Enum.Enum SDL.Hint.RenderDrivers instance Data.Data.Data SDL.Hint.RenderDrivers instance GHC.Enum.Bounded SDL.Hint.RenderDrivers instance GHC.Show.Show SDL.Hint.MouseModeWarpOptions instance GHC.Read.Read SDL.Hint.MouseModeWarpOptions instance GHC.Classes.Ord SDL.Hint.MouseModeWarpOptions instance GHC.Generics.Generic SDL.Hint.MouseModeWarpOptions instance GHC.Classes.Eq SDL.Hint.MouseModeWarpOptions instance GHC.Enum.Enum SDL.Hint.MouseModeWarpOptions instance Data.Data.Data SDL.Hint.MouseModeWarpOptions instance GHC.Enum.Bounded SDL.Hint.MouseModeWarpOptions instance GHC.Show.Show SDL.Hint.MacCTRLClickOptions instance GHC.Read.Read SDL.Hint.MacCTRLClickOptions instance GHC.Classes.Ord SDL.Hint.MacCTRLClickOptions instance GHC.Generics.Generic SDL.Hint.MacCTRLClickOptions instance GHC.Classes.Eq SDL.Hint.MacCTRLClickOptions instance GHC.Enum.Enum SDL.Hint.MacCTRLClickOptions instance Data.Data.Data SDL.Hint.MacCTRLClickOptions instance GHC.Enum.Bounded SDL.Hint.MacCTRLClickOptions instance GHC.Show.Show SDL.Hint.FramebufferAccelerationOptions instance GHC.Read.Read SDL.Hint.FramebufferAccelerationOptions instance GHC.Classes.Ord SDL.Hint.FramebufferAccelerationOptions instance GHC.Generics.Generic SDL.Hint.FramebufferAccelerationOptions instance GHC.Classes.Eq SDL.Hint.FramebufferAccelerationOptions instance GHC.Enum.Enum SDL.Hint.FramebufferAccelerationOptions instance Data.Data.Data SDL.Hint.FramebufferAccelerationOptions instance GHC.Enum.Bounded SDL.Hint.FramebufferAccelerationOptions instance GHC.Show.Show SDL.Hint.AccelerometerJoystickOptions instance GHC.Read.Read SDL.Hint.AccelerometerJoystickOptions instance GHC.Classes.Ord SDL.Hint.AccelerometerJoystickOptions instance GHC.Generics.Generic SDL.Hint.AccelerometerJoystickOptions instance GHC.Classes.Eq SDL.Hint.AccelerometerJoystickOptions instance GHC.Enum.Enum SDL.Hint.AccelerometerJoystickOptions instance Data.Data.Data SDL.Hint.AccelerometerJoystickOptions instance GHC.Enum.Bounded SDL.Hint.AccelerometerJoystickOptions instance Data.StateVar.HasSetter (SDL.Hint.Hint v) v instance Data.StateVar.HasGetter (SDL.Hint.Hint v) v module SDL.Time -- | Number of milliseconds since library initialization. -- -- See SDL_GetTicks for C documentation. ticks :: MonadIO m => m Word32 -- | 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 -- SDL_GetPerformanceFrequency and -- SDL_GetPerformanceCounter for C documentation about -- the implementation. time :: (Fractional a, MonadIO m) => m a -- | Wait a specified number of milliseconds before returning. -- -- Users are generally recommended to use threadDelay instead, -- to take advantage of the abilities of the Haskell runtime. -- -- See SDL_Delay for C documentation. delay :: MonadIO m => Word32 -> m () -- | A TimerCallback is called with the interval size of the -- callback. It can return information as to whether or not the timer -- should continue to exist. type TimerCallback = Word32 -> IO RetriggerTimer -- | A timer created by addTimer. This Timer can be removed -- with removeTimer. data Timer -- | RetriggerTimer allows a callback to inform SDL if the timer -- should be retriggered or cancelled data RetriggerTimer -- | Retrigger the timer again in a given number of milliseconds. Reschedule :: Word32 -> RetriggerTimer -- | Cancel future invocations of this timer. Cancel :: RetriggerTimer -- | Set up a callback function to be run on a separate thread after the -- specified number of milliseconds has elapsed. -- -- See SDL_AddTimer for C documentation. addTimer :: MonadIO m => Word32 -> TimerCallback -> m Timer -- | Remove a Timer. -- -- See SDL_RemoveTimer for C documentation. removeTimer :: MonadIO m => Timer -> m Bool instance GHC.Show.Show SDL.Time.RetriggerTimer instance GHC.Read.Read SDL.Time.RetriggerTimer instance GHC.Classes.Ord SDL.Time.RetriggerTimer instance GHC.Generics.Generic SDL.Time.RetriggerTimer instance GHC.Classes.Eq SDL.Time.RetriggerTimer instance Data.Data.Data SDL.Time.RetriggerTimer -- | SDL's vector representation. -- -- By default, re-exports the Linear and Linear.Affine -- modules from the linear package. With the no-linear -- Cabal flag, instead exports a duplicate implementation of the -- V2, V3, V4 and Point types from -- SDL.Internal.Vect, which provides as many instances as possible -- for those types while avoiding any additional dependencies. module SDL.Vect -- | A handy wrapper to help distinguish points from vectors at the type -- level newtype Point (f :: * -> *) a P :: f a -> Point a -- | A 2-dimensional vector -- --
-- >>> pure 1 :: V2 Int -- V2 1 1 ---- --
-- >>> V2 1 2 + V2 3 4 -- V2 4 6 ---- --
-- >>> V2 1 2 * V2 3 4 -- V2 3 8 ---- --
-- >>> sum (V2 1 2) -- 3 --data V2 a V2 :: !a -> !a -> V2 a -- | A 3-dimensional vector data V3 a V3 :: !a -> !a -> !a -> V3 a -- | A 4-dimensional vector. data V4 a V4 :: !a -> !a -> !a -> !a -> V4 a module SDL.Input.Joystick -- | Count the number of joysticks attached to the system. -- -- See SDL_NumJoysticks for C documentation. numJoysticks :: MonadIO m => m (CInt) -- | Enumerate all connected joysticks, retrieving a description of each. availableJoysticks :: MonadIO m => m (Vector JoystickDevice) -- | A description of joystick that can be opened using -- openJoystick. To retrieve a list of connected joysticks, use -- availableJoysticks. data JoystickDevice JoystickDevice :: Text -> CInt -> JoystickDevice [joystickDeviceName] :: JoystickDevice -> Text [joystickDeviceId] :: JoystickDevice -> CInt -- | Open a joystick so that you can start receiving events from -- interaction with this joystick. -- -- See SDL_JoystickOpen for C documentation. openJoystick :: (Functor m, MonadIO m) => JoystickDevice -> m Joystick -- | Close a joystick previously opened with openJoystick. -- -- See SDL_JoystickClose for C documentation. closeJoystick :: MonadIO m => Joystick -> m () -- | Get the instance ID of an opened joystick. The instance ID is used to -- identify the joystick in future SDL events. -- -- See SDL_JoystickInstanceID for C documentation. getJoystickID :: MonadIO m => Joystick -> m (Int32) data Joystick -- | Identifies the state of a joystick button. data JoyButtonState JoyButtonPressed :: JoyButtonState JoyButtonReleased :: JoyButtonState -- | Determine if a given button is currently held. -- -- See SDL_JoystickGetButton for C documentation. buttonPressed :: (Functor m, MonadIO m) => Joystick -> CInt -> m Bool -- | Get the ball axis change since the last poll. -- -- See SDL_JoystickGetBall for C documentation. ballDelta :: MonadIO m => Joystick -> CInt -> m (V2 CInt) -- | Get the current state of an axis control on a joystick. -- -- Returns a 16-bit signed integer representing the current position of -- the axis. The state is a value ranging from -32768 to 32767. -- -- On most modern joysticks the x-axis is usually represented by axis 0 -- and the y-axis by axis 1. The value returned by axisPosition is -- a signed integer (-32768 to 32767) representing the current position -- of the axis. It may be necessary to impose certain tolerances on these -- values to account for jitter. -- -- Some joysticks use axes 2 and 3 for extra buttons. -- -- See SDL_JoystickGetAxis for C documentation. axisPosition :: MonadIO m => Joystick -> CInt -> m Int16 -- | Get the number of general axis controls on a joystick. -- -- See SDL_JoystickNumAxes for C documentation. numAxes :: (MonadIO m) => Joystick -> m CInt -- | Get the number of buttons on a joystick. -- -- See SDL_JoystickNumButtons for C documentation. numButtons :: (MonadIO m) => Joystick -> m CInt -- | Get the number of trackballs on a joystick. -- -- See SDL_JoystickNumBalls for C documentation. numBalls :: (MonadIO m) => Joystick -> m CInt -- | Identifies the state of the POV hat on a joystick. data JoyHatPosition -- | Centered position HatCentered :: JoyHatPosition -- | Up position HatUp :: JoyHatPosition -- | Right position HatRight :: JoyHatPosition -- | Down position HatDown :: JoyHatPosition -- | Left position HatLeft :: JoyHatPosition -- | Right-up position HatRightUp :: JoyHatPosition -- | Right-down position HatRightDown :: JoyHatPosition -- | Left-up position HatLeftUp :: JoyHatPosition -- | Left-down position HatLeftDown :: JoyHatPosition -- | Get current position of a POV hat on a joystick. -- -- See SDL_JoystickGetHat for C documentation. getHat :: (Functor m, MonadIO m) => Joystick -> CInt -> m JoyHatPosition -- | Get the number of POV hats on a joystick. -- -- See SDL_JoystickNumHats for C documentation. numHats :: (MonadIO m) => Joystick -> m CInt -- | Identifies whether a joystick has been connected or disconnected. data JoyDeviceConnection JoyDeviceAdded :: JoyDeviceConnection JoyDeviceRemoved :: JoyDeviceConnection instance GHC.Show.Show SDL.Input.Joystick.JoyDeviceConnection instance GHC.Read.Read SDL.Input.Joystick.JoyDeviceConnection instance GHC.Classes.Ord SDL.Input.Joystick.JoyDeviceConnection instance GHC.Generics.Generic SDL.Input.Joystick.JoyDeviceConnection instance GHC.Classes.Eq SDL.Input.Joystick.JoyDeviceConnection instance Data.Data.Data SDL.Input.Joystick.JoyDeviceConnection instance GHC.Show.Show SDL.Input.Joystick.JoyHatPosition instance GHC.Read.Read SDL.Input.Joystick.JoyHatPosition instance GHC.Classes.Ord SDL.Input.Joystick.JoyHatPosition instance GHC.Generics.Generic SDL.Input.Joystick.JoyHatPosition instance GHC.Classes.Eq SDL.Input.Joystick.JoyHatPosition instance Data.Data.Data SDL.Input.Joystick.JoyHatPosition instance GHC.Show.Show SDL.Input.Joystick.JoyButtonState instance GHC.Read.Read SDL.Input.Joystick.JoyButtonState instance GHC.Classes.Ord SDL.Input.Joystick.JoyButtonState instance GHC.Generics.Generic SDL.Input.Joystick.JoyButtonState instance GHC.Classes.Eq SDL.Input.Joystick.JoyButtonState instance Data.Data.Data SDL.Input.Joystick.JoyButtonState instance GHC.Show.Show SDL.Input.Joystick.JoystickDevice instance GHC.Classes.Ord SDL.Input.Joystick.JoystickDevice instance GHC.Read.Read SDL.Input.Joystick.JoystickDevice instance GHC.Generics.Generic SDL.Input.Joystick.JoystickDevice instance GHC.Classes.Eq SDL.Input.Joystick.JoystickDevice instance SDL.Internal.Numbered.FromNumber SDL.Input.Joystick.JoyDeviceConnection GHC.Word.Word32 instance SDL.Internal.Numbered.FromNumber SDL.Input.Joystick.JoyHatPosition GHC.Word.Word8 instance SDL.Internal.Numbered.FromNumber SDL.Input.Joystick.JoyButtonState GHC.Word.Word8 module SDL.Video.OpenGL -- | A set of default options for OpenGLConfig -- --
-- defaultOpenGL = OpenGLConfig
-- { glColorPrecision = V4 8 8 8 0
-- , glDepthPrecision = 24
-- , glStencilPrecision = 8
-- , glMultisampleSamples = 1
-- , glProfile = Compatibility Normal 2 1
-- }
--
defaultOpenGL :: OpenGLConfig
-- | Configuration used when creating an OpenGL rendering context.
data OpenGLConfig
OpenGLConfig :: V4 CInt -> CInt -> CInt -> CInt -> Profile -> OpenGLConfig
-- | Defaults to V4 8 8 8 0.
[glColorPrecision] :: OpenGLConfig -> V4 CInt
-- | Defaults to 24.
[glDepthPrecision] :: OpenGLConfig -> CInt
-- | Defaults to 8.
[glStencilPrecision] :: OpenGLConfig -> CInt
-- | Defaults to 1.
[glMultisampleSamples] :: OpenGLConfig -> CInt
-- | Defaults to Compatibility Normal 2 1.
[glProfile] :: OpenGLConfig -> Profile
-- | A created OpenGL context.
data GLContext
-- | Create a new OpenGL context and makes it the current context for the
-- window.
--
-- Throws SDLException if the window wasn't configured with
-- OpenGL support, or if context creation fails.
--
-- See SDL_GL_CreateContext for C documentation.
glCreateContext :: (Functor m, MonadIO m) => Window -> m GLContext
-- | The profile a driver should use when creating an OpenGL context.
data Profile
-- | Use the OpenGL core profile, with a given major and minor version
Core :: Mode -> CInt -> CInt -> Profile
-- | Use the compatibilty profile with a given major and minor version. The
-- compatibility profile allows you to use deprecated functions such as
-- immediate mode
Compatibility :: Mode -> CInt -> CInt -> Profile
-- | Use an OpenGL profile for embedded systems
ES :: Mode -> CInt -> CInt -> Profile
-- | The mode a driver should use when creating an OpenGL context.
data Mode
-- | A normal profile with no special debugging support
Normal :: Mode
-- | Use a debug context, allowing the usage of extensions such as
-- GL_ARB_debug_output
Debug :: Mode
-- | Set up an OpenGL context for rendering into an OpenGL window.
--
-- Throws SDLException on failure.
--
-- See SDL_GL_MakeCurrent for C documentation.
glMakeCurrent :: (Functor m, MonadIO m) => Window -> GLContext -> m ()
-- | Delete the given OpenGL context.
--
-- You must make sure that there are no pending commands in the
-- OpenGL command queue, the driver may still be processing commands even
-- if you have stopped issuing them!
--
-- The glFinish command will block until the command queue has
-- been fully processed. You should call that function before deleting a
-- context.
--
-- See SDL_GL_DeleteContext for C documentation.
glDeleteContext :: MonadIO m => GLContext -> m ()
-- | Get the size of a window's underlying drawable area in pixels (for use
-- with glViewport).
--
-- It may differ from windowSize if window was created with
-- windowHighDPI flag.
glGetDrawableSize :: MonadIO m => Window -> m (V2 CInt)
-- | Replace the contents of the front buffer with the back buffer's. The
-- contents of the back buffer are undefined, clear them with
-- glClear or equivalent before drawing to them again.
--
-- See SDL_GL_SwapWindow for C documentation.
glSwapWindow :: MonadIO m => Window -> m ()
-- | The swap interval for the current OpenGL context.
data SwapInterval
-- | No vertical retrace synchronization
ImmediateUpdates :: SwapInterval
-- | The buffer swap is synchronized with the vertical retrace
SynchronizedUpdates :: SwapInterval
LateSwapTearing :: SwapInterval
-- | Get or set the swap interval for the current OpenGL context.
--
-- This StateVar can be modified using $= and the current
-- value retrieved with get.
--
-- See SDL_GL_SetSwapInterval and
-- SDL_GL_GetSwapInterval for C documentation.
swapInterval :: StateVar SwapInterval
glGetProcAddress :: MonadIO m => CString -> m (Ptr ())
instance GHC.Show.Show SDL.Video.OpenGL.SwapInterval
instance GHC.Read.Read SDL.Video.OpenGL.SwapInterval
instance GHC.Classes.Ord SDL.Video.OpenGL.SwapInterval
instance GHC.Generics.Generic SDL.Video.OpenGL.SwapInterval
instance GHC.Classes.Eq SDL.Video.OpenGL.SwapInterval
instance GHC.Enum.Enum SDL.Video.OpenGL.SwapInterval
instance Data.Data.Data SDL.Video.OpenGL.SwapInterval
instance GHC.Enum.Bounded SDL.Video.OpenGL.SwapInterval
instance GHC.Classes.Eq SDL.Video.OpenGL.GLContext
instance GHC.Show.Show SDL.Video.OpenGL.OpenGLConfig
instance GHC.Read.Read SDL.Video.OpenGL.OpenGLConfig
instance GHC.Classes.Ord SDL.Video.OpenGL.OpenGLConfig
instance GHC.Generics.Generic SDL.Video.OpenGL.OpenGLConfig
instance GHC.Classes.Eq SDL.Video.OpenGL.OpenGLConfig
instance GHC.Show.Show SDL.Video.OpenGL.Profile
instance GHC.Read.Read SDL.Video.OpenGL.Profile
instance GHC.Classes.Ord SDL.Video.OpenGL.Profile
instance GHC.Generics.Generic SDL.Video.OpenGL.Profile
instance GHC.Classes.Eq SDL.Video.OpenGL.Profile
instance GHC.Show.Show SDL.Video.OpenGL.Mode
instance GHC.Read.Read SDL.Video.OpenGL.Mode
instance GHC.Classes.Ord SDL.Video.OpenGL.Mode
instance GHC.Generics.Generic SDL.Video.OpenGL.Mode
instance GHC.Classes.Eq SDL.Video.OpenGL.Mode
instance GHC.Enum.Enum SDL.Video.OpenGL.Mode
instance Data.Data.Data SDL.Video.OpenGL.Mode
instance GHC.Enum.Bounded SDL.Video.OpenGL.Mode
instance SDL.Internal.Numbered.ToNumber SDL.Video.OpenGL.SwapInterval Foreign.C.Types.CInt
instance SDL.Internal.Numbered.FromNumber SDL.Video.OpenGL.SwapInterval Foreign.C.Types.CInt
-- | SDL.Video.Renderer provides a high-level interface to SDL's
-- accelerated 2D rendering library.
module SDL.Video.Renderer
-- | An SDL rendering device. This can be created with
-- createRenderer.
data Renderer
-- | The configuration data used when creating windows.
data RendererConfig
RendererConfig :: RendererType -> Bool -> RendererConfig
-- | The renderer's acceleration mode
[rendererType] :: RendererConfig -> RendererType
-- | The renderer supports rendering to texture
[rendererTargetTexture] :: RendererConfig -> Bool
-- | Default options for RendererConfig.
--
--
-- defaultRenderer = RendererConfig
-- { rendererType = AcceleratedRenderer
-- , rendererTargetTexture = False
-- }
--
defaultRenderer :: RendererConfig
-- | Renderer acceleration mode
data RendererType
-- | The renderer does not use hardware acceleration
UnacceleratedRenderer :: RendererType
-- | The renderer uses hardware acceleration and refresh rate is ignored
AcceleratedRenderer :: RendererType
-- | The renderer uses hardware acceleration and present is synchronized
-- with the refresh rate
AcceleratedVSyncRenderer :: RendererType
-- | The renderer is a software fallback
SoftwareRenderer :: RendererType
-- | Clear the current rendering target with the drawing color.
--
-- See SDL_RenderClear for C documentation.
clear :: (Functor m, MonadIO m) => Renderer -> m ()
-- | Copy a portion of the texture to the current rendering target.
--
-- See SDL_RenderCopy for C documentation.
copy :: MonadIO m => Renderer -> Texture -> Maybe (Rectangle CInt) -> Maybe (Rectangle CInt) -> m ()
-- | Copy a portion of the texture to the current rendering target,
-- optionally rotating it by angle around the given center and also
-- flipping it top-bottom and/or left-right.
--
-- See SDL_RenderCopyEx for C documentation.
copyEx :: MonadIO m => Renderer -> Texture -> Maybe (Rectangle CInt) -> Maybe (Rectangle CInt) -> CDouble -> Maybe (Point V2 CInt) -> V2 Bool -> m ()
-- | Draw a line on the current rendering target.
--
-- See SDL_RenderDrawLine for C documentation.
drawLine :: (Functor m, MonadIO m) => Renderer -> Point V2 CInt -> Point V2 CInt -> m ()
-- | Draw a series of connected lines on the current rendering target.
--
-- See SDL_RenderDrawLines for C documentation.
drawLines :: MonadIO m => Renderer -> Vector (Point V2 CInt) -> m ()
-- | Draw a point on the current rendering target.
--
-- See SDL_RenderDrawPoint for C documentation.
drawPoint :: (Functor m, MonadIO m) => Renderer -> Point V2 CInt -> m ()
-- | Draw multiple points on the current rendering target.
--
-- See SDL_RenderDrawPoints for C documentation.
drawPoints :: MonadIO m => Renderer -> Vector (Point V2 CInt) -> m ()
-- | Draw a rectangle outline on the current rendering target.
--
-- See SDL_RenderDrawRect for C documentation.
drawRect :: MonadIO m => Renderer -> Maybe (Rectangle CInt) -> m ()
-- | Draw some number of rectangles on the current rendering target.
--
-- See SDL_RenderDrawRects for C documentation.
drawRects :: MonadIO m => Renderer -> Vector (Rectangle CInt) -> m ()
-- | Fill a rectangle on the current rendering target with the drawing
-- color.
--
-- See SDL_RenderFillRect for C documentation.
fillRect :: MonadIO m => Renderer -> Maybe (Rectangle CInt) -> m ()
-- | Fill some number of rectangles on the current rendering target with
-- the drawing color.
--
-- See SDL_RenderFillRects for C documentation.
fillRects :: MonadIO m => Renderer -> Vector (Rectangle CInt) -> m ()
-- | Update the screen with any rendering performed since the previous
-- call.
--
-- SDL's rendering functions operate on a backbuffer; that is, calling a
-- rendering function such as drawLine does not directly put a
-- line on the screen, but rather updates the backbuffer. As such, you
-- compose your entire scene and present the composed backbuffer to the
-- screen as a complete picture.
--
-- Therefore, when using SDL's rendering API, one does all drawing
-- intended for the frame, and then calls this function once per frame to
-- present the final drawing to the user.
--
-- The backbuffer should be considered invalidated after each present; do
-- not assume that previous contents will exist between frames. You are
-- strongly encouraged to call clear to initialize the backbuffer
-- before starting each new frame's drawing, even if you plan to
-- overwrite every pixel.
--
-- See SDL_RenderPresent for C documentation.
present :: MonadIO m => Renderer -> m ()
-- | Get or set the blend mode used for drawing operations (fill and line).
--
-- This StateVar can be modified using $= and the current
-- value retrieved with get.
--
-- See SDL_SetRenderDrawBlendMode and
-- SDL_GetRenderDrawBlendMode for C documentation.
rendererDrawBlendMode :: Renderer -> StateVar BlendMode
-- | Get or set the color used for drawing operations (rect, line and
-- clear).
--
-- This StateVar can be modified using $= and the current
-- value retrieved with get.
--
-- See SDL_SetRenderDrawColor and
-- SDL_GetRenderDrawColor for C documentation.
rendererDrawColor :: Renderer -> StateVar (V4 Word8)
-- | Get or set the current render target. Nothing corresponds to
-- the default render target.
--
-- This StateVar can be modified using $= and the current
-- value retrieved with get.
--
-- See SDL_SetRenderTarget and
-- SDL_GetRenderTarget for C documentation.
rendererRenderTarget :: Renderer -> StateVar (Maybe Texture)
-- | Get or set the clip rectangle for rendering on the specified target.
--
-- This StateVar can be modified using $= and the current
-- value retrieved with get.
--
-- See SDL_RenderSetClipRect and
-- SDL_RenderGetClipRect for C documentation.
rendererClipRect :: Renderer -> StateVar (Maybe (Rectangle CInt))
-- | Get or set the device independent resolution for rendering.
--
-- This StateVar can be modified using $= and the current
-- value retrieved with get.
--
-- See SDL_RenderSetLogicalSize and
-- SDL_RenderGetLogicalSize for C documentation.
rendererLogicalSize :: Renderer -> StateVar (Maybe (V2 CInt))
-- | Get or set the drawing scale for rendering on the current target.
--
-- The drawing coordinates are scaled by the x/y scaling factors before
-- they are used by the renderer. This allows resolution independent
-- drawing with a single coordinate system.
--
-- If this results in scaling or subpixel drawing by the rendering
-- backend, it will be handled using the appropriate quality hints. For
-- best results use integer scaling factors.
--
-- See SDL_RenderSetScale and
-- SDL_RenderGetScale for C documentation.
rendererScale :: Renderer -> StateVar (V2 CFloat)
-- | Get or set the drawing area for rendering on the current target.
--
-- This StateVar can be modified using $= and the current
-- value retrieved with get.
--
-- See SDL_RenderSetViewport and
-- SDL_RenderGetViewport for C documentation.
rendererViewport :: Renderer -> StateVar (Maybe (Rectangle CInt))
-- | Determine whether a window supports the use of render targets.
--
-- See SDL_RenderTargetSupported for C documentation.
renderTargetSupported :: (MonadIO m) => Renderer -> m Bool
data Surface
Surface :: (Ptr Surface) -> (Maybe (IOVector Word8)) -> Surface
-- | Copy the window surface to the screen.
--
-- This is the function you use to reflect any changes to the surface on
-- the screen.
--
-- See SDL_UpdateWindowSurface for C documentation.
updateWindowSurface :: (Functor m, MonadIO m) => Window -> m ()
-- | Perform a fast surface copy to a destination surface.
--
-- See SDL_BlitSurface for C documentation.
surfaceBlit :: MonadIO m => Surface -> Maybe (Rectangle CInt) -> Surface -> Maybe (Point V2 CInt) -> m (Maybe (Rectangle CInt))
-- | Perform a scaled surface copy to a destination surface.
--
-- See SDL_BlitScaled for C documentation.
surfaceBlitScaled :: MonadIO m => Surface -> Maybe (Rectangle CInt) -> Surface -> Maybe (Rectangle CInt) -> m ()
-- | Perform a fast fill of a rectangle with a specific color.
--
-- If there is a clip rectangle set on the destination (set via
-- clipRect), then this function will fill based on the
-- intersection of the clip rectangle and the given Rectangle.
--
-- See SDL_FillRect for C documentation.
surfaceFillRect :: MonadIO m => Surface -> Maybe (Rectangle CInt) -> V4 Word8 -> m ()
-- | Perform a fast fill of a set of rectangles with a specific color.
--
-- If there is a clip rectangle set on any of the destinations (set via
-- clipRect), then this function will fill based on the
-- intersection of the clip rectangle and the given Rectangles.
--
-- See SDL_FillRects for C documentation.
surfaceFillRects :: MonadIO m => Surface -> Vector (Rectangle CInt) -> V4 Word8 -> m ()
-- | Copy an existing surface into a new one that is optimized for blitting
-- to a surface of a specified pixel format.
--
-- This function is used to optimize images for faster repeat blitting.
-- This is accomplished by converting the original and storing the result
-- as a new surface. The new, optimized surface can then be used as the
-- source for future blits, making them faster.
--
-- See SDL_ConvertSurface for C documentation.
convertSurface :: (Functor m, MonadIO m) => Surface -> SurfacePixelFormat -> m Surface
-- | Allocate a new RGB surface.
--
-- See SDL_CreateRGBSurface for C documentation.
createRGBSurface :: (Functor m, MonadIO m) => V2 CInt -> PixelFormat -> m Surface
-- | Allocate a new RGB surface with existing pixel data.
--
-- See SDL_CreateRGBSurfaceFrom for C documentation.
createRGBSurfaceFrom :: (Functor m, MonadIO m) => IOVector Word8 -> V2 CInt -> CInt -> PixelFormat -> m Surface
-- | Free an RGB surface.
--
-- If the surface was created using createRGBSurfaceFrom then the
-- pixel data is not freed.
--
-- See SDL_FreeSurface for the C documentation.
freeSurface :: MonadIO m => Surface -> m ()
-- | Get the SDL surface associated with the window.
--
-- See SDL_GetWindowSurface for C documentation.
getWindowSurface :: (Functor m, MonadIO m) => Window -> m Surface
-- | Load a surface from a BMP file.
--
-- See SDL_LoadBMP for C documentation.
loadBMP :: MonadIO m => FilePath -> m Surface
-- | Get or set the color key (transparent pixel color) for a surface.
--
-- This StateVar can be modified using $= and the current
-- value retrieved with get.
--
-- See SDL_SetColorKey and
-- SDL_GetColorKey for C documentation.
surfaceColorKey :: Surface -> StateVar (Maybe (V4 Word8))
-- | Get or set the blend mode used for blit operations.
--
-- This StateVar can be modified using $= and the current
-- value retrieved with get.
--
-- See SDL_SetSurfaceBlendMode and
-- SDL_GetSurfaceBlendMode for C documentation.
surfaceBlendMode :: Surface -> StateVar BlendMode
-- | Retrive the width and height of a Surface.
surfaceDimensions :: MonadIO m => Surface -> m (V2 CInt)
-- | Inspect the pixel format under a surface.
surfaceFormat :: MonadIO m => Surface -> m SurfacePixelFormat
-- | 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 ())
-- | Set up a surface for directly accessing the pixels.
--
-- See SDL_LockSurface for C documentation.
lockSurface :: MonadIO m => Surface -> m ()
-- | Release a surface after directly accessing the pixels.
--
-- See SDL_UnlockSurface for C documentation.
unlockSurface :: MonadIO m => Surface -> m ()
data Palette
paletteNColors :: MonadIO m => Palette -> m CInt
paletteColors :: MonadIO m => Palette -> m (Maybe (Vector (V4 Word8)))
paletteColor :: MonadIO m => Palette -> CInt -> m (Maybe (V4 Word8))
data PixelFormat
Unknown :: PixelFormat
Index1LSB :: PixelFormat
Index1MSB :: PixelFormat
Index4LSB :: PixelFormat
Index4MSB :: PixelFormat
Index8 :: PixelFormat
RGB332 :: PixelFormat
RGB444 :: PixelFormat
RGB555 :: PixelFormat
BGR555 :: PixelFormat
ARGB4444 :: PixelFormat
RGBA4444 :: PixelFormat
ABGR4444 :: PixelFormat
BGRA4444 :: PixelFormat
ARGB1555 :: PixelFormat
RGBA5551 :: PixelFormat
ABGR1555 :: PixelFormat
BGRA5551 :: PixelFormat
RGB565 :: PixelFormat
BGR565 :: PixelFormat
RGB24 :: PixelFormat
BGR24 :: PixelFormat
RGB888 :: PixelFormat
RGBX8888 :: PixelFormat
BGR888 :: PixelFormat
BGRX8888 :: PixelFormat
ARGB8888 :: PixelFormat
RGBA8888 :: PixelFormat
ABGR8888 :: PixelFormat
BGRA8888 :: PixelFormat
ARGB2101010 :: PixelFormat
YV12 :: PixelFormat
IYUV :: PixelFormat
YUY2 :: PixelFormat
UYVY :: PixelFormat
YVYU :: PixelFormat
data SurfacePixelFormat
formatPalette :: MonadIO m => SurfacePixelFormat -> m (Maybe Palette)
-- | Set a range of colors in a palette.
--
-- See SDL_SetPaletteColors for C documentation.
setPaletteColors :: MonadIO m => Palette -> (Vector (V4 Word8)) -> CInt -> m ()
-- | Convert the given the enumerated pixel format to a bpp value and RGBA
-- masks.
--
-- See SDL_PixelFormatEnumToMasks for C documentation.
pixelFormatToMasks :: (MonadIO m) => PixelFormat -> m (CInt, V4 Word32)
-- | Convert a bpp value and RGBA masks to an enumerated pixel format.
--
-- See SDL_MasksToPixelFormatEnum for C documentation.
masksToPixelFormat :: (MonadIO m) => CInt -> V4 Word32 -> m PixelFormat
data Texture
-- | Create a texture for a rendering context.
--
-- See SDL_CreateTexture for C documentation.
createTexture :: (Functor m, MonadIO m) => Renderer -> PixelFormat -> TextureAccess -> V2 CInt -> m Texture
-- | Information to the GPU about how you will use a texture.
data TextureAccess
-- | Changes rarely, cannot be locked
TextureAccessStatic :: TextureAccess
-- | changes frequently, can be locked
TextureAccessStreaming :: TextureAccess
-- | Can be used as a render target
TextureAccessTarget :: TextureAccess
-- | Create a texture from an existing surface.
--
-- See SDL_CreateTextureFromSurface for C documentation.
createTextureFromSurface :: (Functor m, MonadIO m) => Renderer -> Surface -> m Texture
-- | Updates texture rectangle with new pixel data.
--
-- See SDL_UpdateTexture for C documentation.
updateTexture :: (Functor m, MonadIO m) => Texture -> Maybe (Rectangle CInt) -> ByteString -> CInt -> m Texture
-- | Destroy the specified texture.
--
-- See SDL_DestroyTexture for the C documentation.
destroyTexture :: MonadIO m => Texture -> m ()
-- | Bind an OpenGL/ES/ES2 texture to the current context for use with when
-- rendering OpenGL primitives directly.
--
-- See SDL_GL_BindTexture for C documentation.
glBindTexture :: (Functor m, MonadIO m) => Texture -> m ()
-- | Unbind an OpenGL/ES/ES2 texture from the current context.
--
-- See SDL_GL_UnbindTexture for C documentation.
glUnbindTexture :: (Functor m, MonadIO m) => Texture -> m ()
-- | Get or set the additional alpha value multiplied into render copy
-- operations.
--
-- This StateVar can be modified using $= and the current
-- value retrieved with get.
--
-- See SDL_SetTextureAlphaMod and
-- SDL_GetTextureAlphaMod for C documentation.
textureAlphaMod :: Texture -> StateVar Word8
-- | Get or set the blend mode used for texture copy operations.
--
-- This StateVar can be modified using $= and the current
-- value retrieved with get.
--
-- See SDL_SetTextureBlendMode and
-- SDL_GetTextureBlendMode for C documentation.
textureBlendMode :: Texture -> StateVar BlendMode
-- | Blend modes used in copy and drawing operations.
data BlendMode
-- | No blending
BlendNone :: BlendMode
-- | Alpha blending.
--
-- -- dstRGB = (srcRGB * srcA) + (dstRGB * (1-srcA)) -- dstA = srcA + (dstA * (1-srcA)) --BlendAlphaBlend :: BlendMode -- | Additive blending -- --
-- dstRGB = (srcRGB * srcA) + dstRGB -- dstA = dstA --BlendAdditive :: BlendMode -- | Color modulate -- -- @ dstRGB = srcRGB * dstRGB dstA = dstA BlendMod :: BlendMode -- | Get or set the additional color value multiplied into render copy -- operations. -- -- This StateVar can be modified using $= and the current -- value retrieved with get. -- -- See SDL_SetTextureColorMod and -- SDL_GetTextureColorMod for C documentation. textureColorMod :: Texture -> StateVar (V3 Word8) -- | Lock a portion of the texture for *write-only* pixel access. -- -- See SDL_LockTexture for C documentation. lockTexture :: MonadIO m => Texture -> Maybe (Rectangle CInt) -> m (Ptr (), CInt) -- | Unlock a texture, uploading the changes to video memory, if needed. -- -- Warning: See Bug No. 1586 before using this function! -- -- See SDL_UnlockTexture for C documentation. unlockTexture :: MonadIO m => Texture -> m () -- | Query the attributes of a texture. -- -- See SDL_QueryTexture for C documentation. queryTexture :: MonadIO m => Texture -> m TextureInfo data TextureInfo TextureInfo :: PixelFormat -> TextureAccess -> CInt -> CInt -> TextureInfo -- | Raw format of the texture; the actual format may differ, but pixel -- transfers will use this format [texturePixelFormat] :: TextureInfo -> PixelFormat -- | The access available to the texture [textureAccess] :: TextureInfo -> TextureAccess -- | The width of the texture [textureWidth] :: TextureInfo -> CInt -- | The height of the texture [textureHeight] :: TextureInfo -> CInt data Rectangle a Rectangle :: (Point V2 a) -> (V2 a) -> Rectangle a -- | Get information about a rendering context. -- -- See SDL_GetRendererInfo for C documentation. getRendererInfo :: MonadIO m => Renderer -> m RendererInfo -- | Information about an instantiated Renderer. data RendererInfo RendererInfo :: Text -> RendererConfig -> Word32 -> [PixelFormat] -> CInt -> CInt -> RendererInfo -- | The name of the renderer [rendererInfoName] :: RendererInfo -> Text -- | Supported renderer features [rendererInfoFlags] :: RendererInfo -> RendererConfig -- | The number of available texture formats [rendererInfoNumTextureFormats] :: RendererInfo -> Word32 -- | The available texture formats [rendererInfoTextureFormats] :: RendererInfo -> [PixelFormat] -- | The maximum texture width [rendererInfoMaxTextureWidth] :: RendererInfo -> CInt -- | The maximum texture height [rendererInfoMaxTextureHeight] :: RendererInfo -> CInt -- | Enumerate all known render drivers on the system, and determine their -- supported features. -- -- See SDL_GetRenderDriverInfo for C documentation. getRenderDriverInfo :: MonadIO m => m [RendererInfo] instance GHC.Show.Show SDL.Video.Renderer.RendererInfo instance GHC.Read.Read SDL.Video.Renderer.RendererInfo instance GHC.Classes.Ord SDL.Video.Renderer.RendererInfo instance GHC.Generics.Generic SDL.Video.Renderer.RendererInfo instance GHC.Classes.Eq SDL.Video.Renderer.RendererInfo instance GHC.Show.Show SDL.Video.Renderer.RendererConfig instance GHC.Read.Read SDL.Video.Renderer.RendererConfig instance GHC.Classes.Ord SDL.Video.Renderer.RendererConfig instance GHC.Generics.Generic SDL.Video.Renderer.RendererConfig instance GHC.Classes.Eq SDL.Video.Renderer.RendererConfig instance Data.Data.Data SDL.Video.Renderer.RendererConfig instance GHC.Show.Show SDL.Video.Renderer.RendererType instance GHC.Read.Read SDL.Video.Renderer.RendererType instance GHC.Classes.Ord SDL.Video.Renderer.RendererType instance GHC.Generics.Generic SDL.Video.Renderer.RendererType instance GHC.Classes.Eq SDL.Video.Renderer.RendererType instance GHC.Enum.Enum SDL.Video.Renderer.RendererType instance Data.Data.Data SDL.Video.Renderer.RendererType instance GHC.Enum.Bounded SDL.Video.Renderer.RendererType instance GHC.Show.Show SDL.Video.Renderer.TextureInfo instance GHC.Read.Read SDL.Video.Renderer.TextureInfo instance GHC.Classes.Ord SDL.Video.Renderer.TextureInfo instance GHC.Generics.Generic SDL.Video.Renderer.TextureInfo instance GHC.Classes.Eq SDL.Video.Renderer.TextureInfo instance GHC.Show.Show SDL.Video.Renderer.PixelFormat instance GHC.Read.Read SDL.Video.Renderer.PixelFormat instance GHC.Classes.Ord SDL.Video.Renderer.PixelFormat instance GHC.Generics.Generic SDL.Video.Renderer.PixelFormat instance GHC.Classes.Eq SDL.Video.Renderer.PixelFormat instance GHC.Enum.Enum SDL.Video.Renderer.PixelFormat instance Data.Data.Data SDL.Video.Renderer.PixelFormat instance GHC.Enum.Bounded SDL.Video.Renderer.PixelFormat instance GHC.Classes.Eq SDL.Video.Renderer.Texture instance GHC.Show.Show a => GHC.Show.Show (SDL.Video.Renderer.Rectangle a) instance GHC.Read.Read a => GHC.Read.Read (SDL.Video.Renderer.Rectangle a) instance GHC.Classes.Ord a => GHC.Classes.Ord (SDL.Video.Renderer.Rectangle a) instance GHC.Generics.Generic (SDL.Video.Renderer.Rectangle a) instance GHC.Base.Functor SDL.Video.Renderer.Rectangle instance GHC.Classes.Eq a => GHC.Classes.Eq (SDL.Video.Renderer.Rectangle a) instance GHC.Show.Show SDL.Video.Renderer.BlendMode instance GHC.Read.Read SDL.Video.Renderer.BlendMode instance GHC.Classes.Ord SDL.Video.Renderer.BlendMode instance GHC.Generics.Generic SDL.Video.Renderer.BlendMode instance GHC.Classes.Eq SDL.Video.Renderer.BlendMode instance GHC.Enum.Enum SDL.Video.Renderer.BlendMode instance Data.Data.Data SDL.Video.Renderer.BlendMode instance GHC.Enum.Bounded SDL.Video.Renderer.BlendMode instance GHC.Classes.Eq SDL.Video.Renderer.Palette instance GHC.Classes.Eq SDL.Video.Renderer.SurfacePixelFormat instance GHC.Show.Show SDL.Video.Renderer.TextureAccess instance GHC.Read.Read SDL.Video.Renderer.TextureAccess instance GHC.Classes.Ord SDL.Video.Renderer.TextureAccess instance GHC.Generics.Generic SDL.Video.Renderer.TextureAccess instance GHC.Classes.Eq SDL.Video.Renderer.TextureAccess instance GHC.Enum.Enum SDL.Video.Renderer.TextureAccess instance Data.Data.Data SDL.Video.Renderer.TextureAccess instance GHC.Enum.Bounded SDL.Video.Renderer.TextureAccess instance SDL.Internal.Numbered.FromNumber SDL.Video.Renderer.RendererConfig GHC.Word.Word32 instance SDL.Internal.Numbered.ToNumber SDL.Video.Renderer.RendererConfig GHC.Word.Word32 instance SDL.Internal.Numbered.FromNumber SDL.Video.Renderer.PixelFormat GHC.Word.Word32 instance SDL.Internal.Numbered.ToNumber SDL.Video.Renderer.PixelFormat GHC.Word.Word32 instance Foreign.Storable.Storable a => Foreign.Storable.Storable (SDL.Video.Renderer.Rectangle a) instance SDL.Internal.Numbered.FromNumber SDL.Video.Renderer.BlendMode GHC.Word.Word32 instance SDL.Internal.Numbered.ToNumber SDL.Video.Renderer.BlendMode GHC.Word.Word32 instance SDL.Internal.Numbered.FromNumber SDL.Video.Renderer.TextureAccess Foreign.C.Types.CInt instance SDL.Internal.Numbered.ToNumber SDL.Video.Renderer.TextureAccess Foreign.C.Types.CInt module SDL.Video data Window -- | Create a window with the given title and configuration. -- -- Throws SDLException on failure. createWindow :: MonadIO m => Text -> WindowConfig -> m Window -- | Default configuration for windows. Use the record update syntax to -- override any of the defaults. -- --
-- defaultWindow = WindowConfig
-- { windowBorder = True
-- , windowHighDPI = False
-- , windowInputGrabbed = False
-- , windowMode = Windowed
-- , windowOpenGL = Nothing
-- , windowPosition = Wherever
-- , windowResizable = False
-- , windowInitialSize = V2 800 600
-- , windowVisible = True
-- }
--
defaultWindow :: WindowConfig
data WindowConfig
WindowConfig :: Bool -> Bool -> Bool -> WindowMode -> Maybe OpenGLConfig -> WindowPosition -> Bool -> V2 CInt -> Bool -> WindowConfig
-- | Defaults to True.
[windowBorder] :: WindowConfig -> Bool
-- | Defaults to False. Can not be changed after window creation.
[windowHighDPI] :: WindowConfig -> Bool
-- | Defaults to False. Whether the mouse shall be confined to the
-- window.
[windowInputGrabbed] :: WindowConfig -> Bool
-- | Defaults to Windowed.
[windowMode] :: WindowConfig -> WindowMode
-- | Defaults to Nothing. Can not be changed after window creation.
[windowOpenGL] :: WindowConfig -> Maybe OpenGLConfig
-- | Defaults to Wherever.
[windowPosition] :: WindowConfig -> WindowPosition
-- | Defaults to False. Whether the window can be resized by the
-- user. It is still possible to programatically change the size by
-- changing windowSize.
[windowResizable] :: WindowConfig -> Bool
-- | Defaults to (800, 600). If you set windowHighDPI flag,
-- window size in screen coordinates may differ from the size in pixels.
-- Use glGetDrawableSize to get size in pixels.
[windowInitialSize] :: WindowConfig -> V2 CInt
-- | Defaults to True.
[windowVisible] :: WindowConfig -> Bool
data WindowMode
-- | Real fullscreen with a video mode change
Fullscreen :: WindowMode
-- | Fake fullscreen that takes the size of the desktop
FullscreenDesktop :: WindowMode
Maximized :: WindowMode
Minimized :: WindowMode
Windowed :: WindowMode
data WindowPosition
Centered :: WindowPosition
-- | Let the window mananger decide where it's best to place the window.
Wherever :: WindowPosition
Absolute :: (Point V2 CInt) -> WindowPosition
-- | Destroy the given window. The Window handler may not be used
-- afterwards.
destroyWindow :: MonadIO m => Window -> m ()
-- | Hide a window.
--
-- See SDL_HideWindow for C documentation.
hideWindow :: MonadIO m => Window -> m ()
-- | Raise the window above other windows and set the input focus.
--
-- See SDL_RaiseWindow for C documentation.
raiseWindow :: MonadIO m => Window -> m ()
-- | Show a window.
--
-- See SDL_ShowWindow for C documentation.
showWindow :: MonadIO m => Window -> m ()
-- | Get or set the minimum size of a window's client area.
--
-- This StateVar can be modified using $= and the current
-- value retrieved with get.
--
-- See SDL_SetWindowMinimumSize and
-- SDL_GetWindowMinimumSize for C documentation.
windowMinimumSize :: Window -> StateVar (V2 CInt)
-- | Get or set the maximum size of a window's client area.
--
-- This StateVar can be modified using $= and the current
-- value retrieved with get.
--
-- See SDL_SetWindowMaximumSize and
-- SDL_GetWindowMaximumSize for C documentation.
windowMaximumSize :: Window -> StateVar (V2 CInt)
-- | Get or set the size of a window's client area. Values beyond the
-- maximum supported size are clamped.
--
-- If window was created with windowHighDPI flag, this size may
-- differ from the size in pixels. Use glGetDrawableSize to get
-- size in pixels.
--
-- This StateVar can be modified using $= and the current
-- value retrieved with get.
--
-- See SDL_SetWindowSize and
-- SDL_GetWindowSize for C documentation.
windowSize :: Window -> StateVar (V2 CInt)
-- | Get or set if the window should have a border.
--
-- This StateVar can be modified using $= and the current
-- value retrieved with get.
windowBordered :: Window -> StateVar Bool
-- | Get or set the window's brightness, where 0.0 is completely dark and
-- 1.0 is normal brightness.
--
-- Throws SDLException if the hardware does not support gamma
-- correction, or if the system has run out of memory.
--
-- This StateVar can be modified using $= and the current
-- value retrieved with get.
windowBrightness :: Window -> StateVar Float
-- | Gets or sets the gamma ramp for the display that owns a given window.
--
-- Note that the data for the gamma ramp - the V3 (Vector
-- Word16) - must contain 256 element arrays. This triple is a set
-- of translation vectors for each of the 16-bit red, green and blue
-- channels.
--
-- This StateVar can be modified using $= and the current
-- value retrieved with get.
--
-- Despite the name and signature, this method retrieves the gamma ramp
-- of the entire display, not an individual window. A window is
-- considered to be owned by the display that contains the window's
-- center pixel.
windowGammaRamp :: Window -> StateVar (V3 (Vector Word16))
-- | Get or set whether the mouse shall be confined to the window.
--
-- This StateVar can be modified using $= and the current
-- value retrieved with get.
windowGrab :: Window -> StateVar Bool
-- | Change between window modes.
--
-- Throws SDLException on failure.
setWindowMode :: MonadIO m => Window -> WindowMode -> m ()
-- | Get the position of the window.
getWindowAbsolutePosition :: MonadIO m => Window -> m (V2 CInt)
-- | Set the position of the window.
setWindowPosition :: MonadIO m => Window -> WindowPosition -> m ()
-- | Get or set the title of the window. If the window has no title, then
-- an empty string is returned.
--
-- This StateVar can be modified using $= and the current
-- value retrieved with get.
--
-- See SDL_SetWindowTitle and
-- SDL_GetWindowTitle for C documentation.
windowTitle :: Window -> StateVar Text
-- | Get or set the pointer to arbitrary user data associated with the
-- given window and name.
--
-- This StateVar can be modified using $= and the current
-- value retrieved with get.
windowData :: Window -> CString -> StateVar (Ptr ())
-- | Retrieve the configuration of the given window.
--
-- Note that Nothing will be returned instead of potential OpenGL
-- parameters used during the creation of the window.
getWindowConfig :: MonadIO m => Window -> m WindowConfig
-- | Get the pixel format that is used for the given window.
getWindowPixelFormat :: MonadIO m => Window -> m PixelFormat
data PixelFormat
Unknown :: PixelFormat
Index1LSB :: PixelFormat
Index1MSB :: PixelFormat
Index4LSB :: PixelFormat
Index4MSB :: PixelFormat
Index8 :: PixelFormat
RGB332 :: PixelFormat
RGB444 :: PixelFormat
RGB555 :: PixelFormat
BGR555 :: PixelFormat
ARGB4444 :: PixelFormat
RGBA4444 :: PixelFormat
ABGR4444 :: PixelFormat
BGRA4444 :: PixelFormat
ARGB1555 :: PixelFormat
RGBA5551 :: PixelFormat
ABGR1555 :: PixelFormat
BGRA5551 :: PixelFormat
RGB565 :: PixelFormat
BGR565 :: PixelFormat
RGB24 :: PixelFormat
BGR24 :: PixelFormat
RGB888 :: PixelFormat
RGBX8888 :: PixelFormat
BGR888 :: PixelFormat
BGRX8888 :: PixelFormat
ARGB8888 :: PixelFormat
RGBA8888 :: PixelFormat
ABGR8888 :: PixelFormat
BGRA8888 :: PixelFormat
ARGB2101010 :: PixelFormat
YV12 :: PixelFormat
IYUV :: PixelFormat
YUY2 :: PixelFormat
UYVY :: PixelFormat
YVYU :: PixelFormat
createRenderer :: MonadIO m => Window -> CInt -> RendererConfig -> m Renderer
-- | Create a 2D software rendering context for the given surface.
--
-- See https://wiki.libsdl.org/SDL_CreateSoftwareRenderer
createSoftwareRenderer :: MonadIO m => Surface -> m Renderer
destroyRenderer :: MonadIO m => Renderer -> m ()
-- | Get the text from the clipboard.
--
-- Throws SDLException on failure.
getClipboardText :: MonadIO m => m Text
-- | Checks if the clipboard exists, and has some text in it.
hasClipboardText :: MonadIO m => m Bool
-- | Replace the contents of the clipboard with the given text.
--
-- Throws SDLException on failure.
setClipboardText :: MonadIO m => Text -> m ()
-- | Throws SDLException on failure.
getDisplays :: MonadIO m => m [Display]
data Display
Display :: String -> Point V2 CInt -> V2 CInt -> [DisplayMode] -> Display
[displayName] :: Display -> String
-- | Position of the desktop area represented by the display, with the
-- primary display located at (0, 0).
[displayBoundsPosition] :: Display -> Point V2 CInt
-- | Size of the desktop area represented by the display.
[displayBoundsSize] :: Display -> V2 CInt
[displayModes] :: Display -> [DisplayMode]
data DisplayMode
DisplayMode :: PixelFormat -> V2 CInt -> CInt -> DisplayMode
[displayModeFormat] :: DisplayMode -> PixelFormat
[displayModeSize] :: DisplayMode -> V2 CInt
-- | Display's refresh rate in hertz, or 0 if unspecified.
[displayModeRefreshRate] :: DisplayMode -> CInt
data VideoDriver
VideoDriver :: String -> VideoDriver
[videoDriverName] :: VideoDriver -> String
-- | Get or set whether to allow the screen to be blanked by a screen
-- saver.
--
-- Screen savers are re-enabled, if needed, when SDL quits.
screenSaverEnabled :: StateVar Bool
-- | Show a simple message box with the given title and a message. Consider
-- writing your messages to stderr too.
--
-- Throws SDLException if there are no available video targets.
showSimpleMessageBox :: MonadIO m => Maybe Window -> MessageKind -> Text -> Text -> m ()
data MessageKind
Error :: MessageKind
Warning :: MessageKind
Information :: MessageKind
instance GHC.Show.Show SDL.Video.MessageKind
instance GHC.Read.Read SDL.Video.MessageKind
instance GHC.Classes.Ord SDL.Video.MessageKind
instance GHC.Generics.Generic SDL.Video.MessageKind
instance GHC.Classes.Eq SDL.Video.MessageKind
instance GHC.Enum.Enum SDL.Video.MessageKind
instance Data.Data.Data SDL.Video.MessageKind
instance GHC.Enum.Bounded SDL.Video.MessageKind
instance GHC.Show.Show SDL.Video.VideoDriver
instance GHC.Read.Read SDL.Video.VideoDriver
instance GHC.Classes.Ord SDL.Video.VideoDriver
instance GHC.Generics.Generic SDL.Video.VideoDriver
instance GHC.Classes.Eq SDL.Video.VideoDriver
instance Data.Data.Data SDL.Video.VideoDriver
instance GHC.Show.Show SDL.Video.Display
instance GHC.Read.Read SDL.Video.Display
instance GHC.Classes.Ord SDL.Video.Display
instance GHC.Generics.Generic SDL.Video.Display
instance GHC.Classes.Eq SDL.Video.Display
instance GHC.Show.Show SDL.Video.DisplayMode
instance GHC.Read.Read SDL.Video.DisplayMode
instance GHC.Classes.Ord SDL.Video.DisplayMode
instance GHC.Generics.Generic SDL.Video.DisplayMode
instance GHC.Classes.Eq SDL.Video.DisplayMode
instance GHC.Show.Show SDL.Video.WindowConfig
instance GHC.Read.Read SDL.Video.WindowConfig
instance GHC.Classes.Ord SDL.Video.WindowConfig
instance GHC.Generics.Generic SDL.Video.WindowConfig
instance GHC.Classes.Eq SDL.Video.WindowConfig
instance GHC.Show.Show SDL.Video.WindowPosition
instance GHC.Read.Read SDL.Video.WindowPosition
instance GHC.Classes.Ord SDL.Video.WindowPosition
instance GHC.Generics.Generic SDL.Video.WindowPosition
instance GHC.Classes.Eq SDL.Video.WindowPosition
instance GHC.Show.Show SDL.Video.WindowMode
instance GHC.Read.Read SDL.Video.WindowMode
instance GHC.Classes.Ord SDL.Video.WindowMode
instance GHC.Generics.Generic SDL.Video.WindowMode
instance GHC.Classes.Eq SDL.Video.WindowMode
instance GHC.Enum.Enum SDL.Video.WindowMode
instance Data.Data.Data SDL.Video.WindowMode
instance GHC.Enum.Bounded SDL.Video.WindowMode
instance SDL.Internal.Numbered.ToNumber SDL.Video.MessageKind GHC.Word.Word32
instance SDL.Internal.Numbered.ToNumber SDL.Video.WindowMode GHC.Word.Word32
instance SDL.Internal.Numbered.FromNumber SDL.Video.WindowMode GHC.Word.Word32
module SDL.Input.Mouse
data LocationMode
AbsoluteLocation :: LocationMode
RelativeLocation :: LocationMode
-- | Sets the current relative mouse mode.
--
-- When relative mouse mode is enabled, cursor is hidden and mouse
-- position will not change. However, you will be delivered relative
-- mouse position change events.
setMouseLocationMode :: (Functor m, MonadIO m) => LocationMode -> m LocationMode
-- | Check which mouse location mode is currently active.
getMouseLocationMode :: MonadIO m => m LocationMode
data MouseButton
ButtonLeft :: MouseButton
ButtonMiddle :: MouseButton
ButtonRight :: MouseButton
ButtonX1 :: MouseButton
ButtonX2 :: MouseButton
-- | An unknown mouse button.
ButtonExtra :: !Int -> MouseButton
-- | Identifies what kind of mouse-like device this is.
data MouseDevice
-- | An actual mouse. The number identifies which mouse.
Mouse :: !Int -> MouseDevice
-- | Some sort of touch device.
Touch :: MouseDevice
-- | Identifies mouse scroll direction.
data MouseScrollDirection
ScrollNormal :: MouseScrollDirection
ScrollFlipped :: MouseScrollDirection
-- | Return proper mouse location depending on mouse mode
getModalMouseLocation :: MonadIO m => m ModalLocation
-- | Retrieve the current location of the mouse, relative to the currently
-- focused window.
getAbsoluteMouseLocation :: MonadIO m => m (Point V2 CInt)
-- | Retrieve mouse motion
getRelativeMouseLocation :: MonadIO m => m (V2 CInt)
-- | Retrieve a mapping of which buttons are currently held down.
getMouseButtons :: MonadIO m => m (MouseButton -> Bool)
data WarpMouseOrigin
-- | Move the mouse pointer within a given Window.
WarpInWindow :: Window -> WarpMouseOrigin
-- | Move the mouse pointer within whichever Window currently has
-- focus.
WarpCurrentFocus :: WarpMouseOrigin
-- | Move the mouse pointer in global screen space.
WarpGlobal :: WarpMouseOrigin
-- | Move the current location of a mouse pointer. The
-- WarpMouseOrigin specifies the origin for the given warp
-- coordinates.
warpMouse :: MonadIO m => WarpMouseOrigin -> Point V2 CInt -> m ()
-- | Get or set whether the cursor is currently visible.
--
-- This StateVar can be modified using $= and the current
-- value retrieved with get.
--
-- See SDL_ShowCursor and SDL_HideCursor
-- for C documentation.
cursorVisible :: StateVar Bool
data Cursor
-- | Get or set the currently active cursor. You can create new
-- Cursors with createCursor.
--
-- This StateVar can be modified using $= and the current
-- value retrieved with get.
--
-- See SDL_SetCursor and SDL_GetCursor
-- for C documentation.
activeCursor :: StateVar Cursor
-- | Create a cursor using the specified bitmap data and mask (in MSB
-- format).
createCursor :: MonadIO m => Vector Bool -> Vector Bool -> V2 CInt -> Point V2 CInt -> m Cursor
-- | Free a cursor created with createCursor and
-- createColorCusor.
--
-- See SDL_FreeCursor for C documentation.
freeCursor :: MonadIO m => Cursor -> m ()
-- | Create a color cursor.
--
-- See SDL_CreateColorCursor for C documentation.
createColorCursor :: MonadIO m => Surface -> Point V2 CInt -> m Cursor
instance GHC.Classes.Eq SDL.Input.Mouse.Cursor
instance GHC.Show.Show SDL.Input.Mouse.WarpMouseOrigin
instance GHC.Classes.Ord SDL.Input.Mouse.WarpMouseOrigin
instance GHC.Generics.Generic SDL.Input.Mouse.WarpMouseOrigin
instance GHC.Classes.Eq SDL.Input.Mouse.WarpMouseOrigin
instance Data.Data.Data SDL.Input.Mouse.WarpMouseOrigin
instance GHC.Show.Show SDL.Input.Mouse.MouseScrollDirection
instance GHC.Read.Read SDL.Input.Mouse.MouseScrollDirection
instance GHC.Classes.Ord SDL.Input.Mouse.MouseScrollDirection
instance GHC.Generics.Generic SDL.Input.Mouse.MouseScrollDirection
instance GHC.Enum.Enum SDL.Input.Mouse.MouseScrollDirection
instance GHC.Classes.Eq SDL.Input.Mouse.MouseScrollDirection
instance Data.Data.Data SDL.Input.Mouse.MouseScrollDirection
instance GHC.Enum.Bounded SDL.Input.Mouse.MouseScrollDirection
instance GHC.Show.Show SDL.Input.Mouse.MouseDevice
instance GHC.Read.Read SDL.Input.Mouse.MouseDevice
instance GHC.Classes.Ord SDL.Input.Mouse.MouseDevice
instance GHC.Generics.Generic SDL.Input.Mouse.MouseDevice
instance GHC.Classes.Eq SDL.Input.Mouse.MouseDevice
instance Data.Data.Data SDL.Input.Mouse.MouseDevice
instance GHC.Show.Show SDL.Input.Mouse.MouseButton
instance GHC.Read.Read SDL.Input.Mouse.MouseButton
instance GHC.Classes.Ord SDL.Input.Mouse.MouseButton
instance GHC.Generics.Generic SDL.Input.Mouse.MouseButton
instance GHC.Classes.Eq SDL.Input.Mouse.MouseButton
instance Data.Data.Data SDL.Input.Mouse.MouseButton
instance GHC.Show.Show SDL.Input.Mouse.ModalLocation
instance GHC.Read.Read SDL.Input.Mouse.ModalLocation
instance GHC.Classes.Ord SDL.Input.Mouse.ModalLocation
instance GHC.Generics.Generic SDL.Input.Mouse.ModalLocation
instance GHC.Classes.Eq SDL.Input.Mouse.ModalLocation
instance GHC.Show.Show SDL.Input.Mouse.LocationMode
instance GHC.Read.Read SDL.Input.Mouse.LocationMode
instance GHC.Classes.Ord SDL.Input.Mouse.LocationMode
instance GHC.Generics.Generic SDL.Input.Mouse.LocationMode
instance GHC.Enum.Enum SDL.Input.Mouse.LocationMode
instance GHC.Classes.Eq SDL.Input.Mouse.LocationMode
instance Data.Data.Data SDL.Input.Mouse.LocationMode
instance GHC.Enum.Bounded SDL.Input.Mouse.LocationMode
instance SDL.Internal.Numbered.FromNumber SDL.Input.Mouse.MouseScrollDirection GHC.Word.Word32
instance SDL.Internal.Numbered.FromNumber SDL.Input.Mouse.MouseDevice GHC.Word.Word32
instance SDL.Internal.Numbered.FromNumber SDL.Input.Mouse.MouseButton GHC.Word.Word8
instance SDL.Internal.Numbered.ToNumber SDL.Input.Mouse.MouseButton GHC.Word.Word8
module SDL.Input
-- | SDL.Event exports an interface for working with the SDL event
-- model. Event handling allows your application to receive input from
-- the user. Internally, SDL stores all the events waiting to be handled
-- in an event queue. Using functions like pollEvent and
-- waitEvent you can observe and handle waiting input events.
--
-- The event queue itself is composed of a series of Event values,
-- one for each waiting event. Event values are read from the
-- queue with the pollEvent function and it is then up to the
-- application to process the information stored with them.
module SDL.Event
-- | Poll for currently pending events. You can only call this function in
-- the thread that set the video mode.
pollEvent :: MonadIO m => m (Maybe Event)
-- | Clear the event queue by polling for all pending events.
pollEvents :: (Functor m, MonadIO m) => m [Event]
-- | Run a monadic computation, accumulating over all known Events.
--
-- This can be useful when used with a state monad, allowing you to fold
-- all events together.
mapEvents :: MonadIO m => (Event -> m ()) -> m ()
-- | Pump the event loop, gathering events from the input devices.
--
-- This function updates the event queue and internal input device state.
--
-- This should only be run in the thread that initialized the video
-- subsystem, and for extra safety, you should consider only doing those
-- things on the main thread in any case.
--
-- 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 SDL_PumpEvents for C documentation.
pumpEvents :: MonadIO m => m ()
-- | Wait indefinitely for the next available event.
waitEvent :: MonadIO m => m Event
-- | Wait until the specified timeout for the next available amount.
waitEventTimeout :: MonadIO m => CInt -> m (Maybe Event)
-- | A user defined event structure that has been registered with SDL.
--
-- Use registerEvent, below, to obtain an instance.
data RegisteredEventType a
RegisteredEventType :: a -> IO EventPushResult -> Event -> IO (Maybe a) -> RegisteredEventType a
[pushRegisteredEvent] :: RegisteredEventType a -> a -> IO EventPushResult
[getRegisteredEvent] :: RegisteredEventType a -> Event -> IO (Maybe a)
-- | A record used to convert between SDL Events and user-defined data
-- structures.
--
-- Used for registerEvent, below.
data RegisteredEventData
RegisteredEventData :: !(Maybe Window) -> !Int32 -> !(Ptr ()) -> !(Ptr ()) -> RegisteredEventData
-- | The associated Window.
[registeredEventWindow] :: RegisteredEventData -> !(Maybe Window)
-- | User defined event code.
[registeredEventCode] :: RegisteredEventData -> !Int32
-- | User defined data pointer.
[registeredEventData1] :: RegisteredEventData -> !(Ptr ())
-- | User defined data pointer.
[registeredEventData2] :: RegisteredEventData -> !(Ptr ())
-- | Possible results of an attempted push of an event to the queue.
data EventPushResult
EventPushSuccess :: EventPushResult
EventPushFiltered :: EventPushResult
EventPushFailure :: Text -> EventPushResult
-- | A registered event with no associated data.
--
-- This is a resonable baseline to modify for converting to
-- RegisteredEventData.
emptyRegisteredEvent :: RegisteredEventData
-- | Register a new event type with SDL.
--
-- Provide functions that convert between UserEventData and your
-- structure. You can then use pushRegisteredEvent to add a custom
-- event of the registered type to the queue, and
-- getRegisteredEvent to test for such events in the main loop.
registerEvent :: MonadIO m => (RegisteredEventData -> Timestamp -> IO (Maybe a)) -> (a -> IO RegisteredEventData) -> m (Maybe (RegisteredEventType a))
-- | An EventWatchCallback can process and respond to an event when
-- it is added to the event queue.
type EventWatchCallback = Event -> IO ()
data EventWatch
-- | Trigger an EventWatchCallback when an event is added to the SDL
-- event queue.
--
-- See https://wiki.libsdl.org/SDL_AddEventWatch for C
-- documentation.
addEventWatch :: MonadIO m => EventWatchCallback -> m EventWatch
-- | Remove an EventWatch.
--
-- See https://wiki.libsdl.org/SDL_DelEventWatch for C
-- documentation.
delEventWatch :: MonadIO m => EventWatch -> m ()
-- | A single SDL event. This event occured at eventTimestamp and
-- carries data under eventPayload.
data Event
Event :: Timestamp -> EventPayload -> Event
-- | The time the event occured.
[eventTimestamp] :: Event -> Timestamp
-- | Data pertaining to this event.
[eventPayload] :: Event -> EventPayload
type Timestamp = Word32
-- | An enumeration of all possible SDL event types. This data type pairs
-- up event types with their payload, where possible.
data EventPayload
WindowShownEvent :: !WindowShownEventData -> EventPayload
WindowHiddenEvent :: !WindowHiddenEventData -> EventPayload
WindowExposedEvent :: !WindowExposedEventData -> EventPayload
WindowMovedEvent :: !WindowMovedEventData -> EventPayload
WindowResizedEvent :: !WindowResizedEventData -> EventPayload
WindowSizeChangedEvent :: !WindowSizeChangedEventData -> EventPayload
WindowMinimizedEvent :: !WindowMinimizedEventData -> EventPayload
WindowMaximizedEvent :: !WindowMaximizedEventData -> EventPayload
WindowRestoredEvent :: !WindowRestoredEventData -> EventPayload
WindowGainedMouseFocusEvent :: !WindowGainedMouseFocusEventData -> EventPayload
WindowLostMouseFocusEvent :: !WindowLostMouseFocusEventData -> EventPayload
WindowGainedKeyboardFocusEvent :: !WindowGainedKeyboardFocusEventData -> EventPayload
WindowLostKeyboardFocusEvent :: !WindowLostKeyboardFocusEventData -> EventPayload
WindowClosedEvent :: !WindowClosedEventData -> EventPayload
KeyboardEvent :: !KeyboardEventData -> EventPayload
TextEditingEvent :: !TextEditingEventData -> EventPayload
TextInputEvent :: !TextInputEventData -> EventPayload
KeymapChangedEvent :: EventPayload
MouseMotionEvent :: !MouseMotionEventData -> EventPayload
MouseButtonEvent :: !MouseButtonEventData -> EventPayload
MouseWheelEvent :: !MouseWheelEventData -> EventPayload
JoyAxisEvent :: !JoyAxisEventData -> EventPayload
JoyBallEvent :: !JoyBallEventData -> EventPayload
JoyHatEvent :: !JoyHatEventData -> EventPayload
JoyButtonEvent :: !JoyButtonEventData -> EventPayload
JoyDeviceEvent :: !JoyDeviceEventData -> EventPayload
ControllerAxisEvent :: !ControllerAxisEventData -> EventPayload
ControllerButtonEvent :: !ControllerButtonEventData -> EventPayload
ControllerDeviceEvent :: !ControllerDeviceEventData -> EventPayload
AudioDeviceEvent :: !AudioDeviceEventData -> EventPayload
QuitEvent :: EventPayload
UserEvent :: !UserEventData -> EventPayload
SysWMEvent :: !SysWMEventData -> EventPayload
TouchFingerEvent :: !TouchFingerEventData -> EventPayload
TouchFingerMotionEvent :: !TouchFingerMotionEventData -> EventPayload
MultiGestureEvent :: !MultiGestureEventData -> EventPayload
DollarGestureEvent :: !DollarGestureEventData -> EventPayload
DropEvent :: !DropEventData -> EventPayload
ClipboardUpdateEvent :: EventPayload
UnknownEvent :: !UnknownEventData -> EventPayload
-- | A window has been shown.
newtype WindowShownEventData
WindowShownEventData :: Window -> WindowShownEventData
-- | The associated Window.
[windowShownEventWindow] :: WindowShownEventData -> Window
-- | A window has been hidden.
newtype WindowHiddenEventData
WindowHiddenEventData :: Window -> WindowHiddenEventData
-- | The associated Window.
[windowHiddenEventWindow] :: WindowHiddenEventData -> Window
-- | A part of a window has been exposed - where exposure means to become
-- visible (for example, an overlapping window no longer overlaps with
-- the window).
newtype WindowExposedEventData
WindowExposedEventData :: Window -> WindowExposedEventData
-- | The associated Window.
[windowExposedEventWindow] :: WindowExposedEventData -> Window
-- | A Window has been moved.
data WindowMovedEventData
WindowMovedEventData :: !Window -> !(Point V2 Int32) -> WindowMovedEventData
-- | The associated Window.
[windowMovedEventWindow] :: WindowMovedEventData -> !Window
-- | The new position of the Window.
[windowMovedEventPosition] :: WindowMovedEventData -> !(Point V2 Int32)
-- | Window has been resized. This is event is always preceded by
-- WindowSizeChangedEvent.
data WindowResizedEventData
WindowResizedEventData :: !Window -> !(V2 Int32) -> WindowResizedEventData
-- | The associated Window.
[windowResizedEventWindow] :: WindowResizedEventData -> !Window
-- | The new size of the Window.
[windowResizedEventSize] :: WindowResizedEventData -> !(V2 Int32)
-- | The window size has changed, either as a result of an API call or
-- through the system or user changing the window size; this event is
-- followed by WindowResizedEvent if the size was changed by an
-- external event, i.e. the user or the window manager.
data WindowSizeChangedEventData
WindowSizeChangedEventData :: !Window -> !(V2 Int32) -> WindowSizeChangedEventData
-- | The associated Window.
[windowSizeChangedEventWindow] :: WindowSizeChangedEventData -> !Window
-- | The new size of the Window.
[windowSizeChangedEventSize] :: WindowSizeChangedEventData -> !(V2 Int32)
-- | The window has been minimized.
newtype WindowMinimizedEventData
WindowMinimizedEventData :: Window -> WindowMinimizedEventData
-- | The associated Window.
[windowMinimizedEventWindow] :: WindowMinimizedEventData -> Window
-- | The window has been maximized.
newtype WindowMaximizedEventData
WindowMaximizedEventData :: Window -> WindowMaximizedEventData
-- | The associated Window.
[windowMaximizedEventWindow] :: WindowMaximizedEventData -> Window
-- | The window has been restored to normal size and position.
newtype WindowRestoredEventData
WindowRestoredEventData :: Window -> WindowRestoredEventData
-- | The associated Window.
[windowRestoredEventWindow] :: WindowRestoredEventData -> Window
-- | The window has gained mouse focus.
newtype WindowGainedMouseFocusEventData
WindowGainedMouseFocusEventData :: Window -> WindowGainedMouseFocusEventData
-- | The associated Window.
[windowGainedMouseFocusEventWindow] :: WindowGainedMouseFocusEventData -> Window
-- | The window has lost mouse focus.
newtype WindowLostMouseFocusEventData
WindowLostMouseFocusEventData :: Window -> WindowLostMouseFocusEventData
-- | The associated Window.
[windowLostMouseFocusEventWindow] :: WindowLostMouseFocusEventData -> Window
-- | The window has gained keyboard focus.
newtype WindowGainedKeyboardFocusEventData
WindowGainedKeyboardFocusEventData :: Window -> WindowGainedKeyboardFocusEventData
-- | The associated Window.
[windowGainedKeyboardFocusEventWindow] :: WindowGainedKeyboardFocusEventData -> Window
-- | The window has lost keyboard focus.
newtype WindowLostKeyboardFocusEventData
WindowLostKeyboardFocusEventData :: Window -> WindowLostKeyboardFocusEventData
-- | The associated Window.
[windowLostKeyboardFocusEventWindow] :: WindowLostKeyboardFocusEventData -> Window
-- | The window manager requests that the window be closed.
newtype WindowClosedEventData
WindowClosedEventData :: Window -> WindowClosedEventData
-- | The associated Window.
[windowClosedEventWindow] :: WindowClosedEventData -> Window
-- | A video driver dependent system event
newtype SysWMEventData
SysWMEventData :: SysWMmsg -> SysWMEventData
[sysWMEventMsg] :: SysWMEventData -> SysWMmsg
-- | A keyboard key has been pressed or released.
data KeyboardEventData
KeyboardEventData :: !(Maybe Window) -> !InputMotion -> !Bool -> !Keysym -> KeyboardEventData
-- | The Window with keyboard focus, if any.
[keyboardEventWindow] :: KeyboardEventData -> !(Maybe Window)
-- | Whether the key was pressed or released.
[keyboardEventKeyMotion] :: KeyboardEventData -> !InputMotion
-- | True if this is a repeating key press from the user holding the
-- key down.
[keyboardEventRepeat] :: KeyboardEventData -> !Bool
-- | A description of the key that this event pertains to.
[keyboardEventKeysym] :: KeyboardEventData -> !Keysym
-- | Keyboard text editing event information.
data TextEditingEventData
TextEditingEventData :: !(Maybe Window) -> !Text -> !Int32 -> !Int32 -> TextEditingEventData
-- | The Window with keyboard focus, if any.
[textEditingEventWindow] :: TextEditingEventData -> !(Maybe Window)
-- | The editing text.
[textEditingEventText] :: TextEditingEventData -> !Text
-- | The location to begin editing from.
[textEditingEventStart] :: TextEditingEventData -> !Int32
-- | The number of characters to edit from the start point.
[textEditingEventLength] :: TextEditingEventData -> !Int32
-- | Keyboard text input event information.
data TextInputEventData
TextInputEventData :: !(Maybe Window) -> !Text -> TextInputEventData
-- | The Window with keyboard focus, if any.
[textInputEventWindow] :: TextInputEventData -> !(Maybe Window)
-- | The input text.
[textInputEventText] :: TextInputEventData -> !Text
-- | A mouse or pointer device was moved.
data MouseMotionEventData
MouseMotionEventData :: !(Maybe Window) -> !MouseDevice -> ![MouseButton] -> !(Point V2 Int32) -> !(V2 Int32) -> MouseMotionEventData
-- | The Window with mouse focus, if any.
[mouseMotionEventWindow] :: MouseMotionEventData -> !(Maybe Window)
-- | The MouseDevice that was moved.
[mouseMotionEventWhich] :: MouseMotionEventData -> !MouseDevice
-- | A collection of MouseButtons that are currently held down.
[mouseMotionEventState] :: MouseMotionEventData -> ![MouseButton]
-- | The new position of the mouse.
[mouseMotionEventPos] :: MouseMotionEventData -> !(Point V2 Int32)
-- | The relative mouse motion of the mouse.
[mouseMotionEventRelMotion] :: MouseMotionEventData -> !(V2 Int32)
-- | A mouse or pointer device button was pressed or released.
data MouseButtonEventData
MouseButtonEventData :: !(Maybe Window) -> !InputMotion -> !MouseDevice -> !MouseButton -> !Word8 -> !(Point V2 Int32) -> MouseButtonEventData
-- | The Window with mouse focus, if any.
[mouseButtonEventWindow] :: MouseButtonEventData -> !(Maybe Window)
-- | Whether the button was pressed or released.
[mouseButtonEventMotion] :: MouseButtonEventData -> !InputMotion
-- | The MouseDevice whose button was pressed or released.
[mouseButtonEventWhich] :: MouseButtonEventData -> !MouseDevice
-- | The button that was pressed or released.
[mouseButtonEventButton] :: MouseButtonEventData -> !MouseButton
-- | The amount of clicks. 1 for a single-click, 2 for a double-click, etc.
[mouseButtonEventClicks] :: MouseButtonEventData -> !Word8
-- | The coordinates of the mouse click.
[mouseButtonEventPos] :: MouseButtonEventData -> !(Point V2 Int32)
-- | Mouse wheel event information.
data MouseWheelEventData
MouseWheelEventData :: !(Maybe Window) -> !MouseDevice -> !(V2 Int32) -> !MouseScrollDirection -> MouseWheelEventData
-- | The Window with mouse focus, if any.
[mouseWheelEventWindow] :: MouseWheelEventData -> !(Maybe Window)
-- | The MouseDevice whose wheel was scrolled.
[mouseWheelEventWhich] :: MouseWheelEventData -> !MouseDevice
-- | The amount scrolled.
[mouseWheelEventPos] :: MouseWheelEventData -> !(V2 Int32)
-- | The scroll direction mode.
[mouseWheelEventDirection] :: MouseWheelEventData -> !MouseScrollDirection
-- | Joystick axis motion event information
data JoyAxisEventData
JoyAxisEventData :: !JoystickID -> !Word8 -> !Int16 -> JoyAxisEventData
-- | The instance id of the joystick that reported the event.
[joyAxisEventWhich] :: JoyAxisEventData -> !JoystickID
-- | The index of the axis that changed.
[joyAxisEventAxis] :: JoyAxisEventData -> !Word8
-- | The current position of the axis, ranging between -32768 and 32767.
[joyAxisEventValue] :: JoyAxisEventData -> !Int16
-- | Joystick trackball motion event information.
data JoyBallEventData
JoyBallEventData :: !JoystickID -> !Word8 -> !(V2 Int16) -> JoyBallEventData
-- | The instance id of the joystick that reported the event.
[joyBallEventWhich] :: JoyBallEventData -> !JoystickID
-- | The index of the trackball that changed.
[joyBallEventBall] :: JoyBallEventData -> !Word8
-- | The relative motion of the trackball.
[joyBallEventRelMotion] :: JoyBallEventData -> !(V2 Int16)
-- | Joystick hat position change event information
data JoyHatEventData
JoyHatEventData :: !JoystickID -> !Word8 -> !JoyHatPosition -> JoyHatEventData
-- | The instance id of the joystick that reported the event.
[joyHatEventWhich] :: JoyHatEventData -> !JoystickID
-- | The index of the hat that changed.
[joyHatEventHat] :: JoyHatEventData -> !Word8
-- | The new position of the hat.
[joyHatEventValue] :: JoyHatEventData -> !JoyHatPosition
-- | Joystick button event information.
data JoyButtonEventData
JoyButtonEventData :: !JoystickID -> !Word8 -> !JoyButtonState -> JoyButtonEventData
-- | The instance id of the joystick that reported the event.
[joyButtonEventWhich] :: JoyButtonEventData -> !JoystickID
-- | The index of the button that changed.
[joyButtonEventButton] :: JoyButtonEventData -> !Word8
-- | The state of the button.
[joyButtonEventState] :: JoyButtonEventData -> !JoyButtonState
-- | Joystick device event information.
data JoyDeviceEventData
JoyDeviceEventData :: !JoyDeviceConnection -> !Int32 -> JoyDeviceEventData
-- | Was the device added or removed?
[joyDeviceEventConnection] :: JoyDeviceEventData -> !JoyDeviceConnection
-- | The instance id of the joystick that reported the event.
[joyDeviceEventWhich] :: JoyDeviceEventData -> !Int32
-- | Game controller axis motion event information.
data ControllerAxisEventData
ControllerAxisEventData :: !JoystickID -> !Word8 -> !Int16 -> ControllerAxisEventData
-- | The joystick instance ID that reported the event.
[controllerAxisEventWhich] :: ControllerAxisEventData -> !JoystickID
-- | The index of the axis.
[controllerAxisEventAxis] :: ControllerAxisEventData -> !Word8
-- | The axis value ranging between -32768 and 32767.
[controllerAxisEventValue] :: ControllerAxisEventData -> !Int16
-- | Game controller button event information
data ControllerButtonEventData
ControllerButtonEventData :: !JoystickID -> !ControllerButton -> !ControllerButtonState -> ControllerButtonEventData
-- | The joystick instance ID that reported the event.
[controllerButtonEventWhich] :: ControllerButtonEventData -> !JoystickID
-- | The controller button.
[controllerButtonEventButton] :: ControllerButtonEventData -> !ControllerButton
-- | The state of the button.
[controllerButtonEventState] :: ControllerButtonEventData -> !ControllerButtonState
-- | Controller device event information
data ControllerDeviceEventData
ControllerDeviceEventData :: !ControllerDeviceConnection -> !Int32 -> ControllerDeviceEventData
-- | Was the device added, removed, or remapped?
[controllerDeviceEventConnection] :: ControllerDeviceEventData -> !ControllerDeviceConnection
-- | The joystick instance ID that reported the event.
[controllerDeviceEventWhich] :: ControllerDeviceEventData -> !Int32
data AudioDeviceEventData
AudioDeviceEventData :: !Bool -> !Word32 -> !Bool -> AudioDeviceEventData
-- | If the audio device is an addition, or a removal.
[audioDeviceEventIsAddition] :: AudioDeviceEventData -> !Bool
-- | The audio device ID that reported the event.
[audioDeviceEventWhich] :: AudioDeviceEventData -> !Word32
-- | If the audio device is a capture device.
[audioDeviceEventIsCapture] :: AudioDeviceEventData -> !Bool
-- | Event data for application-defined events.
data UserEventData
UserEventData :: !Word32 -> !(Maybe Window) -> !Int32 -> !(Ptr ()) -> !(Ptr ()) -> UserEventData
-- | User defined event type.
[userEventType] :: UserEventData -> !Word32
-- | The associated Window.
[userEventWindow] :: UserEventData -> !(Maybe Window)
-- | User defined event code.
[userEventCode] :: UserEventData -> !Int32
-- | User defined data pointer.
[userEventData1] :: UserEventData -> !(Ptr ())
-- | User defined data pointer.
[userEventData2] :: UserEventData -> !(Ptr ())
-- | Finger touch event information.
data TouchFingerEventData
TouchFingerEventData :: !TouchID -> !FingerID -> !InputMotion -> !(Point V2 CFloat) -> !CFloat -> TouchFingerEventData
-- | The touch device index.
[touchFingerEventTouchID] :: TouchFingerEventData -> !TouchID
-- | The finger index.
[touchFingerEventFingerID] :: TouchFingerEventData -> !FingerID
-- | Whether the finger was pressed or released.
[touchFingerEventMotion] :: TouchFingerEventData -> !InputMotion
-- | The location of the touch event, normalized between 0 and 1.
[touchFingerEventPos] :: TouchFingerEventData -> !(Point V2 CFloat)
-- | The quantity of the pressure applied, normalized between 0 and 1.
[touchFingerEventPressure] :: TouchFingerEventData -> !CFloat
-- | Finger motion event information.
data TouchFingerMotionEventData
TouchFingerMotionEventData :: !TouchID -> !FingerID -> !(Point V2 CFloat) -> !(V2 CFloat) -> !CFloat -> TouchFingerMotionEventData
-- | The touch device index.
[touchFingerMotionEventTouchID] :: TouchFingerMotionEventData -> !TouchID
-- | The finger index.
[touchFingerMotionEventFingerID] :: TouchFingerMotionEventData -> !FingerID
-- | The location of the touch event, normalized between 0 and 1.
[touchFingerMotionEventPos] :: TouchFingerMotionEventData -> !(Point V2 CFloat)
-- | The distance moved, normalized between -1 and 1.
[touchFingerMotionEventRelMotion] :: TouchFingerMotionEventData -> !(V2 CFloat)
-- | The quantity of the pressure applied, normalized between 0 and 1.
[touchFingerMotionEventPressure] :: TouchFingerMotionEventData -> !CFloat
-- | Multiple finger gesture event information
data MultiGestureEventData
MultiGestureEventData :: !TouchID -> !CFloat -> !CFloat -> !(Point V2 CFloat) -> !Word16 -> MultiGestureEventData
-- | The touch device index.
[multiGestureEventTouchID] :: MultiGestureEventData -> !TouchID
-- | The amount that the fingers rotated during this motion.
[multiGestureEventDTheta] :: MultiGestureEventData -> !CFloat
-- | The amount that the fingers pinched during this motion.
[multiGestureEventDDist] :: MultiGestureEventData -> !CFloat
-- | The normalized center of the gesture.
[multiGestureEventPos] :: MultiGestureEventData -> !(Point V2 CFloat)
-- | The number of fingers used in this gesture.
[multiGestureEventNumFingers] :: MultiGestureEventData -> !Word16
-- | Complex gesture event information.
data DollarGestureEventData
DollarGestureEventData :: !TouchID -> !GestureID -> !Word32 -> !CFloat -> !(Point V2 CFloat) -> DollarGestureEventData
-- | The touch device index.
[dollarGestureEventTouchID] :: DollarGestureEventData -> !TouchID
-- | The unique id of the closest gesture to the performed stroke.
[dollarGestureEventGestureID] :: DollarGestureEventData -> !GestureID
-- | The number of fingers used to draw the stroke.
[dollarGestureEventNumFingers] :: DollarGestureEventData -> !Word32
-- | The difference between the gesture template and the actual performed
-- gesture (lower errors correspond to closer matches).
[dollarGestureEventError] :: DollarGestureEventData -> !CFloat
-- | The normalized center of the gesture.
[dollarGestureEventPos] :: DollarGestureEventData -> !(Point V2 CFloat)
-- | An event used to request a file open by the system
newtype DropEventData
DropEventData :: CString -> DropEventData
-- | The file name.
[dropEventFile] :: DropEventData -> CString
-- | SDL reported an unknown event type.
newtype UnknownEventData
UnknownEventData :: Word32 -> UnknownEventData
-- | The unknown event code.
[unknownEventType] :: UnknownEventData -> Word32
data InputMotion
Released :: InputMotion
Pressed :: InputMotion
data MouseButton
ButtonLeft :: MouseButton
ButtonMiddle :: MouseButton
ButtonRight :: MouseButton
ButtonX1 :: MouseButton
ButtonX2 :: MouseButton
-- | An unknown mouse button.
ButtonExtra :: !Int -> MouseButton
instance GHC.Show.Show SDL.Event.EventPushResult
instance GHC.Read.Read SDL.Event.EventPushResult
instance GHC.Classes.Ord SDL.Event.EventPushResult
instance GHC.Generics.Generic SDL.Event.EventPushResult
instance GHC.Classes.Eq SDL.Event.EventPushResult
instance Data.Data.Data SDL.Event.EventPushResult
instance GHC.Show.Show SDL.Event.RegisteredEventData
instance GHC.Generics.Generic SDL.Event.RegisteredEventData
instance GHC.Classes.Ord SDL.Event.RegisteredEventData
instance GHC.Classes.Eq SDL.Event.RegisteredEventData
instance GHC.Show.Show SDL.Event.Event
instance GHC.Generics.Generic SDL.Event.Event
instance GHC.Classes.Ord SDL.Event.Event
instance GHC.Classes.Eq SDL.Event.Event
instance GHC.Show.Show SDL.Event.EventPayload
instance GHC.Generics.Generic SDL.Event.EventPayload
instance GHC.Classes.Ord SDL.Event.EventPayload
instance GHC.Classes.Eq SDL.Event.EventPayload
instance GHC.Show.Show SDL.Event.KeyboardEventData
instance GHC.Generics.Generic SDL.Event.KeyboardEventData
instance GHC.Classes.Ord SDL.Event.KeyboardEventData
instance GHC.Classes.Eq SDL.Event.KeyboardEventData
instance GHC.Show.Show SDL.Event.MouseButtonEventData
instance GHC.Generics.Generic SDL.Event.MouseButtonEventData
instance GHC.Classes.Ord SDL.Event.MouseButtonEventData
instance GHC.Classes.Eq SDL.Event.MouseButtonEventData
instance GHC.Show.Show SDL.Event.TouchFingerEventData
instance GHC.Generics.Generic SDL.Event.TouchFingerEventData
instance GHC.Classes.Ord SDL.Event.TouchFingerEventData
instance GHC.Classes.Eq SDL.Event.TouchFingerEventData
instance GHC.Show.Show SDL.Event.InputMotion
instance GHC.Generics.Generic SDL.Event.InputMotion
instance Data.Data.Data SDL.Event.InputMotion
instance GHC.Read.Read SDL.Event.InputMotion
instance GHC.Classes.Ord SDL.Event.InputMotion
instance GHC.Classes.Eq SDL.Event.InputMotion
instance GHC.Enum.Enum SDL.Event.InputMotion
instance GHC.Enum.Bounded SDL.Event.InputMotion
instance GHC.Show.Show SDL.Event.UnknownEventData
instance GHC.Generics.Generic SDL.Event.UnknownEventData
instance GHC.Classes.Ord SDL.Event.UnknownEventData
instance GHC.Classes.Eq SDL.Event.UnknownEventData
instance GHC.Show.Show SDL.Event.DropEventData
instance GHC.Generics.Generic SDL.Event.DropEventData
instance GHC.Classes.Ord SDL.Event.DropEventData
instance GHC.Classes.Eq SDL.Event.DropEventData
instance GHC.Show.Show SDL.Event.DollarGestureEventData
instance GHC.Generics.Generic SDL.Event.DollarGestureEventData
instance GHC.Classes.Ord SDL.Event.DollarGestureEventData
instance GHC.Classes.Eq SDL.Event.DollarGestureEventData
instance GHC.Show.Show SDL.Event.MultiGestureEventData
instance GHC.Generics.Generic SDL.Event.MultiGestureEventData
instance GHC.Classes.Ord SDL.Event.MultiGestureEventData
instance GHC.Classes.Eq SDL.Event.MultiGestureEventData
instance GHC.Show.Show SDL.Event.TouchFingerMotionEventData
instance GHC.Generics.Generic SDL.Event.TouchFingerMotionEventData
instance GHC.Classes.Ord SDL.Event.TouchFingerMotionEventData
instance GHC.Classes.Eq SDL.Event.TouchFingerMotionEventData
instance GHC.Show.Show SDL.Event.SysWMEventData
instance GHC.Generics.Generic SDL.Event.SysWMEventData
instance GHC.Classes.Ord SDL.Event.SysWMEventData
instance GHC.Classes.Eq SDL.Event.SysWMEventData
instance GHC.Show.Show SDL.Event.UserEventData
instance GHC.Generics.Generic SDL.Event.UserEventData
instance GHC.Classes.Ord SDL.Event.UserEventData
instance GHC.Classes.Eq SDL.Event.UserEventData
instance GHC.Show.Show SDL.Event.AudioDeviceEventData
instance GHC.Generics.Generic SDL.Event.AudioDeviceEventData
instance GHC.Classes.Ord SDL.Event.AudioDeviceEventData
instance GHC.Classes.Eq SDL.Event.AudioDeviceEventData
instance GHC.Show.Show SDL.Event.ControllerDeviceEventData
instance GHC.Generics.Generic SDL.Event.ControllerDeviceEventData
instance GHC.Classes.Ord SDL.Event.ControllerDeviceEventData
instance GHC.Classes.Eq SDL.Event.ControllerDeviceEventData
instance GHC.Show.Show SDL.Event.ControllerButtonEventData
instance GHC.Generics.Generic SDL.Event.ControllerButtonEventData
instance GHC.Classes.Ord SDL.Event.ControllerButtonEventData
instance GHC.Classes.Eq SDL.Event.ControllerButtonEventData
instance GHC.Show.Show SDL.Event.ControllerAxisEventData
instance GHC.Generics.Generic SDL.Event.ControllerAxisEventData
instance GHC.Classes.Ord SDL.Event.ControllerAxisEventData
instance GHC.Classes.Eq SDL.Event.ControllerAxisEventData
instance GHC.Show.Show SDL.Event.JoyDeviceEventData
instance GHC.Generics.Generic SDL.Event.JoyDeviceEventData
instance GHC.Classes.Ord SDL.Event.JoyDeviceEventData
instance GHC.Classes.Eq SDL.Event.JoyDeviceEventData
instance GHC.Show.Show SDL.Event.JoyButtonEventData
instance GHC.Generics.Generic SDL.Event.JoyButtonEventData
instance GHC.Classes.Ord SDL.Event.JoyButtonEventData
instance GHC.Classes.Eq SDL.Event.JoyButtonEventData
instance GHC.Show.Show SDL.Event.JoyHatEventData
instance GHC.Generics.Generic SDL.Event.JoyHatEventData
instance GHC.Classes.Ord SDL.Event.JoyHatEventData
instance GHC.Classes.Eq SDL.Event.JoyHatEventData
instance GHC.Show.Show SDL.Event.JoyBallEventData
instance GHC.Generics.Generic SDL.Event.JoyBallEventData
instance GHC.Classes.Ord SDL.Event.JoyBallEventData
instance GHC.Classes.Eq SDL.Event.JoyBallEventData
instance GHC.Show.Show SDL.Event.JoyAxisEventData
instance GHC.Generics.Generic SDL.Event.JoyAxisEventData
instance GHC.Classes.Ord SDL.Event.JoyAxisEventData
instance GHC.Classes.Eq SDL.Event.JoyAxisEventData
instance GHC.Show.Show SDL.Event.MouseWheelEventData
instance GHC.Generics.Generic SDL.Event.MouseWheelEventData
instance GHC.Classes.Ord SDL.Event.MouseWheelEventData
instance GHC.Classes.Eq SDL.Event.MouseWheelEventData
instance GHC.Show.Show SDL.Event.MouseMotionEventData
instance GHC.Generics.Generic SDL.Event.MouseMotionEventData
instance GHC.Classes.Ord SDL.Event.MouseMotionEventData
instance GHC.Classes.Eq SDL.Event.MouseMotionEventData
instance GHC.Show.Show SDL.Event.TextInputEventData
instance GHC.Generics.Generic SDL.Event.TextInputEventData
instance GHC.Classes.Ord SDL.Event.TextInputEventData
instance GHC.Classes.Eq SDL.Event.TextInputEventData
instance GHC.Show.Show SDL.Event.TextEditingEventData
instance GHC.Generics.Generic SDL.Event.TextEditingEventData
instance GHC.Classes.Ord SDL.Event.TextEditingEventData
instance GHC.Classes.Eq SDL.Event.TextEditingEventData
instance GHC.Show.Show SDL.Event.WindowClosedEventData
instance GHC.Generics.Generic SDL.Event.WindowClosedEventData
instance GHC.Classes.Ord SDL.Event.WindowClosedEventData
instance GHC.Classes.Eq SDL.Event.WindowClosedEventData
instance GHC.Show.Show SDL.Event.WindowLostKeyboardFocusEventData
instance GHC.Generics.Generic SDL.Event.WindowLostKeyboardFocusEventData
instance GHC.Classes.Ord SDL.Event.WindowLostKeyboardFocusEventData
instance GHC.Classes.Eq SDL.Event.WindowLostKeyboardFocusEventData
instance GHC.Show.Show SDL.Event.WindowGainedKeyboardFocusEventData
instance GHC.Generics.Generic SDL.Event.WindowGainedKeyboardFocusEventData
instance GHC.Classes.Ord SDL.Event.WindowGainedKeyboardFocusEventData
instance GHC.Classes.Eq SDL.Event.WindowGainedKeyboardFocusEventData
instance GHC.Show.Show SDL.Event.WindowLostMouseFocusEventData
instance GHC.Generics.Generic SDL.Event.WindowLostMouseFocusEventData
instance GHC.Classes.Ord SDL.Event.WindowLostMouseFocusEventData
instance GHC.Classes.Eq SDL.Event.WindowLostMouseFocusEventData
instance GHC.Show.Show SDL.Event.WindowGainedMouseFocusEventData
instance GHC.Generics.Generic SDL.Event.WindowGainedMouseFocusEventData
instance GHC.Classes.Ord SDL.Event.WindowGainedMouseFocusEventData
instance GHC.Classes.Eq SDL.Event.WindowGainedMouseFocusEventData
instance GHC.Show.Show SDL.Event.WindowRestoredEventData
instance GHC.Generics.Generic SDL.Event.WindowRestoredEventData
instance GHC.Classes.Ord SDL.Event.WindowRestoredEventData
instance GHC.Classes.Eq SDL.Event.WindowRestoredEventData
instance GHC.Show.Show SDL.Event.WindowMaximizedEventData
instance GHC.Generics.Generic SDL.Event.WindowMaximizedEventData
instance GHC.Classes.Ord SDL.Event.WindowMaximizedEventData
instance GHC.Classes.Eq SDL.Event.WindowMaximizedEventData
instance GHC.Show.Show SDL.Event.WindowMinimizedEventData
instance GHC.Generics.Generic SDL.Event.WindowMinimizedEventData
instance GHC.Classes.Ord SDL.Event.WindowMinimizedEventData
instance GHC.Classes.Eq SDL.Event.WindowMinimizedEventData
instance GHC.Show.Show SDL.Event.WindowSizeChangedEventData
instance GHC.Generics.Generic SDL.Event.WindowSizeChangedEventData
instance GHC.Classes.Ord SDL.Event.WindowSizeChangedEventData
instance GHC.Classes.Eq SDL.Event.WindowSizeChangedEventData
instance GHC.Show.Show SDL.Event.WindowResizedEventData
instance GHC.Generics.Generic SDL.Event.WindowResizedEventData
instance GHC.Classes.Ord SDL.Event.WindowResizedEventData
instance GHC.Classes.Eq SDL.Event.WindowResizedEventData
instance GHC.Show.Show SDL.Event.WindowMovedEventData
instance GHC.Generics.Generic SDL.Event.WindowMovedEventData
instance GHC.Classes.Ord SDL.Event.WindowMovedEventData
instance GHC.Classes.Eq SDL.Event.WindowMovedEventData
instance GHC.Show.Show SDL.Event.WindowExposedEventData
instance GHC.Generics.Generic SDL.Event.WindowExposedEventData
instance GHC.Classes.Ord SDL.Event.WindowExposedEventData
instance GHC.Classes.Eq SDL.Event.WindowExposedEventData
instance GHC.Show.Show SDL.Event.WindowHiddenEventData
instance GHC.Generics.Generic SDL.Event.WindowHiddenEventData
instance GHC.Classes.Ord SDL.Event.WindowHiddenEventData
instance GHC.Classes.Eq SDL.Event.WindowHiddenEventData
instance GHC.Show.Show SDL.Event.WindowShownEventData
instance GHC.Generics.Generic SDL.Event.WindowShownEventData
instance GHC.Classes.Ord SDL.Event.WindowShownEventData
instance GHC.Classes.Eq SDL.Event.WindowShownEventData
-- | SDL (Simple DirectMedia Layer) is a library for cross-platform
-- development of interactive applications. SDL provides routines for
-- managing windows, rendering graphics, processing sound, collecting
-- input data, and much more. The Haskell sdl2 library provides
-- both a high- and low-level API to interface with SDL. This module
-- exports the high-level API, whereas SDL.Raw provides the
-- lower-level bindings.
module SDL
get :: (HasGetter t a, MonadIO m) => t -> m a
-- | Write a new value into a state variable.
($=) :: (HasSetter t a, MonadIO m) => t -> a -> m ()
infixr 2 $=
-- | Transform the contents of a state variable with a given funtion.
($~) :: (HasUpdate t a b, MonadIO m) => t -> a -> b -> m ()
infixr 2 $~
-- | This is a variant of $= which is strict in the value to be set.
($=!) :: (HasSetter t a, MonadIO m) => t -> a -> m ()
infixr 2 $=!
-- | This is a variant of $~ which is strict in the transformed
-- value.
($~!) :: (HasUpdate t a b, MonadIO m) => t -> a -> b -> m ()
infixr 2 $~!