| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Graphics.UI.GLFW
Contents
Description
Threading restrictions which apply to the C version of GLFW still apply when
writing GLFW-b programs. See
GLFW thread safety documentation
(applies here).
Current context restructions which apply to the C version of GLFW still apply. See GLFW current context documentation (applies here).
GLFW-b wraps callbacks and schedules them to be run after pollEvents and
waitEvents in the normal GHC runtime where they aren't subject to the usual
GLFW reentrancy restrictions. See
GLFW reentrancy documentation
(does not apply here).
Synopsis
- data Error
- setErrorCallback :: Maybe ErrorCallback -> IO ()
- type ErrorCallback = Error -> String -> IO ()
- data Version = Version {
- versionMajor :: Int
- versionMinor :: Int
- versionRevision :: Int
- init :: IO Bool
- terminate :: IO ()
- getVersion :: IO Version
- getVersionString :: IO (Maybe String)
- data Monitor
- data MonitorState
- data VideoMode = VideoMode {}
- data GammaRamp
- makeGammaRamp :: [Int] -> [Int] -> [Int] -> Maybe GammaRamp
- getMonitors :: IO (Maybe [Monitor])
- getPrimaryMonitor :: IO (Maybe Monitor)
- getMonitorPos :: Monitor -> IO (Int, Int)
- getMonitorPhysicalSize :: Monitor -> IO (Int, Int)
- getMonitorName :: Monitor -> IO (Maybe String)
- setMonitorCallback :: Maybe MonitorCallback -> IO ()
- type MonitorCallback = Monitor -> MonitorState -> IO ()
- getVideoModes :: Monitor -> IO (Maybe [VideoMode])
- getVideoMode :: Monitor -> IO (Maybe VideoMode)
- setGamma :: Monitor -> Double -> IO ()
- getGammaRamp :: Monitor -> IO (Maybe GammaRamp)
- setGammaRamp :: Monitor -> GammaRamp -> IO ()
- data Window
- data WindowHint
- = WindowHint'Resizable Bool
- | WindowHint'Visible Bool
- | WindowHint'Decorated Bool
- | WindowHint'RedBits (Maybe Int)
- | WindowHint'GreenBits (Maybe Int)
- | WindowHint'BlueBits (Maybe Int)
- | WindowHint'AlphaBits (Maybe Int)
- | WindowHint'DepthBits (Maybe Int)
- | WindowHint'StencilBits (Maybe Int)
- | WindowHint'AccumRedBits (Maybe Int)
- | WindowHint'AccumGreenBits (Maybe Int)
- | WindowHint'AccumBlueBits (Maybe Int)
- | WindowHint'AccumAlphaBits (Maybe Int)
- | WindowHint'AuxBuffers (Maybe Int)
- | WindowHint'Samples (Maybe Int)
- | WindowHint'RefreshRate (Maybe Int)
- | WindowHint'DoubleBuffer Bool
- | WindowHint'Stereo Bool
- | WindowHint'sRGBCapable Bool
- | WindowHint'Floating Bool
- | WindowHint'Focused Bool
- | WindowHint'Maximized Bool
- | WindowHint'AutoIconify Bool
- | WindowHint'ClientAPI ClientAPI
- | WindowHint'ContextCreationAPI ContextCreationAPI
- | WindowHint'ContextVersionMajor Int
- | WindowHint'ContextVersionMinor Int
- | WindowHint'ContextRobustness ContextRobustness
- | WindowHint'ContextReleaseBehavior ContextReleaseBehavior
- | WindowHint'ContextNoError Bool
- | WindowHint'OpenGLForwardCompat Bool
- | WindowHint'OpenGLDebugContext Bool
- | WindowHint'OpenGLProfile OpenGLProfile
- data ContextRobustness
- data OpenGLProfile
- data ClientAPI
- data ContextCreationAPI
- data ContextReleaseBehavior
- defaultWindowHints :: IO ()
- windowHint :: WindowHint -> IO ()
- createWindow :: Int -> Int -> String -> Maybe Monitor -> Maybe Window -> IO (Maybe Window)
- destroyWindow :: Window -> IO ()
- windowShouldClose :: Window -> IO Bool
- setWindowShouldClose :: Window -> Bool -> IO ()
- setWindowTitle :: Window -> String -> IO ()
- getWindowPos :: Window -> IO (Int, Int)
- setWindowPos :: Window -> Int -> Int -> IO ()
- getWindowSize :: Window -> IO (Int, Int)
- setWindowSize :: Window -> Int -> Int -> IO ()
- setWindowSizeLimits :: Window -> Maybe Int -> Maybe Int -> Maybe Int -> Maybe Int -> IO ()
- setWindowAspectRatio :: Window -> Maybe (Int, Int) -> IO ()
- getWindowFrameSize :: Window -> IO (Int, Int, Int, Int)
- getFramebufferSize :: Window -> IO (Int, Int)
- setWindowIcon :: Window -> [Image] -> IO ()
- iconifyWindow :: Window -> IO ()
- restoreWindow :: Window -> IO ()
- focusWindow :: Window -> IO ()
- maximizeWindow :: Window -> IO ()
- showWindow :: Window -> IO ()
- hideWindow :: Window -> IO ()
- getWindowMonitor :: Window -> IO (Maybe Monitor)
- setCursorPos :: Window -> Double -> Double -> IO ()
- setFullscreen :: Window -> Monitor -> VideoMode -> IO ()
- setWindowed :: Window -> Int -> Int -> Int -> Int -> IO ()
- getWindowFocused :: Window -> IO Bool
- getWindowMaximized :: Window -> IO Bool
- getWindowFloating :: Window -> IO Bool
- getWindowIconified :: Window -> IO Bool
- getWindowResizable :: Window -> IO Bool
- getWindowDecorated :: Window -> IO Bool
- getWindowVisible :: Window -> IO Bool
- getWindowClientAPI :: Window -> IO ClientAPI
- getWindowContextCreationAPI :: Window -> IO ContextCreationAPI
- getWindowContextVersionMajor :: Window -> IO Int
- getWindowContextVersionMinor :: Window -> IO Int
- getWindowContextVersionRevision :: Window -> IO Int
- getWindowContextRobustness :: Window -> IO ContextRobustness
- getWindowContextReleaseBehavior :: Window -> IO ContextReleaseBehavior
- getWindowContextNoError :: Window -> IO Bool
- getWindowOpenGLForwardCompat :: Window -> IO Bool
- getWindowOpenGLDebugContext :: Window -> IO Bool
- getWindowOpenGLProfile :: Window -> IO OpenGLProfile
- setWindowPosCallback :: Window -> Maybe WindowPosCallback -> IO ()
- type WindowPosCallback = Window -> Int -> Int -> IO ()
- setWindowSizeCallback :: Window -> Maybe WindowSizeCallback -> IO ()
- type WindowSizeCallback = Window -> Int -> Int -> IO ()
- setWindowCloseCallback :: Window -> Maybe WindowCloseCallback -> IO ()
- type WindowCloseCallback = Window -> IO ()
- setWindowRefreshCallback :: Window -> Maybe WindowRefreshCallback -> IO ()
- type WindowRefreshCallback = Window -> IO ()
- setWindowFocusCallback :: Window -> Maybe WindowFocusCallback -> IO ()
- type WindowFocusCallback = Window -> Bool -> IO ()
- setWindowIconifyCallback :: Window -> Maybe WindowIconifyCallback -> IO ()
- type WindowIconifyCallback = Window -> Bool -> IO ()
- setFramebufferSizeCallback :: Window -> Maybe FramebufferSizeCallback -> IO ()
- type FramebufferSizeCallback = Window -> Int -> Int -> IO ()
- pollEvents :: IO ()
- waitEvents :: IO ()
- waitEventsTimeout :: Double -> IO ()
- postEmptyEvent :: IO ()
- data Key
- = Key'Unknown
- | Key'Space
- | Key'Apostrophe
- | Key'Comma
- | Key'Minus
- | Key'Period
- | Key'Slash
- | Key'0
- | Key'1
- | Key'2
- | Key'3
- | Key'4
- | Key'5
- | Key'6
- | Key'7
- | Key'8
- | Key'9
- | Key'Semicolon
- | Key'Equal
- | Key'A
- | Key'B
- | Key'C
- | Key'D
- | Key'E
- | Key'F
- | Key'G
- | Key'H
- | Key'I
- | Key'J
- | Key'K
- | Key'L
- | Key'M
- | Key'N
- | Key'O
- | Key'P
- | Key'Q
- | Key'R
- | Key'S
- | Key'T
- | Key'U
- | Key'V
- | Key'W
- | Key'X
- | Key'Y
- | Key'Z
- | Key'LeftBracket
- | Key'Backslash
- | Key'RightBracket
- | Key'GraveAccent
- | Key'World1
- | Key'World2
- | Key'Escape
- | Key'Enter
- | Key'Tab
- | Key'Backspace
- | Key'Insert
- | Key'Delete
- | Key'Right
- | Key'Left
- | Key'Down
- | Key'Up
- | Key'PageUp
- | Key'PageDown
- | Key'Home
- | Key'End
- | Key'CapsLock
- | Key'ScrollLock
- | Key'NumLock
- | Key'PrintScreen
- | Key'Pause
- | Key'F1
- | Key'F2
- | Key'F3
- | Key'F4
- | Key'F5
- | Key'F6
- | Key'F7
- | Key'F8
- | Key'F9
- | Key'F10
- | Key'F11
- | Key'F12
- | Key'F13
- | Key'F14
- | Key'F15
- | Key'F16
- | Key'F17
- | Key'F18
- | Key'F19
- | Key'F20
- | Key'F21
- | Key'F22
- | Key'F23
- | Key'F24
- | Key'F25
- | Key'Pad0
- | Key'Pad1
- | Key'Pad2
- | Key'Pad3
- | Key'Pad4
- | Key'Pad5
- | Key'Pad6
- | Key'Pad7
- | Key'Pad8
- | Key'Pad9
- | Key'PadDecimal
- | Key'PadDivide
- | Key'PadMultiply
- | Key'PadSubtract
- | Key'PadAdd
- | Key'PadEnter
- | Key'PadEqual
- | Key'LeftShift
- | Key'LeftControl
- | Key'LeftAlt
- | Key'LeftSuper
- | Key'RightShift
- | Key'RightControl
- | Key'RightAlt
- | Key'RightSuper
- | Key'Menu
- data KeyState
- data Joystick
- data JoystickState
- data JoystickButtonState
- data MouseButton
- data MouseButtonState
- data CursorState
- data CursorInputMode
- data StickyKeysInputMode
- data StickyMouseButtonsInputMode
- data ModifierKeys = ModifierKeys {}
- data Image
- mkImage :: Int -> Int -> (Int -> Int -> (Word8, Word8, Word8, Word8)) -> Image
- newtype Cursor = Cursor {}
- data StandardCursorShape
- getCursorInputMode :: Window -> IO CursorInputMode
- setCursorInputMode :: Window -> CursorInputMode -> IO ()
- getStickyKeysInputMode :: Window -> IO StickyKeysInputMode
- setStickyKeysInputMode :: Window -> StickyKeysInputMode -> IO ()
- getStickyMouseButtonsInputMode :: Window -> IO StickyMouseButtonsInputMode
- setStickyMouseButtonsInputMode :: Window -> StickyMouseButtonsInputMode -> IO ()
- getKey :: Window -> Key -> IO KeyState
- getKeyName :: Key -> Int -> IO (Maybe String)
- getMouseButton :: Window -> MouseButton -> IO MouseButtonState
- getCursorPos :: Window -> IO (Double, Double)
- setKeyCallback :: Window -> Maybe KeyCallback -> IO ()
- type KeyCallback = Window -> Key -> Int -> KeyState -> ModifierKeys -> IO ()
- setCharCallback :: Window -> Maybe CharCallback -> IO ()
- type CharCallback = Window -> Char -> IO ()
- setCharModsCallback :: Window -> Maybe CharModsCallback -> IO ()
- type CharModsCallback = Window -> Char -> ModifierKeys -> IO ()
- setMouseButtonCallback :: Window -> Maybe MouseButtonCallback -> IO ()
- type MouseButtonCallback = Window -> MouseButton -> MouseButtonState -> ModifierKeys -> IO ()
- setCursorPosCallback :: Window -> Maybe CursorPosCallback -> IO ()
- type CursorPosCallback = Window -> Double -> Double -> IO ()
- setCursorEnterCallback :: Window -> Maybe CursorEnterCallback -> IO ()
- type CursorEnterCallback = Window -> CursorState -> IO ()
- createCursor :: Image -> Int -> Int -> IO Cursor
- createStandardCursor :: StandardCursorShape -> IO Cursor
- setCursor :: Window -> Cursor -> IO ()
- destroyCursor :: Cursor -> IO ()
- setScrollCallback :: Window -> Maybe ScrollCallback -> IO ()
- type ScrollCallback = Window -> Double -> Double -> IO ()
- setDropCallback :: Window -> Maybe DropCallback -> IO ()
- type DropCallback = Window -> [String] -> IO ()
- joystickPresent :: Joystick -> IO Bool
- getJoystickAxes :: Joystick -> IO (Maybe [Double])
- getJoystickButtons :: Joystick -> IO (Maybe [JoystickButtonState])
- getJoystickName :: Joystick -> IO (Maybe String)
- setJoystickCallback :: Maybe JoystickCallback -> IO ()
- type JoystickCallback = Joystick -> JoystickState -> IO ()
- getTime :: IO (Maybe Double)
- setTime :: Double -> IO ()
- getTimerValue :: IO Word64
- getTimerFrequency :: IO Word64
- makeContextCurrent :: Maybe Window -> IO ()
- getCurrentContext :: IO (Maybe Window)
- swapBuffers :: Window -> IO ()
- swapInterval :: Int -> IO ()
- extensionSupported :: String -> IO Bool
- getClipboardString :: Window -> IO (Maybe String)
- setClipboardString :: Window -> String -> IO ()
- vulkanSupported :: IO Bool
- getRequiredInstanceExtensions :: IO [CString]
- getInstanceProcAddress :: Ptr vkInstance -> String -> IO (FunPtr vkProc)
- getPhysicalDevicePresentationSupport :: Ptr vkInstance -> Ptr vkPhysicalDevice -> Word32 -> IO Bool
- createWindowSurface :: Enum vkResult => Ptr vkInstance -> Window -> Ptr vkAllocationCallbacks -> Ptr vkSurfaceKHR -> IO vkResult
- getWin32Adapter :: Window -> IO CString
- getWin32Monitor :: Window -> IO CString
- getWin32Window :: Window -> IO (Ptr ())
- getWGLContext :: Window -> IO (Ptr ())
- getCocoaMonitor :: Window -> IO (Ptr Word32)
- getCocoaWindow :: Window -> IO (Ptr ())
- getNSGLContext :: Window -> IO (Ptr ())
- getX11Display :: Window -> IO (Ptr display)
- getX11Adapter :: Window -> IO Word64
- getX11Monitor :: Window -> IO Word64
- getX11Window :: Window -> IO Word64
- getGLXContext :: Window -> IO (Ptr ())
- getGLXWindow :: Window -> IO Word64
- getWaylandDisplay :: IO (Ptr wl_display)
- getWaylandMonitor :: Window -> IO (Ptr wl_output)
- getWaylandWindow :: Window -> IO (Ptr wl_surface)
- getMirDisplay :: IO (Ptr mir_connection)
- getMirMonitor :: Window -> IO Int
- getMirWindow :: Window -> IO (Ptr mir_surface)
- getEGLDisplay :: IO (Ptr ())
- getEGLContext :: Window -> IO (Ptr ())
- getEGLSurface :: Window -> IO (Ptr ())
Error handling
An enum for one of the GLFW error codes.
Constructors
| Error'NotInitialized | |
| Error'NoCurrentContext | |
| Error'InvalidEnum | |
| Error'InvalidValue | |
| Error'OutOfMemory | |
| Error'ApiUnavailable | |
| Error'VersionUnavailable | |
| Error'PlatformError | |
| Error'FormatUnavailable |
Instances
| Bounded Error # | |
| Enum Error # | |
Defined in Graphics.UI.GLFW.Types | |
| Eq Error # | |
| Data Error # | |
Defined in Graphics.UI.GLFW.Types Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Error -> c Error # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Error # dataTypeOf :: Error -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Error) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Error) # gmapT :: (forall b. Data b => b -> b) -> Error -> Error # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Error -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Error -> r # gmapQ :: (forall d. Data d => d -> u) -> Error -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Error -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Error -> m Error # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Error -> m Error # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Error -> m Error # | |
| Ord Error # | |
| Read Error # | |
| Show Error # | |
| Generic Error # | |
| NFData Error # | |
Defined in Graphics.UI.GLFW.Types | |
| type Rep Error # | |
Defined in Graphics.UI.GLFW.Types type Rep Error = D1 (MetaData "Error" "Graphics.UI.GLFW.Types" "GLFW-b-3.2.1.0-5or8c1J4zQVGPTWjqr61i7" False) (((C1 (MetaCons "Error'NotInitialized" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "Error'NoCurrentContext" PrefixI False) (U1 :: Type -> Type)) :+: (C1 (MetaCons "Error'InvalidEnum" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "Error'InvalidValue" PrefixI False) (U1 :: Type -> Type))) :+: ((C1 (MetaCons "Error'OutOfMemory" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "Error'ApiUnavailable" PrefixI False) (U1 :: Type -> Type)) :+: (C1 (MetaCons "Error'VersionUnavailable" PrefixI False) (U1 :: Type -> Type) :+: (C1 (MetaCons "Error'PlatformError" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "Error'FormatUnavailable" PrefixI False) (U1 :: Type -> Type))))) | |
setErrorCallback :: Maybe ErrorCallback -> IO () #
Can (and probably should) be used before GLFW initialization. See glfwSetErrorCallback
type ErrorCallback = Error -> String -> IO () #
The error code and also a human-readable error message.
Initialization and version information
The library version of the GLFW implementation in use. See Version Management
Constructors
| Version | |
Fields
| |
Instances
| Eq Version # | |
| Data Version # | |
Defined in Graphics.UI.GLFW.Types Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Version -> c Version # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Version # toConstr :: Version -> Constr # dataTypeOf :: Version -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Version) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Version) # gmapT :: (forall b. Data b => b -> b) -> Version -> Version # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Version -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Version -> r # gmapQ :: (forall d. Data d => d -> u) -> Version -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Version -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Version -> m Version # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Version -> m Version # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Version -> m Version # | |
| Ord Version # | |
Defined in Graphics.UI.GLFW.Types | |
| Read Version # | |
| Show Version # | |
| Generic Version # | |
| NFData Version # | |
Defined in Graphics.UI.GLFW.Types | |
| type Rep Version # | |
Defined in Graphics.UI.GLFW.Types type Rep Version = D1 (MetaData "Version" "Graphics.UI.GLFW.Types" "GLFW-b-3.2.1.0-5or8c1J4zQVGPTWjqr61i7" False) (C1 (MetaCons "Version" PrefixI True) (S1 (MetaSel (Just "versionMajor") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Int) :*: (S1 (MetaSel (Just "versionMinor") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Int) :*: S1 (MetaSel (Just "versionRevision") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Int)))) | |
Attempts to initialize the GLFW library. When the library is not initialized, the only
allowed functions to call are getVersion, getVersionString, setErrorCallback,
init, and terminate. Returns if the initialization was successful or not.
See glfwInit
and Initialization and Termination
Cleans up GLFW and puts the library into an uninitialized state. Once you call this, you must initilize the library again. Warning: No window's context may be current in another thread when this is called. See glfwTerminate and Initialization and Termination
getVersion :: IO Version #
Gets the version of the GLFW library that's being used with the current program. See glfwGetVersion
getVersionString :: IO (Maybe String) #
Gets the compile-time version string of the GLFW library binary.
Gives extra info like platform and compile time options used, but you should not
attempt to parse this to get the GLFW version number. Use getVersion instead.
See glfwGetVersionString
Monitor handling
Represents a physical monitor that's currently connected. See the Monitor Guide
Instances
| Eq Monitor # | |
| Data Monitor # | |
Defined in Graphics.UI.GLFW.Types Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Monitor -> c Monitor # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Monitor # toConstr :: Monitor -> Constr # dataTypeOf :: Monitor -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Monitor) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Monitor) # gmapT :: (forall b. Data b => b -> b) -> Monitor -> Monitor # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Monitor -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Monitor -> r # gmapQ :: (forall d. Data d => d -> u) -> Monitor -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Monitor -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Monitor -> m Monitor # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Monitor -> m Monitor # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Monitor -> m Monitor # | |
| Ord Monitor # | |
Defined in Graphics.UI.GLFW.Types | |
| Show Monitor # | |
| Generic Monitor # | |
| type Rep Monitor # | |
Defined in Graphics.UI.GLFW.Types type Rep Monitor = D1 (MetaData "Monitor" "Graphics.UI.GLFW.Types" "GLFW-b-3.2.1.0-5or8c1J4zQVGPTWjqr61i7" True) (C1 (MetaCons "Monitor" PrefixI True) (S1 (MetaSel (Just "unMonitor") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Ptr C'GLFWmonitor)))) | |
data MonitorState #
Part of the MonitorCallback, for when a monitor gets connected or disconnected.
Constructors
| MonitorState'Connected | |
| MonitorState'Disconnected |
Instances
See Video Modes
Constructors
| VideoMode | |
Fields | |
Instances
| Eq VideoMode # | |
| Data VideoMode # | |
Defined in Graphics.UI.GLFW.Types Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> VideoMode -> c VideoMode # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c VideoMode # toConstr :: VideoMode -> Constr # dataTypeOf :: VideoMode -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c VideoMode) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c VideoMode) # gmapT :: (forall b. Data b => b -> b) -> VideoMode -> VideoMode # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> VideoMode -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> VideoMode -> r # gmapQ :: (forall d. Data d => d -> u) -> VideoMode -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> VideoMode -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> VideoMode -> m VideoMode # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> VideoMode -> m VideoMode # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> VideoMode -> m VideoMode # | |
| Ord VideoMode # | |
| Read VideoMode # | |
| Show VideoMode # | |
| Generic VideoMode # | |
| NFData VideoMode # | |
Defined in Graphics.UI.GLFW.Types | |
| type Rep VideoMode # | |
Defined in Graphics.UI.GLFW.Types type Rep VideoMode = D1 (MetaData "VideoMode" "Graphics.UI.GLFW.Types" "GLFW-b-3.2.1.0-5or8c1J4zQVGPTWjqr61i7" False) (C1 (MetaCons "VideoMode" PrefixI True) ((S1 (MetaSel (Just "videoModeWidth") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Int) :*: (S1 (MetaSel (Just "videoModeHeight") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Int) :*: S1 (MetaSel (Just "videoModeRedBits") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Int))) :*: (S1 (MetaSel (Just "videoModeGreenBits") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Int) :*: (S1 (MetaSel (Just "videoModeBlueBits") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Int) :*: S1 (MetaSel (Just "videoModeRefreshRate") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Int))))) | |
Lets you adjust the gamma of a monitor. To ensure that only valid values are created, use makeGammaRamp.
See Gamma Ramp.
Instances
| Eq GammaRamp # | |
| Data GammaRamp # | |
Defined in Graphics.UI.GLFW.Types Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> GammaRamp -> c GammaRamp # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c GammaRamp # toConstr :: GammaRamp -> Constr # dataTypeOf :: GammaRamp -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c GammaRamp) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c GammaRamp) # gmapT :: (forall b. Data b => b -> b) -> GammaRamp -> GammaRamp # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> GammaRamp -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> GammaRamp -> r # gmapQ :: (forall d. Data d => d -> u) -> GammaRamp -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> GammaRamp -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> GammaRamp -> m GammaRamp # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> GammaRamp -> m GammaRamp # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> GammaRamp -> m GammaRamp # | |
| Ord GammaRamp # | |
| Read GammaRamp # | |
| Show GammaRamp # | |
| Generic GammaRamp # | |
| NFData GammaRamp # | |
Defined in Graphics.UI.GLFW.Types | |
| type Rep GammaRamp # | |
Defined in Graphics.UI.GLFW.Types type Rep GammaRamp = D1 (MetaData "GammaRamp" "Graphics.UI.GLFW.Types" "GLFW-b-3.2.1.0-5or8c1J4zQVGPTWjqr61i7" False) (C1 (MetaCons "GammaRamp" PrefixI True) (S1 (MetaSel (Just "gammaRampRed") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Int]) :*: (S1 (MetaSel (Just "gammaRampGreen") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Int]) :*: S1 (MetaSel (Just "gammaRampBlue") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Int])))) | |
getMonitors :: IO (Maybe [Monitor]) #
Gets the list of available monitors, if possible. See glfwGetMonitors
getPrimaryMonitor :: IO (Maybe Monitor) #
Gets the primary monitor. See glfwGetPrimaryMonitor
getMonitorPos :: Monitor -> IO (Int, Int) #
Gets the position of the specified monitor within the coordinate space. See glfwGetMonitorPos
getMonitorPhysicalSize :: Monitor -> IO (Int, Int) #
The physical width and height of the monitor. See glfwGetMonitorPhysicalSize
getMonitorName :: Monitor -> IO (Maybe String) #
A human-readable name for the monitor specified. See getMonitorName
setMonitorCallback :: Maybe MonitorCallback -> IO () #
Sets a callback for when a monitor is connected or disconnected. See glfwSetMonitorCallback
type MonitorCallback = Monitor -> MonitorState -> IO () #
Fires when a monitor is connected or disconnected.
getVideoModes :: Monitor -> IO (Maybe [VideoMode]) #
Obtains the possible video modes of the monitor. See glfwGetVideoModes
getVideoMode :: Monitor -> IO (Maybe VideoMode) #
Gets the active video mode of the monitor. See glfwGetVideoMode
getGammaRamp :: Monitor -> IO (Maybe GammaRamp) #
Gets the gamma ramp in use with the monitor. See glfwGetGammaRamp
setGammaRamp :: Monitor -> GammaRamp -> IO () #
Assigns a gamma ramp to use with the given monitor. See glfwSetGammaRamp
Window handling
Reprisents a GLFW window value. See the Window Guide
Instances
| Eq Window # | |
| Data Window # | |
Defined in Graphics.UI.GLFW.Types Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Window -> c Window # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Window # toConstr :: Window -> Constr # dataTypeOf :: Window -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Window) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Window) # gmapT :: (forall b. Data b => b -> b) -> Window -> Window # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Window -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Window -> r # gmapQ :: (forall d. Data d => d -> u) -> Window -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Window -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Window -> m Window # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Window -> m Window # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Window -> m Window # | |
| Ord Window # | |
| Show Window # | |
| Generic Window # | |
| type Rep Window # | |
Defined in Graphics.UI.GLFW.Types type Rep Window = D1 (MetaData "Window" "Graphics.UI.GLFW.Types" "GLFW-b-3.2.1.0-5or8c1J4zQVGPTWjqr61i7" True) (C1 (MetaCons "Window" PrefixI True) (S1 (MetaSel (Just "unWindow") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Ptr C'GLFWwindow)))) | |
data WindowHint #
Lets you set various window hints before creating a Window.
See Window Hints,
particularly Supported and Default Values.
Constructors
Instances
data ContextRobustness #
The OpenGL robustness strategy.
Constructors
| ContextRobustness'NoRobustness | |
| ContextRobustness'NoResetNotification | |
| ContextRobustness'LoseContextOnReset |
Instances
data OpenGLProfile #
The OpenGL profile.
Constructors
| OpenGLProfile'Any | |
| OpenGLProfile'Compat | |
| OpenGLProfile'Core |
Instances
The type of OpenGL to create a context for.
Constructors
| ClientAPI'NoAPI | |
| ClientAPI'OpenGL | |
| ClientAPI'OpenGLES |
Instances
| Bounded ClientAPI # | |
| Enum ClientAPI # | |
Defined in Graphics.UI.GLFW.Types Methods succ :: ClientAPI -> ClientAPI # pred :: ClientAPI -> ClientAPI # fromEnum :: ClientAPI -> Int # enumFrom :: ClientAPI -> [ClientAPI] # enumFromThen :: ClientAPI -> ClientAPI -> [ClientAPI] # enumFromTo :: ClientAPI -> ClientAPI -> [ClientAPI] # enumFromThenTo :: ClientAPI -> ClientAPI -> ClientAPI -> [ClientAPI] # | |
| Eq ClientAPI # | |
| Data ClientAPI # | |
Defined in Graphics.UI.GLFW.Types Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ClientAPI -> c ClientAPI # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c ClientAPI # toConstr :: ClientAPI -> Constr # dataTypeOf :: ClientAPI -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c ClientAPI) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ClientAPI) # gmapT :: (forall b. Data b => b -> b) -> ClientAPI -> ClientAPI # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ClientAPI -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ClientAPI -> r # gmapQ :: (forall d. Data d => d -> u) -> ClientAPI -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> ClientAPI -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> ClientAPI -> m ClientAPI # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ClientAPI -> m ClientAPI # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ClientAPI -> m ClientAPI # | |
| Ord ClientAPI # | |
| Read ClientAPI # | |
| Show ClientAPI # | |
| Generic ClientAPI # | |
| NFData ClientAPI # | |
Defined in Graphics.UI.GLFW.Types | |
| type Rep ClientAPI # | |
Defined in Graphics.UI.GLFW.Types type Rep ClientAPI = D1 (MetaData "ClientAPI" "Graphics.UI.GLFW.Types" "GLFW-b-3.2.1.0-5or8c1J4zQVGPTWjqr61i7" False) (C1 (MetaCons "ClientAPI'NoAPI" PrefixI False) (U1 :: Type -> Type) :+: (C1 (MetaCons "ClientAPI'OpenGL" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "ClientAPI'OpenGLES" PrefixI False) (U1 :: Type -> Type))) | |
data ContextCreationAPI #
The type of API to use for context creation. See the Window Guide for more information.
This is a hard constraint. If no client API is requested, this hint is ignored. Best practice is to stick to one API or the other, otherwise may segfault on Linux. OS X does not support the EGL API and will fail if this hint is used.
Constructors
| ContextCreationAPI'Native | |
| ContextCreationAPI'EGL |
Instances
data ContextReleaseBehavior #
The context release behavior. See the Window Guide for more information.
Context release behaviors are described in detail by the KHR_context_flush_control extension.
Instances
defaultWindowHints :: IO () #
Sets all the window hints to default. See glfwDefaultWindowHints
windowHint :: WindowHint -> IO () #
Hints something to the GLFW windowing system. See glfwWindowHint
Arguments
| :: Int | Desired width for the window. |
| -> Int | Desired height for the window. |
| -> String | Desired title for the window. |
| -> Maybe Monitor | Monitor to use in fullscreen mode. |
| -> Maybe Window | Window for context object sharing, see here. |
| -> IO (Maybe Window) |
Creates a new window. Note: If running in GHCI don't forget to `:set -fno-ghci-sandbox` or you may run into an assertion failure, segfault or other nasty crash. See glfwCreateWindow
destroyWindow :: Window -> IO () #
Cleans up a window and all associated resources See glfwDestroyWindow
windowShouldClose :: Window -> IO Bool #
If the window should close or not. See glfwWindowShouldClose
setWindowShouldClose :: Window -> Bool -> IO () #
Sets if the window should close or not. See glfwSetWindowShouldClose
setWindowTitle :: Window -> String -> IO () #
Sets the Title string of the window. See glfwSetWindowTitle
getWindowPos :: Window -> IO (Int, Int) #
Gets the window's position (in Screen Coordinates). See glfwGetWindowPos
setWindowPos :: Window -> Int -> Int -> IO () #
Sets the window's position (in Screen Coordinates). See glfwSetWindowPos
getWindowSize :: Window -> IO (Int, Int) #
Gets the size of the window (in Screen Coordinates). See glfwGetWindowSize
setWindowSize :: Window -> Int -> Int -> IO () #
Sets the size of the client area for the window (in Screen Coordinates). See glfwSetWindowSize
Arguments
| :: Window | |
| -> Maybe Int | The minimum width, in screen coordinates, of the client area. |
| -> Maybe Int | The minimum height, in screen coordinates, of the client area. |
| -> Maybe Int | The maximum width, in screen coordinates, of the client area. |
| -> Maybe Int | The maximum height, in screen coordinates, of the client area. |
| -> IO () |
Sets the size limits of the client area of the specified window. If the
window is full screen, the size limits only take effect once it is made
windowed. If the window is not resizable this function does nothing. Pass
Nothing in any argument to disable the limit.
See glfwSetWindowSizeLimits
setWindowAspectRatio :: Window -> Maybe (Int, Int) -> IO () #
Sets the required aspect ratio of the client area of the specified window. Pass Nothing to disable the limit. See glfwSetWindowAspectRatio
getWindowFrameSize :: Window -> IO (Int, Int, Int, Int) #
Gets the size of the frame around the window (in Screen Coordinates). This
size includes the title bar, if the window has one. Not to be confused with
getFramebufferSize, which gets the size of the rendering area.
See glfwGetWindowFrameSize
getFramebufferSize :: Window -> IO (Int, Int) #
The size of the framebuffer (in Pixels) See glfwGetFramebufferSize
setWindowIcon :: Window -> [Image] -> IO () #
Sets the icon of the specified window. The system will try to find the image with the dimensions closest to the ones required by the platform. This image is then scaled and used as the icon for that size. Good sizes are 16x16, 32x32, and 48x48. Pass the empty list to reset to the default icon. Has no effect on OS X (See the Bundle Programming Guide)
iconifyWindow :: Window -> IO () #
Iconifies (minimizes) the window. See glfwIconifyWindow
restoreWindow :: Window -> IO () #
Restores the window from an iconified/minimized state. See glfwRestoreWindow
focusWindow :: Window -> IO () #
Brings the specified window to front and sets input focus. The window should already be visible and not iconified. See glfwFocusWindow
maximizeWindow :: Window -> IO () #
Maximizes the specified window if it was not already maximized. See glfwMaximizeWindow
showWindow :: Window -> IO () #
Shows the window. See glfwShowWindow
hideWindow :: Window -> IO () #
Hides the window. See glfwHideWindow
getWindowMonitor :: Window -> IO (Maybe Monitor) #
Gets the monitor that this window is running on, provided the window is fullscreen. See glfwGetWindowMonitor
setCursorPos :: Window -> Double -> Double -> IO () #
Sets the position of the cursor within the window. See glfwSetCursorPos
setFullscreen :: Window -> Monitor -> VideoMode -> IO () #
Makes a window fullscreen on the given monitor. The number of red, green,
and blue bits is ignored. Note, this shouldn't be used to update the
resolution of a fullscreen window. Use setWindowSize instead.
See glfwSetWindowMonitor
Arguments
| :: Window | |
| -> Int | The width of the client area |
| -> Int | The height of the client area |
| -> Int | The x position of the window |
| -> Int | The y position of the window |
| -> IO () |
Updates a window to be windowed instead of fullscreen. Note, this shouldn't
be used to update the position or size of a window. Use setWindowPos and
setWindowSize instead.
See glfwSetWindowMonitor
getWindowFocused :: Window -> IO Bool #
If the window has focus or not. See glfwGetWindowAttrib
getWindowMaximized :: Window -> IO Bool #
If the window is maximized or not. See glfwGetWindowAttrib
getWindowFloating :: Window -> IO Bool #
If the window has been set to be 'always on top' or not. See glfwGetWindowAttrib
getWindowIconified :: Window -> IO Bool #
If the window is iconified (minimized) or not. See glfwGetWindowAttrib
getWindowResizable :: Window -> IO Bool #
If the window is resizable or not. See glfwGetWindowAttrib
getWindowDecorated :: Window -> IO Bool #
If the window is decorated or not. See glfwGetWindowAttrib
getWindowVisible :: Window -> IO Bool #
If the window is visible or not. See glfwGetWindowAttrib
getWindowClientAPI :: Window -> IO ClientAPI #
The client api for this window. See glfwGetWindowAttrib
getWindowContextCreationAPI :: Window -> IO ContextCreationAPI #
Returns the context creation API used to create the specified window. See glfwGetWindowAttrib
getWindowContextVersionMajor :: Window -> IO Int #
The context's "major" version, x.0.0 See glfwGetWindowAttrib
getWindowContextVersionMinor :: Window -> IO Int #
The context's "minor" version, 0.y.0 See glfwGetWindowAttrib
getWindowContextVersionRevision :: Window -> IO Int #
The context's "revision" version, 0.0.z See glfwGetWindowAttrib
getWindowContextRobustness :: Window -> IO ContextRobustness #
The context robustness of this window. See glfwGetWindowAttrib
getWindowContextReleaseBehavior :: Window -> IO ContextReleaseBehavior #
Returns the context release behavior. See glfwGetWindowAttrib
getWindowContextNoError :: Window -> IO Bool #
Returns true if the window is set to NO_ERROR (see the KHR_no_error extension.
getWindowOpenGLForwardCompat :: Window -> IO Bool #
If this window is set for opengl to be forward compatible. See glfwGetWindowAttrib
getWindowOpenGLDebugContext :: Window -> IO Bool #
If the window has an opengl debug context See glfwGetWindowAttrib
getWindowOpenGLProfile :: Window -> IO OpenGLProfile #
Obtains the current opengl profile. See glfwGetWindowAttrib
setWindowPosCallback :: Window -> Maybe WindowPosCallback -> IO () #
Sets the callback to use when the window position changes. See glfwSetWindowPosCallback
setWindowSizeCallback :: Window -> Maybe WindowSizeCallback -> IO () #
Sets the callback to use when the window's size changes. See glfwSetWindowSizeCallback
type WindowSizeCallback = Window -> Int -> Int -> IO () #
Fires when the window is resized (in Screen Coordinates, which might not map 1:1 with pixels).
setWindowCloseCallback :: Window -> Maybe WindowCloseCallback -> IO () #
Sets the callback to use when the user attempts to close the window. See glfwSetWindowCloseCallback
type WindowCloseCallback = Window -> IO () #
Fires when the user is attempting to close the window
setWindowRefreshCallback :: Window -> Maybe WindowRefreshCallback -> IO () #
Sets the callback to use when the window's data is partly dead and it should refresh. See glfwSetWindowRefreshCallback
type WindowRefreshCallback = Window -> IO () #
Fires when the contents of the window are damaged and they must be refreshed.
setWindowFocusCallback :: Window -> Maybe WindowFocusCallback -> IO () #
Sets the callback to use when the window gains or loses focus. See glfwSetWindowFocusCallback
type WindowFocusCallback = Window -> Bool -> IO () #
Fires when the window gains or loses input focus.
setWindowIconifyCallback :: Window -> Maybe WindowIconifyCallback -> IO () #
Sets the callback to use when the window is iconified or not (aka, minimized or not). See glfwSetWindowIconifyCallback
type WindowIconifyCallback = Window -> Bool -> IO () #
Fires when the window is iconified (minimized) or not.
setFramebufferSizeCallback :: Window -> Maybe FramebufferSizeCallback -> IO () #
Sets the callback to use when the framebuffer's size changes. See glfwSetFramebufferSizeCallback
type FramebufferSizeCallback = Window -> Int -> Int -> IO () #
Fires when the size of the framebuffer for the window changes (in Pixels).
pollEvents :: IO () #
Checks for any pending events, processes them, and then immediately returns. This is most useful for continual rendering, such as games. See the Event Processing Guide
waitEvents :: IO () #
Waits until at least one event is in the queue then processes the queue and returns. Requires at least one window to be active for it to sleep. This saves a lot of CPU, and is better if you're doing only periodic rendering, such as with an editor program. See the Event Processing Guide
waitEventsTimeout :: Double -> IO () #
Same as waitEvents, with a timeout after which the function returns.
See the Event Processing Guide
postEmptyEvent :: IO () #
Creates an empty event within the event queue. Can be called from any
thread, so you can use this to wake up the main thread that's using
waitEvents from a secondary thread.
See the Event Processing Guide
Input handling
Part of the Keyboard Input system.
Constructors
Instances
The state of an individual key when getKey is called.
Constructors
| KeyState'Pressed | |
| KeyState'Released | |
| KeyState'Repeating |
Instances
| Bounded KeyState # | |
| Enum KeyState # | |
Defined in Graphics.UI.GLFW.Types | |
| Eq KeyState # | |
| Data KeyState # | |
Defined in Graphics.UI.GLFW.Types Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> KeyState -> c KeyState # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c KeyState # toConstr :: KeyState -> Constr # dataTypeOf :: KeyState -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c KeyState) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c KeyState) # gmapT :: (forall b. Data b => b -> b) -> KeyState -> KeyState # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> KeyState -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> KeyState -> r # gmapQ :: (forall d. Data d => d -> u) -> KeyState -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> KeyState -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> KeyState -> m KeyState # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> KeyState -> m KeyState # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> KeyState -> m KeyState # | |
| Ord KeyState # | |
Defined in Graphics.UI.GLFW.Types | |
| Read KeyState # | |
| Show KeyState # | |
| Generic KeyState # | |
| NFData KeyState # | |
Defined in Graphics.UI.GLFW.Types | |
| type Rep KeyState # | |
Defined in Graphics.UI.GLFW.Types type Rep KeyState = D1 (MetaData "KeyState" "Graphics.UI.GLFW.Types" "GLFW-b-3.2.1.0-5or8c1J4zQVGPTWjqr61i7" False) (C1 (MetaCons "KeyState'Pressed" PrefixI False) (U1 :: Type -> Type) :+: (C1 (MetaCons "KeyState'Released" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "KeyState'Repeating" PrefixI False) (U1 :: Type -> Type))) | |
For use with the Joystick Input system.
Constructors
| Joystick'1 | |
| Joystick'2 | |
| Joystick'3 | |
| Joystick'4 | |
| Joystick'5 | |
| Joystick'6 | |
| Joystick'7 | |
| Joystick'8 | |
| Joystick'9 | |
| Joystick'10 | |
| Joystick'11 | |
| Joystick'12 | |
| Joystick'13 | |
| Joystick'14 | |
| Joystick'15 | |
| Joystick'16 |
Instances
| Bounded Joystick # | |
| Enum Joystick # | |
Defined in Graphics.UI.GLFW.Types | |
| Eq Joystick # | |
| Data Joystick # | |
Defined in Graphics.UI.GLFW.Types Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Joystick -> c Joystick # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Joystick # toConstr :: Joystick -> Constr # dataTypeOf :: Joystick -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Joystick) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Joystick) # gmapT :: (forall b. Data b => b -> b) -> Joystick -> Joystick # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Joystick -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Joystick -> r # gmapQ :: (forall d. Data d => d -> u) -> Joystick -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Joystick -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Joystick -> m Joystick # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Joystick -> m Joystick # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Joystick -> m Joystick # | |
| Ord Joystick # | |
Defined in Graphics.UI.GLFW.Types | |
| Read Joystick # | |
| Show Joystick # | |
| Generic Joystick # | |
| NFData Joystick # | |
Defined in Graphics.UI.GLFW.Types | |
| type Rep Joystick # | |
Defined in Graphics.UI.GLFW.Types type Rep Joystick = D1 (MetaData "Joystick" "Graphics.UI.GLFW.Types" "GLFW-b-3.2.1.0-5or8c1J4zQVGPTWjqr61i7" False) ((((C1 (MetaCons "Joystick'1" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "Joystick'2" PrefixI False) (U1 :: Type -> Type)) :+: (C1 (MetaCons "Joystick'3" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "Joystick'4" PrefixI False) (U1 :: Type -> Type))) :+: ((C1 (MetaCons "Joystick'5" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "Joystick'6" PrefixI False) (U1 :: Type -> Type)) :+: (C1 (MetaCons "Joystick'7" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "Joystick'8" PrefixI False) (U1 :: Type -> Type)))) :+: (((C1 (MetaCons "Joystick'9" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "Joystick'10" PrefixI False) (U1 :: Type -> Type)) :+: (C1 (MetaCons "Joystick'11" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "Joystick'12" PrefixI False) (U1 :: Type -> Type))) :+: ((C1 (MetaCons "Joystick'13" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "Joystick'14" PrefixI False) (U1 :: Type -> Type)) :+: (C1 (MetaCons "Joystick'15" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "Joystick'16" PrefixI False) (U1 :: Type -> Type))))) | |
data JoystickState #
Part of the JoystickCallback, for when a monitor gets connected or disconnected.
Constructors
| JoystickState'Connected | |
| JoystickState'Disconnected |
Instances
data JoystickButtonState #
If a given joystick button is pressed or not when getJoystickButtons is called.
Instances
data MouseButton #
Part of the Mouse Input system.
Constructors
| MouseButton'1 | |
| MouseButton'2 | |
| MouseButton'3 | |
| MouseButton'4 | |
| MouseButton'5 | |
| MouseButton'6 | |
| MouseButton'7 | |
| MouseButton'8 |
Instances
data MouseButtonState #
If the mouse button is pressed or not when getMouseButton is called.
Constructors
| MouseButtonState'Pressed | |
| MouseButtonState'Released |
Instances
data CursorState #
If the mouse's cursor is in the window or not.
Constructors
| CursorState'InWindow | |
| CursorState'NotInWindow |
Instances
data CursorInputMode #
Allows for special forms of mouse input. See Cursor Modes
Instances
data StickyKeysInputMode #
When sticky keys is enabled, once a key is pressed it will remain pressed
at least until the state is polled with getKey. After that, if the key has
been released it will switch back to released. This helps prevent problems
with low-resolution polling missing key pressed. Note that use of the
callbacks to avoid this problem the the recommended route, and this is just
for a fallback.
Instances
data StickyMouseButtonsInputMode #
This is the mouse version of StickyKeysInputMode.
Instances
data ModifierKeys #
Modifier keys that were pressed as part of another keypress event.
Constructors
| ModifierKeys | |
Fields | |
Instances
GLFW image data, for setting up custom mouse cursor appearnaces.
Instances
| Eq Image # | |
| Data Image # | |
Defined in Graphics.UI.GLFW.Types Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Image -> c Image # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Image # dataTypeOf :: Image -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Image) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Image) # gmapT :: (forall b. Data b => b -> b) -> Image -> Image # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Image -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Image -> r # gmapQ :: (forall d. Data d => d -> u) -> Image -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Image -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Image -> m Image # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Image -> m Image # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Image -> m Image # | |
| Ord Image # | |
| Read Image # | |
| Show Image # | |
| Generic Image # | |
| NFData Image # | |
Defined in Graphics.UI.GLFW.Types | |
| type Rep Image # | |
Defined in Graphics.UI.GLFW.Types type Rep Image = D1 (MetaData "Image" "Graphics.UI.GLFW.Types" "GLFW-b-3.2.1.0-5or8c1J4zQVGPTWjqr61i7" False) (C1 (MetaCons "Image" PrefixI True) (S1 (MetaSel (Just "imageWidth") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Int) :*: (S1 (MetaSel (Just "imageHeight") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Int) :*: S1 (MetaSel (Just "imagePixels") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [CUChar])))) | |
mkImage :: Int -> Int -> (Int -> Int -> (Word8, Word8, Word8, Word8)) -> Image #
Create an image given the function to generate 8-bit RGBA values based on the pixel location.
Reprisents a GLFW cursor.
Constructors
| Cursor | |
Fields | |
Instances
| Eq Cursor # | |
| Data Cursor # | |
Defined in Graphics.UI.GLFW.Types Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Cursor -> c Cursor # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Cursor # toConstr :: Cursor -> Constr # dataTypeOf :: Cursor -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Cursor) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Cursor) # gmapT :: (forall b. Data b => b -> b) -> Cursor -> Cursor # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Cursor -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Cursor -> r # gmapQ :: (forall d. Data d => d -> u) -> Cursor -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Cursor -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Cursor -> m Cursor # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Cursor -> m Cursor # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Cursor -> m Cursor # | |
| Ord Cursor # | |
| Show Cursor # | |
| Generic Cursor # | |
| type Rep Cursor # | |
Defined in Graphics.UI.GLFW.Types type Rep Cursor = D1 (MetaData "Cursor" "Graphics.UI.GLFW.Types" "GLFW-b-3.2.1.0-5or8c1J4zQVGPTWjqr61i7" True) (C1 (MetaCons "Cursor" PrefixI True) (S1 (MetaSel (Just "unCursor") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Ptr C'GLFWcursor)))) | |
data StandardCursorShape #
Lets you use one of the standard cursor appearnaces that the local system theme provides for. See Standard Cursor Creation.
Constructors
| StandardCursorShape'Arrow | |
| StandardCursorShape'IBeam | |
| StandardCursorShape'Crosshair | |
| StandardCursorShape'Hand | |
| StandardCursorShape'HResize | |
| StandardCursorShape'VResize |
Instances
getCursorInputMode :: Window -> IO CursorInputMode #
Gets the current cursor input mode. See glfwSetInputMode
setCursorInputMode :: Window -> CursorInputMode -> IO () #
Set the cursor input mode. See glfwSetInputMode
getStickyKeysInputMode :: Window -> IO StickyKeysInputMode #
Gets the current sticky keys mode. See glfwSetInputMode
setStickyKeysInputMode :: Window -> StickyKeysInputMode -> IO () #
Sets if sticky keys should be used or not. See glfwSetInputMode
getStickyMouseButtonsInputMode :: Window -> IO StickyMouseButtonsInputMode #
Gets if sticky mouse buttons are on or not. See glfwSetInputMode
setStickyMouseButtonsInputMode :: Window -> StickyMouseButtonsInputMode -> IO () #
Sets if sticky mouse buttons should be used or not. See glfwSetInputMode
getKey :: Window -> Key -> IO KeyState #
Gets the state of the specified key. If Stickey Keys isn't enabled then it's possible for keyboard polling to miss individual key presses. Use the callback to avoid this. See glfwGetKey
getKeyName :: Key -> Int -> IO (Maybe String) #
Returns the localized name of the specified printable key. This is intended
for displaying key bindings to the user. The scancode is used if the provided
Key isn't printable. If the scancode maps to a non-printable key as well,
then Nothing is returned.
See glfwGetKeyName
getMouseButton :: Window -> MouseButton -> IO MouseButtonState #
Gets the state of a single specified mouse button. If sticky mouse button mode isn't enabled it's possible for mouse polling to miss individual mouse events. Use the call back to avoid this. See glfwGetMouseButton
getCursorPos :: Window -> IO (Double, Double) #
Returns the position, in screen coodinates, relative to the upper left.
If the CursorInputMode is "disabled", then results are unbounded by the window size.
See glfwGetCursorPos
setKeyCallback :: Window -> Maybe KeyCallback -> IO () #
Assigns the given callback to use for all keyboard presses and repeats. See glfwSetKeyCallback
type KeyCallback = Window -> Key -> Int -> KeyState -> ModifierKeys -> IO () #
Fires for each press or repeat of keyboard keys (regardless of if it has textual meaning or not, eg Shift)
setCharCallback :: Window -> Maybe CharCallback -> IO () #
Sets the callback to use when the user types a character See glfwSetCharCallback
type CharCallback = Window -> Char -> IO () #
Fires when a complete character codepoint is typed by the user, Shift then b generates B.
setCharModsCallback :: Window -> Maybe CharModsCallback -> IO () #
Sets the callback to use with Unicode characters regardless of what modifier keys are used. See glfwSetCharModsCallback
type CharModsCallback = Window -> Char -> ModifierKeys -> IO () #
Similar to CharCallback, fires when a complete unicode codepoint is typed by the user.
setMouseButtonCallback :: Window -> Maybe MouseButtonCallback -> IO () #
Assigns the callback to run whenver a mouse button is clicked. See glfwSetMouseButtonCallback
type MouseButtonCallback = Window -> MouseButton -> MouseButtonState -> ModifierKeys -> IO () #
Fires whenever a mouse button is clicked.
setCursorPosCallback :: Window -> Maybe CursorPosCallback -> IO () #
Assigns the callback to run whenver the cursor position changes. See glfwSetCursorPosCallback
type CursorPosCallback = Window -> Double -> Double -> IO () #
Fires every time the cursor position changes. Sub-pixel accuracy is used, when available.
setCursorEnterCallback :: Window -> Maybe CursorEnterCallback -> IO () #
Sets the callback for when the cursor enters or leaves the client area. See Cursor Enter/Leave Events
type CursorEnterCallback = Window -> CursorState -> IO () #
Fires when the cursor enters or exits the client area of the window.
Arguments
| :: Image | The desired cursor image. |
| -> Int | The desired x-coordinate, in pixels, of the cursor hotspot. |
| -> Int | The desired y-coordinate, in pixels, of the cursor hotspot. |
| -> IO Cursor |
Creates a new cursor.
createStandardCursor :: StandardCursorShape -> IO Cursor #
Creates a cursor with a standard shape that can be set for a window with setCursor.
setCursor :: Window -> Cursor -> IO () #
Sets the cursor image to be used when the cursor is over the client area of the specified window. The set cursor will only be visible when the cursor mode of the window is GLFW_CURSOR_NORMAL.
destroyCursor :: Cursor -> IO () #
Destroys a cursor previously created with createCursor. Any remaining
cursors will be destroyed by terminate.
setScrollCallback :: Window -> Maybe ScrollCallback -> IO () #
Sets the callback to run when the user scrolls with the mouse wheel or a touch gesture. See Scroll Input
type ScrollCallback = Window -> Double -> Double -> IO () #
Fires when the user scrolls the mouse wheel or via touch gesture.
setDropCallback :: Window -> Maybe DropCallback -> IO () #
Sets the file drop callback of the specified window, which is called when one or more dragged files are dropped on the window.
type DropCallback #
Arguments
| = Window | The window that received the event. |
| -> [String] | The file and/or directory path names |
| -> IO () |
A callback that allows for drag and drop support.
joystickPresent :: Joystick -> IO Bool #
Tests if the joystick is present at all See glfwJoystickPresent
getJoystickAxes :: Joystick -> IO (Maybe [Double]) #
Returns the values of all axes of the specified joystick, normalized to between -1.0 and 1.0 See glfwGetJoystickAxes
getJoystickButtons :: Joystick -> IO (Maybe [JoystickButtonState]) #
Returns a list of all joystick button states for the specified joystick. See glfwGetJoystickButtons
getJoystickName :: Joystick -> IO (Maybe String) #
A human-readable name for a Joystick. Not guranteed to be unique. See glfwGetJoystickName
setJoystickCallback :: Maybe JoystickCallback -> IO () #
Sets a callback for when a joystick is connected or disconnected. See glfwSetJoystickCallback
type JoystickCallback = Joystick -> JoystickState -> IO () #
Fires when a joystick is connected or disconnected.
Time
getTime :: IO (Maybe Double) #
Returns the time (in seconds) of the GLFW timer.
This is the amount of time since GLFW was initialized, unless setTime was used.
The exact resolution is system dependent.
See glfwGetTime
Sets the GLFW timer to the specified value, which is measured in seconds, and must be positive. The value must also be less than ~584 years in seconds (18446744073.0). After this the timer begins to count upward at the normal rate. See glfwSetTime
getTimerValue :: IO Word64 #
Returns the current value of the raw timer, measured in 1 / frequency seconds. The frequency can be queried using getTimerFrequency. See Timer input
getTimerFrequency :: IO Word64 #
Returns the frequency, in Hz, of the raw timer. See Timer input
Context
makeContextCurrent :: Maybe Window -> IO () #
Makes the context of the specified window the current one for the calling thread. A context can only be made current on a single thread at a time, and each thread can have only a single current context at a time. See glfwMakeContextCurrent
getCurrentContext :: IO (Maybe Window) #
Obtains which window owns the current context of the calling thread. See glfwGetCurrentContext
swapBuffers :: Window -> IO () #
Swaps the front and back buffers of the window. See glfwSwapBuffers
swapInterval :: Int -> IO () #
Sets the number of screen updates that the GPU should wait after swapBuffers before actually swapping the buffers.
Generates Error'NoCurrentContext if no context is current.
See glfwSwapInterval
extensionSupported :: String -> IO Bool #
If the current OpenGL or OpenGL ES context supports the extension specified.
Generates Error'NoCurrentContext if no context is current.
See glfwExtensionSupported
Clipboard
getClipboardString :: Window -> IO (Maybe String) #
Obtains the contents of the system keyboard, if possible.
Generates Error'FormatUnavailable if the system clipboard is empty or if it's not a UTF-8 string.
See glfwGetClipboardString
setClipboardString :: Window -> String -> IO () #
The window that will own the clipboard contents, and also the clipboard string. See glfwSetClipboardString
Vulkan-related functions
vulkanSupported :: IO Bool #
This function returns whether the Vulkan loader has been found.
This check is performed by init.
Arguments
| :: Ptr vkInstance | VkInstance. Note, the returned function must be used with the same instance or its child. |
| -> String | Function name |
| -> IO (FunPtr vkProc) |
Returns the address of the specified Vulkan instance function.
getPhysicalDevicePresentationSupport #
Arguments
| :: Ptr vkInstance | VkInstance |
| -> Ptr vkPhysicalDevice | VkPhysicalDevice |
| -> Word32 | Index of a queue family to query.
This is an index in the array returned by
|
| -> IO Bool |
Returns whether the specified queue family can present images.
Arguments
| :: Enum vkResult | |
| => Ptr vkInstance | VkInstance |
| -> Window | GLFWwindow *window |
| -> Ptr vkAllocationCallbacks | const VkAllocationCallbacks *allocator |
| -> Ptr vkSurfaceKHR | VkSurfaceKHR *surface |
| -> IO vkResult |
Creates a Vulkan surface for the specified window
Native access functions
The low level native-access bindings are exposed here via bindings-GLFW.
These must be enabled with the ExposeNative flag passed to bindings-GLFW.
The return values of these functions are used as a best-guess and are not
coupled with any other implementation. They should be used with caution
and at your own risk.
getWin32Adapter :: Window -> IO CString #
getWin32Monitor :: Window -> IO CString #
getWin32Window :: Window -> IO (Ptr ()) #
getWGLContext :: Window -> IO (Ptr ()) #
getCocoaWindow :: Window -> IO (Ptr ()) #
getNSGLContext :: Window -> IO (Ptr ()) #
getX11Display :: Window -> IO (Ptr display) #
getX11Adapter :: Window -> IO Word64 #
getX11Monitor :: Window -> IO Word64 #
getX11Window :: Window -> IO Word64 #
See glfwGetX11Window
getGLXContext :: Window -> IO (Ptr ()) #
getGLXWindow :: Window -> IO Word64 #
See glfwGetGLXWindow
getWaylandDisplay :: IO (Ptr wl_display) #
getWaylandMonitor :: Window -> IO (Ptr wl_output) #
getWaylandWindow :: Window -> IO (Ptr wl_surface) #
getMirDisplay :: IO (Ptr mir_connection) #
getMirMonitor :: Window -> IO Int #
getMirWindow :: Window -> IO (Ptr mir_surface) #
See glfwGetMirWindow
getEGLDisplay :: IO (Ptr ()) #
getEGLContext :: Window -> IO (Ptr ()) #
getEGLSurface :: Window -> IO (Ptr ()) #