GLFW-b- Bindings to GLFW OpenGL library

Safe HaskellNone




Error handling

Initialization and version information

Monitor handling

Window handling

createWindow :: Int -> Int -> String -> Maybe Monitor -> Maybe Window -> IO (Maybe Window) Source

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.


Input handling


type CharCallback = Window -> Char -> IO () Source

createCursor Source


:: 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 Source

Creates a cursor with a standard shape that can be set for a window with setCursor.

setCursor :: Window -> Cursor -> IO () Source

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 () Source

Destroys a cursor previously created with createCursor. Any remaining cursors will be destroyed by terminate.

setDropCallback :: Window -> Maybe DropCallback -> IO () Source

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 Source


 = Window

The window that received the event.

-> [String]

The file and/or directory path names

-> IO ()