Safe Haskell | None |
---|---|
Language | Haskell98 |
- runGraphics :: IO () -> IO ()
- type Title = String
- type Size = (Int, Int)
- data Window
- openWindow :: Title -> Size -> IO Window
- getMainWindowSize :: IO Size
- clearWindow :: Window -> IO ()
- drawInWindow :: Window -> Graphic -> IO ()
- drawInWindowNow :: Window -> Graphic -> IO ()
- setGraphic :: Window -> Graphic -> IO ()
- setGraphic' :: Window -> Graphic -> IO ()
- setDirty :: Window -> IO ()
- closeWindow :: Window -> IO ()
- openWindowEx :: Title -> Maybe Point -> Maybe Size -> RedrawMode -> IO Window
- data RedrawMode
- drawGraphic :: RedrawMode
- drawBufferedGraphic :: RedrawMode
- data Graphic
- nullGraphic :: Graphic
- emptyGraphic :: Graphic
- overGraphic :: Graphic -> Graphic -> Graphic
- overGraphics :: [Graphic] -> Graphic
- translateGraphic :: (Int, Int) -> Graphic -> Graphic
- data Color
- type RGB = Color3 GLfloat
- type RGBA = Color4 GLfloat
- rgb :: (Integral r, Integral g, Integral b) => r -> g -> b -> RGB
- rgba :: (Integral r, Integral g, Integral b, Integral a) => r -> g -> b -> a -> RGBA
- withColor :: Color -> Graphic -> Graphic
- withColor' :: Color a => a -> Graphic -> Graphic
- text :: Point -> String -> Graphic
- type Point = (Int, Int)
- ellipse :: Point -> Point -> Graphic
- shearEllipse :: Point -> Point -> Point -> Graphic
- line :: Point -> Point -> Graphic
- polygon :: [Point] -> Graphic
- polyline :: [Point] -> Graphic
- polyBezier :: [Point] -> Graphic
- type Angle = GLfloat
- arc :: Point -> Point -> Angle -> Angle -> Graphic
- scissorGraphic :: (Point, Size) -> Graphic -> Graphic
- data Key :: *
- data SpecialKey :: *
- = UNKNOWN
- | ESC
- | F1
- | F2
- | F3
- | F4
- | F5
- | F6
- | F7
- | F8
- | F9
- | F10
- | F11
- | F12
- | F13
- | F14
- | F15
- | F16
- | F17
- | F18
- | F19
- | F20
- | F21
- | F22
- | F23
- | F24
- | F25
- | UP
- | DOWN
- | LEFT
- | RIGHT
- | LSHIFT
- | RSHIFT
- | LCTRL
- | RCTRL
- | LALT
- | RALT
- | TAB
- | ENTER
- | BACKSPACE
- | INSERT
- | DEL
- | PAGEUP
- | PAGEDOWN
- | HOME
- | END
- | KP_0
- | KP_1
- | KP_2
- | KP_3
- | KP_4
- | KP_5
- | KP_6
- | KP_7
- | KP_8
- | KP_9
- | KP_DIVIDE
- | KP_MULTIPLY
- | KP_SUBTRACT
- | KP_ADD
- | KP_DECIMAL
- | KP_EQUAL
- | KP_ENTER
- data UIEvent
- hasShiftModifier :: ([Char], [SpecialKey]) -> Bool
- hasCtrlModifier :: ([Char], [SpecialKey]) -> Bool
- hasAltModifier :: ([Char], [SpecialKey]) -> Bool
- maybeGetWindowEvent :: Double -> Window -> IO (Maybe UIEvent)
- getWindowEvent :: Double -> Window -> IO UIEvent
- data Word32 :: *
- timeGetTime :: IO Double
- word32ToInt :: Word32 -> Int
- isKeyPressed :: Enum a => a -> IO Bool
Window Functions
runGraphics :: IO () -> IO () Source
clearWindow :: Window -> IO () Source
drawInWindow :: Window -> Graphic -> IO () Source
drawInWindowNow :: Window -> Graphic -> IO () Source
setGraphic :: Window -> Graphic -> IO () Source
setGraphic set the given Graphic over empty (black) background for display in current Window.
setGraphic' :: Window -> Graphic -> IO () Source
closeWindow :: Window -> IO () Source
openWindowEx :: Title -> Maybe Point -> Maybe Size -> RedrawMode -> IO Window Source
Drawing Functions
data RedrawMode Source
overGraphic :: Graphic -> Graphic -> Graphic Source
overGraphics :: [Graphic] -> Graphic Source
withColor' :: Color a => a -> Graphic -> Graphic Source
polyBezier :: [Point] -> Graphic Source
Event Handling Functions
data Key :: *
Key is represented by either a character key or a special key.
data SpecialKey :: *
Special key is a key not represented in the 32 - 127 printable ASCII range.
hasShiftModifier :: ([Char], [SpecialKey]) -> Bool Source
hasCtrlModifier :: ([Char], [SpecialKey]) -> Bool Source
hasAltModifier :: ([Char], [SpecialKey]) -> Bool Source
getWindowEvent :: Double -> Window -> IO UIEvent Source
getWindowEvent and maybeGetWindowEvent both take an additional argument sleepTime that tells how long to sleep in the case where there are no window events to return. This is used to allow the cpu to take other tasks at these times rather than needlessly spinning. The sleepTime parameter used to be fixed at 0.01.
data Word32 :: *
32-bit unsigned integer type
timeGetTime :: IO Double Source
use GLFW's high resolution timer
word32ToInt :: Word32 -> Int Source
isKeyPressed :: Enum a => a -> IO Bool Source
Designed to be used with Key, CharKey, or SpecialKey