|
|
|
|
|
Description |
Haskell Interface to GLFW (http://glfw.sourceforge.net).
Supports GLFW API version 2.6.
|
|
Synopsis |
|
|
|
|
Data types
|
|
|
Version is represented by (major, minor, revision), used
in gettable variable version.
|
|
|
Bit depth of GL display buffers, used in openWindow.
| Constructors | DisplayRGBBits !Int !Int !Int | | DisplayAlphaBits !Int | | DisplayDepthBits !Int | | DisplayStencilBits !Int | |
|
|
|
|
Window or Fullscreen mode, used in openWindow.
| Constructors | |
|
|
|
Window hints, used in settable variable openWindowHint.
| Constructors | RefreshRate | | AccumRedBits | | AccumGreenBits | | AccumBlueBits | | AccumAlphaButs | | AuxBuffers | | Stereo | | NoResize | | FSAASamples | |
|
|
|
|
Window parameters used in gettable variable windowParam.
| Constructors | Opened | | Active | | Iconified | | Accelerated | | RedBits | | GreenBits | | BlueBits | | AlphaBits | | DepthBits | | StencilBits | |
|
|
|
|
Video modes used in gettable variables videoModes and desktopMode.
| Constructors | VideoMode | | videoWidth :: !Int | | videoHeight :: !Int | | videoRedBits :: !Int | | videoBlueBits :: !Int | | videoGreenBits :: !Int | |
|
|
|
|
|
Key or button state.
| Constructors | |
|
|
|
Key is represented by either a character key or a special key.
| Constructors | |
|
|
|
Special key is a key not represented in the 32 - 127 printable ASCII range.
| Constructors | 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 | |
|
|
|
|
Mouse button is represented by left, right, middle or a number from 0 to
7. Differs from the C API.
| Constructors | ButtonLeft | | ButtonRight | | ButtonMiddle | | ButtonNo Int | |
|
|
|
|
Joystick is represent a number from 0 to 15. Differs from the C API.
| Constructors | |
|
|
|
Joystick parameters
| Constructors | |
|
|
|
Special features used in enableSpecial and disableSpecial.
| Constructors | MouseCursor | | StickyKey | | StickyMouseButton | | SystemKey | | KeyRepeat | | AutoPollEvent | |
|
|
|
|
|
|
|
Built-in bitmap font used in renderString.
| Constructors | Fixed8x16 | 8x16 fixed width font.
|
|
|
|
|
Callback type for windowCloseCallback.
|
|
|
Callback type for windowSizeCallback.
|
|
|
Callback type for windowRefreshCallback.
|
|
|
Callback type for keyCallback.
|
|
|
Callback type for charCallback.
|
|
|
Callback type for mouseButtonCallback.
|
|
|
Callback type for mousePosCallback.
|
|
|
Callback type for mouseWheelCallback.
|
|
Initialization and window functions
|
|
|
Initialize GLFW library. Returns True if successful, False otherwise. Must
be called before any other GLFW functions.
|
|
|
Terminate GLFW library after use. Before a program terminates, GLFW has to
be terminated in order to free up resources, etc.
|
|
|
Get a list of detected VideoModes, the max number of which is limited to
256 for now.
|
|
|
Get the VideoMode of current desktop.
|
|
|
Returns the GLFW C library version numbers.
|
|
|
Open a window. Returns True if successful, False otherwise. GLFW
applications can only open one window.
|
|
|
Set the window hints, i.e., additional window properties, before
openWindow.
|
|
|
Close the open window and destroy the associated OpenGL context.
|
|
|
Set the title of the opened window.
|
|
|
Get or set the size of the opened window.
|
|
|
Iconify the window.
|
|
|
Restore the window after iconification.
|
|
|
Swap the back and front color buffers of the window. If AutoPollEvent is
enabled by enableSpecial (which is the default), it also polls for new
events before the swapping.
|
|
|
Set the minimum number of monitor retraces between each each buffer swap
performed by swapBuffers. If set to zero, buffer swaps will not be
synchronized to the vertical refresh of the monitor.
|
|
|
Get the value of window parameters.
|
|
|
Get joystick parameters.
|
|
Event handling
|
|
|
Poll events, such as user input and window events. Upon calling this
function, all window states, keyboard states and mouse states are updated.
If any related callback functions are registered, these are called during
the call of pollEvents.
|
|
|
Wait for events, such as user input and window events. The calling thread
will be put to sleep until any event appears in the event queue.
When events are ready, the events will be processed just as they are
processed by pollEvents.
|
|
|
Return a KeyButtonState, either Release or Press, of the indicated
key.
|
|
|
Return a KeyButtonState, either Release or Press, of the indicated
mouse button.
|
|
|
Set or get the mouse position.
|
|
|
Set or get the mouse wheel position.
|
|
|
Get a certain number of axis positions for the given joystick. If the
number of positions requested is is greater than the number available, the
unavailable positions will be 0.
|
|
|
Get joystick positions. The returned list contains the positions
for all available axes for the given joystick.
|
|
|
Get joystick button states. The returned list contains the states
for all available buttons for the given joystick.
|
|
Callbacks
|
|
Window callbacks
|
|
|
Set the function that will be called every time the window size changes.
|
|
|
Set the function that will be called when the window is closed.
|
|
|
Set the function that will be called when the window client area needs to
be refreshed, which occurs when any part of the window client area is
damaged and needs to be repainted (for instance, if a part of the window
that was previously occluded by another window has become visible).
|
|
Event callbacks
|
|
|
Set the function that will be called when there is a key event, i.e.,
every time the state of a single key is changed. The reported keys are
unaffected by any modifiers (such as SHIFT or ALT).
|
|
|
Set the function that will be called when there is a character event,
i.e., every time a key that results in a printable Unicode character is
pressed or released. Characters are affected by modifiers (such as SHIFT
or ALT).
|
|
|
Set the function that will be called when there is a mouse button event,
i.e., every time a mouse button is pressed or released.
|
|
|
Set the function that will be called when there is a mouse motion event,
i.e., every time they mouse is moved.
|
|
|
Set the function that will be called when there is a mouse wheel event,
i.e., every time the mouse wheel is turned.
|
|
Other
|
|
|
Get or set the value of the high precision timer. The time is measured in
seconds as a double precision floating point number.
Unless the timer has been set by the programmer, the time is measured as
the number of seconds that have passed since initialize was called.
|
|
|
Put the calling thread to sleep for the requested period of time in
seconds.
The minimum amount of time it is possible to sleep is generally in the
range 1ms to 20ms.
|
|
|
Return True if the extension is supported, False otherwise.
|
|
|
Enable a SpecialFeature.
|
|
|
Disable a SpecialFeature.
|
|
Texture loading
|
|
|
Read an image from a file specified by the given string and upload the
image to OpenGL texture memory.
If BuildMipMaps flag is given, all mipmap levels for the loaded texture
are generated and uploaded to texture memory.
Unless the OriginUL flag is given, the origin of the texture is the lower
left corner of the loaded image. If OriginUL is given, however, the first
pixel is the upper left corner.
For single component images (i.e. gray scale), the texture is uploaded as
an alpha mask if the flag AlphaMap is set, otherwise it's uploaded as a
luminance texture.
It only supports the Truevision Targa verson 1 file (.tga). Supported
pixel formats are: 8-bit gray scale, 8-bit paletted (24/32-bit color),
24-bit true color and 32-bit true color + alpha.
Paletted images are translated into true color or true color + alpha pixel
formats.
The read texture is always rescaled to the nearest larger 2^m x 2^n
resolution using bilinear interpolation if necessary.
|
|
|
Read an image from the memory buffer (the given byte string) and
upload the image to OpenGL texture memory. The rest is similar
to loadTexture2D.
|
|
Text rendering
|
|
|
Render a text string using the given BitmapFont. Text is rendered
through texture, and is only possible with alpha enabled.
|
|
GLFW thread support functions purposefully omitted
|
|
Produced by Haddock version 2.6.0 |