HOpenGL Libraries (GLUT package)ParentContentsIndex
Graphics.UI.GLUT.State
Portability portable
Stability experimental
Maintainer sven_panne@yahoo.com
Contents
Type synonyms
Initial window parameters
State of the current window
Miscellaneous
GLUT state pertaining to the layers of the current window
Device information
Screen information
Keyboard information
Mouse information
Spaceball information
Dial and button box information
Tablet information
Joystick information
Description
GLUT maintains a considerable amount of programmer visible state. Some (but not all) of this state may be directly retrieved.
Synopsis
type NumChildren = CInt
type NumSamples = CInt
type NumBits = CInt
type NumButtons = CInt
type NumDials = CInt
type NumAxes = CInt
type PollRate = CInt
getInitWindowPosition :: IO WindowPosition
getInitWindowSize :: IO WindowSize
getInitDisplayMode :: IO [DisplayMode]
isDisplayModePossible :: IO Bool
getWindowPosition :: IO WindowPosition
getWindowSize :: IO WindowSize
getParent :: IO (Maybe Window)
getNumChildren :: IO NumChildren
getCursor :: IO Cursor
isRGBA :: IO Bool
getNumColorBits :: IO (NumBits, NumBits, NumBits, NumBits)
getNumBufferBits :: IO NumBits
getNumColormapEntries :: IO (ColorIndex CInt)
isDoubleBuffered :: IO Bool
isStereo :: IO Bool
getNumAccumBits :: IO (NumBits, NumBits, NumBits, NumBits)
getNumDepthBits :: IO NumBits
getNumStencilBits :: IO NumBits
getNumSamples :: IO NumSamples
getFormatID :: IO CInt
getElapsedTime :: IO CInt
getNumMenuItems :: IO CInt
isOverlayPossible :: IO Bool
getLayerInUse :: IO Layer
isOverlayEstablished :: IO Bool
getTransparentIndex :: IO (Maybe (ColorIndex CInt))
isNormalDamaged :: IO Bool
isOverlayDamaged :: IO (Maybe Bool)
data ScreenInfo = ScreenInfo WindowSize WindowSize
getScreenInfo :: IO ScreenInfo
data GlobalKeyRepeat
= GlobalKeyRepeatOff
| GlobalKeyRepeatOn
| GlobalKeyRepeatDefault
marshalGlobalKeyRepeat :: GlobalKeyRepeat -> CInt
data PerWindowKeyRepeat
= PerWindowKeyRepeatOff
| PerWindowKeyRepeatOn
marshalPerWindowKeyRepeat :: PerWindowKeyRepeat -> CInt
data KeyboardInfo = KeyboardInfo GlobalKeyRepeat PerWindowKeyRepeat
getKeyboardInfo :: IO (Maybe KeyboardInfo)
newtype MouseInfo = MouseInfo NumButtons
getMouseInfo :: IO (Maybe MouseInfo)
newtype SpaceballInfo = SpaceballInfo NumButtons
getSpaceballInfo :: IO (Maybe SpaceballInfo)
data DialAndButtonBoxInfo = DialAndButtonBoxInfo NumButtons NumDials
getDialAndButtonBoxInfo :: IO (Maybe DialAndButtonBoxInfo)
newtype TabletInfo = TabletInfo NumButtons
getTabletInfo :: IO (Maybe TabletInfo)
data JoystickInfo = JoystickInfo NumButtons PollRate NumAxes
getJoystickInfo :: IO (Maybe JoystickInfo)
Type synonyms
type NumChildren = CInt
Number of children of a window
type NumSamples = CInt
Number of samples for multisampling
type NumBits = CInt
Bit depth of a buffer
type NumButtons = CInt
Number of buttons of an input device
type NumDials = CInt
Number of dials of a dial and button box
type NumAxes = CInt
Number of axes of a joystick
type PollRate = CInt
The a rate at which a joystick is polled (in milliseconds)
Initial window parameters
getInitWindowPosition :: IO WindowPosition
Return the initial window position.
getInitWindowSize :: IO WindowSize
Return the initial window size.
getInitDisplayMode :: IO [DisplayMode]
Return the initial display mode.
isDisplayModePossible :: IO Bool
Test whether the current display mode is supported or not.
State of the current window
getWindowPosition :: IO WindowPosition
Return the location of the current window, measured in pixels relative to the screen origin.
getWindowSize :: IO WindowSize
Return the size of the current window, measured in pixels.
getParent :: IO (Maybe Window)
Return Just the current window's parent or Nothing if the current window is a top-level window.
getNumChildren :: IO NumChildren
Return the number of subwindows the current window has, not counting children of children.
getCursor :: IO Cursor
Return the current cursor for the current window.
isRGBA :: IO Bool
Test whether the current layer of the current window is in RGBA mode. False means color index mode.
getNumColorBits :: IO (NumBits, NumBits, NumBits, NumBits)
Return the number of red, green, blue, and alpha bits in the color buffer of the current window's current layer (0 in color index mode).
getNumBufferBits :: IO NumBits
Return the total number of bits in the color buffer of the current window's current layer. For an RGBA layer, this is the sum of the red, green, blue, and alpha bits. For an color index layer, this is the number of bits of the color indexes.
getNumColormapEntries :: IO (ColorIndex CInt)
Return the number of entries in the colormap of the current window's current layer (0 in RGBA mode).
isDoubleBuffered :: IO Bool
Test whether the current layer of the current window is double buffered.
isStereo :: IO Bool
Test whether the current layer of the current window is stereo.
getNumAccumBits :: IO (NumBits, NumBits, NumBits, NumBits)
Return the number of red, green, blue, and alpha bits in the accumulation buffer of the current window's current layer (0 in color index mode).
getNumDepthBits :: IO NumBits
Return the number of bits in the depth buffer of the current window's current layer.
getNumStencilBits :: IO NumBits
Return the number of bits in the stencil buffer of the current window's current layer.
getNumSamples :: IO NumSamples
Return the number of samples for multisampling for the current window.
getFormatID :: IO CInt
Return the window system dependent format ID for the current layer of the current window. On X11 GLUT implementations, this is the X visual ID. On Win32 GLUT implementations, this is the Win32 Pixel Format Descriptor number. This value is returned for debugging, benchmarking, and testing ease.
Miscellaneous
getElapsedTime :: IO CInt
Return the number of milliseconds since init was called (or first call to getElapsedTime).
getNumMenuItems :: IO CInt
Return the number of menu items in the current menu.
GLUT state pertaining to the layers of the current window
isOverlayPossible :: IO Bool
Test whether an overlay could be established for the current window given the current initial display mode. If False, establishOverlay will fail with a fatal error if called.
getLayerInUse :: IO Layer
Return the layer in use of the current window (normal plane or overlay).
isOverlayEstablished :: IO Bool
Test if the current window has an overlay established.
getTransparentIndex :: IO (Maybe (ColorIndex CInt))
Return Just the transparent color index of the overlay of the current window; Nothing is returned if no overlay is in use.
isNormalDamaged :: IO Bool
Test if the normal plane of the current window has been damaged (by window system activity) since the last display callback was triggered. Calling postRedisplay will not set this True.
isOverlayDamaged :: IO (Maybe Bool)
Test if the overlay plane of the current window has been damaged (by window system activity) since the last display callback was triggered. Calling postRedisplay or postOverlayRedisplay will not set this True. Return Nothing if no overlay is in use.
Device information
If a device is not available, the following routines return Nothing, otherwise they return Just the specific device information.
Screen information
data ScreenInfo
The size of the screen in pixels and millimeters
Constructors
ScreenInfo WindowSize WindowSize
getScreenInfo :: IO ScreenInfo
Note: A screen is always assumed, so there is no Maybe here.
Keyboard information
data GlobalKeyRepeat
Constructors
GlobalKeyRepeatOff
GlobalKeyRepeatOn
GlobalKeyRepeatDefault
Instances
Eq GlobalKeyRepeat
Ord GlobalKeyRepeat
marshalGlobalKeyRepeat :: GlobalKeyRepeat -> CInt
data PerWindowKeyRepeat
Constructors
PerWindowKeyRepeatOff
PerWindowKeyRepeatOn
Instances
Eq PerWindowKeyRepeat
Ord PerWindowKeyRepeat
marshalPerWindowKeyRepeat :: PerWindowKeyRepeat -> CInt
data KeyboardInfo
Constructors
KeyboardInfo GlobalKeyRepeat PerWindowKeyRepeat
Instances
Eq KeyboardInfo
Ord KeyboardInfo
getKeyboardInfo :: IO (Maybe KeyboardInfo)
Mouse information
newtype MouseInfo
Constructors
MouseInfo NumButtons
Instances
Eq MouseInfo
Ord MouseInfo
getMouseInfo :: IO (Maybe MouseInfo)
Spaceball information
newtype SpaceballInfo
Constructors
SpaceballInfo NumButtons
Instances
Eq SpaceballInfo
Ord SpaceballInfo
getSpaceballInfo :: IO (Maybe SpaceballInfo)
Dial and button box information
data DialAndButtonBoxInfo
Constructors
DialAndButtonBoxInfo NumButtons NumDials
Instances
Eq DialAndButtonBoxInfo
Ord DialAndButtonBoxInfo
getDialAndButtonBoxInfo :: IO (Maybe DialAndButtonBoxInfo)
Tablet information
newtype TabletInfo
Constructors
TabletInfo NumButtons
Instances
Eq TabletInfo
Ord TabletInfo
getTabletInfo :: IO (Maybe TabletInfo)
Joystick information
data JoystickInfo
Constructors
JoystickInfo NumButtons PollRate NumAxes
Instances
Eq JoystickInfo
Ord JoystickInfo
getJoystickInfo :: IO (Maybe JoystickInfo)
Produced by Haddock version 0.5