-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | A binding for the OpenGL Utility Toolkit -- -- A Haskell binding for the OpenGL Utility Toolkit, a window system -- independent toolkit for writing OpenGL programs. For more information -- about the C library on which this binding is based, please see: -- http://www.opengl.org/resources/libraries/glut/. @package GLUT @version 2.7.0.12 -- | GLUT supports two types of windows: top-level windows and subwindows. -- Both types support OpenGL rendering and GLUT callbacks. There is a -- single identifier space for both types of windows. module Graphics.UI.GLUT.Window -- | An opaque identifier for a top-level window or a subwindow. data Window -- | Create a top-level window. The given name will be provided to the -- window system as the window's name. The intent is that the window -- system will label the window with the name.Implicitly, the current -- window is set to the newly created window. -- -- X Implementation Notes: The proper X Inter-Client Communication -- Conventions Manual (ICCCM) top-level properties are established. The -- WM_COMMAND property that lists the command line used to -- invoke the GLUT program is only established for the first window -- created. createWindow :: MonadIO m => String -> m Window -- | Create a subwindow of the identified window with the given relative -- position and size. Implicitly, the current window is set to the -- newly created subwindow. Subwindows can be nested arbitrarily deep. createSubWindow :: MonadIO m => Window -> Position -> Size -> m Window -- | Destroy the specified window and the window's associated OpenGL -- context, logical colormap (if the window is color index), and overlay -- and related state (if an overlay has been established). Any subwindows -- of the destroyed window are also destroyed by destroyWindow. If -- the specified window was the current window, the current -- window becomes invalid (currentWindow will contain -- Nothing). destroyWindow :: MonadIO m => Window -> m () -- | Contains the current window's parent. If the current -- window is a top-level window, Nothing is returned. parentWindow :: GettableStateVar (Maybe Window) -- | Contains the number of subwindows the current window has, not -- counting children of children. numSubWindows :: GettableStateVar Int -- | Controls the current window. It does not affect the -- layer in use for the window; this is done using -- layerInUse. Contains Nothing if no windows exist or the -- previously current window was destroyed. Setting the current -- window to Nothing is a no-op. currentWindow :: StateVar (Maybe Window) -- | Mark the normal plane of given window (or the current window, -- if none is supplied) as needing to be redisplayed. The next iteration -- through mainLoop, the window's display callback will be called -- to redisplay the window's normal plane. Multiple calls to -- postRedisplay before the next display callback opportunity -- generates only a single redisplay callback. postRedisplay may -- be called within a window's display or overlay display callback to -- re-mark that window for redisplay. -- -- Logically, normal plane damage notification for a window is treated as -- a postRedisplay on the damaged window. Unlike damage reported -- by the window system, postRedisplay will not set to true -- the normal plane's damaged status (see damaged). -- -- Also, see postOverlayRedisplay. postRedisplay :: MonadIO m => Maybe Window -> m () -- | Mark the normal plane of the given window as needing to be -- redisplayed, otherwise the same as postRedisplay. -- -- The advantage of this routine is that it saves the cost of using -- currentWindow (entailing an expensive OpenGL context switch), -- which is particularly useful when multiple windows need redisplays -- posted at the same time. -- -- Perform a buffer swap on the layer in use for the current -- window. Specifically, swapBuffers promotes the contents of -- the back buffer of the layer in use of the current -- window to become the contents of the front buffer. The contents of -- the back buffer then become undefined. The update typically takes -- place during the vertical retrace of the monitor, rather than -- immediately after swapBuffers is called. -- -- An implicit flush is done by swapBuffers before it -- returns. Subsequent OpenGL commands can be issued immediately after -- calling swapBuffers, but are not executed until the buffer -- exchange is completed. -- -- If the layer in use is not double buffered, swapBuffers -- has no effect. swapBuffers :: MonadIO m => m () -- | Controls the position of the current window. For top-level -- windows, parameters of Position are pixel offsets from the -- screen origin. For subwindows, the parameters are pixel offsets from -- the window's parent window origin. -- -- In the case of top-level windows, setting windowPosition is -- considered only a request for positioning the window. The window -- system is free to apply its own policies to top-level window -- placement. The intent is that top-level windows should be repositioned -- according to the value of windowPosition. windowPosition :: StateVar Position -- | Controls the size of the current window. The parameters of -- Size are size extents in pixels. The width and height must be -- positive values. -- -- In the case of top-level windows, setting windowSize is -- considered only a request for sizing the window. The window system is -- free to apply its own policies to top-level window sizing. The intent -- is that top-level windows should be reshaped according to the value of -- windowSize. Whether a reshape actually takes effect and, if so, -- the reshaped dimensions are reported to the program by a reshape -- callback. windowSize :: StateVar Size -- | Request that the current window be made full screen. The exact -- semantics of what full screen means may vary by window system. The -- intent is to make the window as large as possible and disable any -- window decorations or borders added the window system. The window -- width and height are not guaranteed to be the same as the screen width -- and height, but that is the intent of making a window full screen. -- -- fullScreen is defined to work only on top-level windows. -- -- X Implementation Notes: In the X implementation of GLUT, full -- screen is implemented by sizing and positioning the window to cover -- the entire screen and posting the _MOTIF_WM_HINTS property on -- the window requesting absolutely no decorations. Non-Motif window -- managers may not respond to _MOTIF_WM_HINTS. fullScreen :: MonadIO m => m () -- | (freeglut only) Toggle between windowed and full screen mode. fullScreenToggle :: MonadIO m => m () -- | (freeglut only) If we are in full screen mode, resize the -- current window back to its original size. leaveFullScreen :: MonadIO m => m () -- | Change the stacking order of the current window relative to its -- siblings (lowering it). pushWindow :: MonadIO m => m () -- | Change the stacking order of the current window relative to its -- siblings, bringing the current window closer to the top. popWindow :: MonadIO m => m () -- | The display status of a window. data WindowStatus Shown :: WindowStatus Hidden :: WindowStatus Iconified :: WindowStatus -- | Controls the display status of the current window. -- -- Note that the effect of showing, hiding, and iconifying windows does -- not take place immediately. Instead the requests are saved for -- execution upon return to the GLUT event loop. Subsequent show, hide, -- or iconification requests on a window replace the previously saved -- request for that window. The effect of hiding, showing, or iconifying -- top-level windows is subject to the window system's policy for -- displaying windows. Subwindows can't be iconified. windowStatus :: SettableStateVar WindowStatus -- | Controls the window title of the current top-level window. windowTitle :: SettableStateVar String -- | Controls the icon title of the current top-level window. iconTitle :: SettableStateVar String -- | The different cursor images GLUT supports. data Cursor -- | Arrow pointing up and to the right. RightArrow :: Cursor -- | Arrow pointing up and to the left. LeftArrow :: Cursor -- | Pointing hand. Info :: Cursor -- | Skull & cross bones. Destroy :: Cursor -- | Question mark. Help :: Cursor -- | Arrows rotating in a circle. Cycle :: Cursor -- | Spray can. Spray :: Cursor -- | Wrist watch. Wait :: Cursor -- | Insertion point cursor for text. Text :: Cursor -- | Simple cross-hair. Crosshair :: Cursor -- | Bi-directional pointing up & down. UpDown :: Cursor -- | Bi-directional pointing left & right. LeftRight :: Cursor -- | Arrow pointing to top side. TopSide :: Cursor -- | Arrow pointing to bottom side. BottomSide :: Cursor -- | Arrow pointing to left side. LeftSide :: Cursor -- | Arrow pointing to right side. RightSide :: Cursor -- | Arrow pointing to top-left corner. TopLeftCorner :: Cursor -- | Arrow pointing to top-right corner. TopRightCorner :: Cursor -- | Arrow pointing to bottom-left corner. BottomRightCorner :: Cursor -- | Arrow pointing to bottom-right corner. BottomLeftCorner :: Cursor -- | Use parent's cursor. Inherit :: Cursor -- | Invisible cursor. None :: Cursor -- | Full-screen cross-hair cursor (if possible, otherwise -- Crosshair). FullCrosshair :: Cursor -- | Change the cursor image of the current window. Each call -- requests the window system change the cursor appropriately. The cursor -- image when a window is created is Inherit. The exact cursor -- images used are implementation dependent. The intent is for the image -- to convey the meaning of the cursor name. For a top-level window, -- Inherit uses the default window system cursor. -- -- X Implementation Notes: GLUT for X uses SGI's -- _SGI_CROSSHAIR_CURSOR convention to access a full-screen -- cross-hair cursor if possible. cursor :: StateVar Cursor -- | Setting pointerPosition warps the window system's pointer to a -- new location relative to the origin of the current window by -- the specified pixel offset, which may be negative. The warp is done -- immediately. -- -- If the pointer would be warped outside the screen's frame buffer -- region, the location will be clamped to the nearest screen edge. The -- window system is allowed to further constrain the pointer's location -- in window system dependent ways. -- -- Good advice from Xlib's XWarpPointer man page: "There is -- seldom any reason for calling this function. The pointer should -- normally be left to the user." pointerPosition :: SettableStateVar Position instance GHC.Show.Show Graphics.UI.GLUT.Window.Cursor instance GHC.Classes.Ord Graphics.UI.GLUT.Window.Cursor instance GHC.Classes.Eq Graphics.UI.GLUT.Window.Cursor instance GHC.Show.Show Graphics.UI.GLUT.Window.WindowStatus instance GHC.Classes.Ord Graphics.UI.GLUT.Window.WindowStatus instance GHC.Classes.Eq Graphics.UI.GLUT.Window.WindowStatus -- | When overlay hardware is available, GLUT provides a set of routines -- for establishing, using, and removing an overlay for GLUT windows. -- When an overlay is established, a separate OpenGL context is also -- established. A window's overlay OpenGL state is kept distinct from the -- normal planes' OpenGL state. module Graphics.UI.GLUT.Overlay -- | Controls the overlay for the current window. The requested -- display mode for the overlay is determined by the initial display -- mode. overlayPossible can be used to determine if an -- overlay is possible for the current window with the current -- initial display mode. Do not attempt to establish an overlay -- when one is not possible; GLUT will terminate the program. -- -- When hasOverlay is set to True when an overlay already -- exists, the existing overlay is first removed, and then a new overlay -- is established. The state of the old overlay's OpenGL context is -- discarded. Implicitly, the window's layer in use changes to the -- overlay immediately after the overlay is established. -- -- The initial display state of an overlay is shown, however the overlay -- is only actually shown if the overlay's window is shown. -- -- Setting hasOverlay to False is safe even if no overlay -- is currently established, nothing happens in this case. Implicitly, -- the window's /layer in use/ changes to the normal plane immediately -- once the overlay is removed. -- -- If the program intends to re-establish the overlay later, it is -- typically faster and less resource intensive to use -- overlayVisible to simply change the display status of the -- overlay. -- -- X Implementation Notes: GLUT for X uses the -- SERVER_OVERLAY_VISUALS convention to determine if overlay -- visuals are available. While the convention allows for opaque overlays -- (no transparency) and overlays with the transparency specified as a -- bitmask, GLUT overlay management only provides access to transparent -- pixel overlays. -- -- Until RGBA overlays are better understood, GLUT only supports color -- index overlays. hasOverlay :: StateVar Bool -- | Contains True if an overlay could be established for the -- current window given the current initial display mode. -- If it contains False, setting hasOverlay will fail with -- a fatal error. overlayPossible :: GettableStateVar Bool -- | Controls the visibility of the overlay of the current window. -- -- The effect of showing or hiding an overlay takes place immediately. -- Note that setting overlayVisible to True will not -- actually display the overlay unless the window is also shown (and even -- a shown window may be obscured by other windows, thereby obscuring the -- overlay). It is typically faster and less resource intensive to use -- the routines below to control the display status of an overlay as -- opposed to removing and re-establishing the overlay. overlayVisible :: SettableStateVar Bool -- | The layer in use. data Layer -- | The normal plane. Normal :: Layer -- | The overlay. Overlay :: Layer -- | Controls the per-window layer in use for the current -- window, which can either be the normal plane or the overlay. -- Selecting the overlay should only be done if an overlay exists, -- however windows without an overlay may still set the layer in -- use to Normal. OpenGL commands for the window are directed -- to the current layer in use. layerInUse :: StateVar Layer -- | Mark the overlay of the given window (or the current window, if -- none is supplied) as needing to be redisplayed. The next iteration -- through mainLoop, the window's overlay display callback (or -- simply the display callback if no overlay display callback is -- registered) will be called to redisplay the window's overlay plane. -- Multiple calls to postOverlayRedisplay before the next display -- callback opportunity (or overlay display callback opportunity if one -- is registered) generate only a single redisplay. -- postOverlayRedisplay may be called within a window's display or -- overlay display callback to re-mark that window for redisplay. -- -- Logically, overlay damage notification for a window is treated as a -- postOverlayRedisplay on the damaged window. Unlike damage -- reported by the window system, postOverlayRedisplay will not -- set to true the overlay's damaged status (see damaged). -- -- Also, see postRedisplay. postOverlayRedisplay :: MonadIO m => Maybe Window -> m () instance GHC.Show.Show Graphics.UI.GLUT.Overlay.Layer instance GHC.Classes.Ord Graphics.UI.GLUT.Overlay.Layer instance GHC.Classes.Eq Graphics.UI.GLUT.Overlay.Layer -- | GLUT maintains a considerable amount of programmer visible state. Some -- (but not all) of this state may be directly retrieved. module Graphics.UI.GLUT.State -- | (freeglut only) Contains the thickness of the sizing border -- around the perimeter of a window that can be resized, in pixels. windowBorderWidth :: GettableStateVar Int -- | (freeglut only) Contains the height of the header/caption area -- of a window in pixels. windowHeaderHeight :: GettableStateVar Int -- | (freeglut on X11 only) Controls if all but the last motion -- event should be discarded. skipStaleMotionEvents :: StateVar Bool -- | Contains True when the current layer of the current -- window is in RGBA mode, False means color index mode. rgba :: GettableStateVar Bool -- | Bit depth of a buffer type BufferDepth = Int -- | Contains 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). rgbaBufferDepths :: GettableStateVar (BufferDepth, BufferDepth, BufferDepth, BufferDepth) -- | Contains 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. colorBufferDepth :: GettableStateVar BufferDepth -- | Contains True when the current layer of the current -- window is double buffered, False otherwise. doubleBuffered :: GettableStateVar Bool -- | Contains True when the current layer of the current -- window is stereo, False otherwise. stereo :: GettableStateVar Bool -- | Contains 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). accumBufferDepths :: GettableStateVar (BufferDepth, BufferDepth, BufferDepth, BufferDepth) -- | Contains the number of bits in the depth buffer of the current -- window's current layer. depthBufferDepth :: GettableStateVar BufferDepth -- | Contains the number of bits in the stencil buffer of the /current -- window's/ current layer. stencilBufferDepth :: GettableStateVar BufferDepth -- | Number of samples for multisampling type SampleCount = Int -- | Contains the number of samples for multisampling for the current -- window. sampleCount :: GettableStateVar SampleCount -- | Contains 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. formatID :: GettableStateVar Int -- | (freeglut only) Contains True if the current -- window is in full screen mode, False otherwise. fullScreenMode :: StateVar Bool -- | (freeglut only) Controls if vectors representing the normals -- should be drawn, too, when objects are drawn. geometryVisualizeNormals :: StateVar Bool -- | (freeglut only) If vertexAttribCoord3 and -- vertexAttribNormal both contain Nothing, the fixed -- function pipeline is used to draw objects. Otherwise VBOs are used and -- the coordinates are passed via Just this attribute location -- (for a vec3). vertexAttribCoord3 :: SettableStateVar (Maybe AttribLocation) -- | (freeglut only) If vertexAttribCoord3 and -- vertexAttribNormal both contain Nothing, the fixed -- function pipeline is used to draw objects. Otherwise VBOs are used and -- the normals are passed via Just this attribute location (for a -- vec3). vertexAttribNormal :: SettableStateVar (Maybe AttribLocation) -- | (freeglut only) If VBOs are used to draw objects (controlled -- via vertexAttribCoord3 and vertexAttribNormal), the -- texture coordinates are passed via Just this attribute location -- (for a vec2). vertexAttribTexCoord2 :: SettableStateVar (Maybe AttribLocation) -- | Contains True if the given 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. damaged :: Layer -> GettableStateVar Bool -- | Contains the number of milliseconds since initialize was -- called. elapsedTime :: GettableStateVar Int -- | The size of the screen in pixels. screenSize :: GettableStateVar Size -- | The size of the screen in millimeters. screenSizeMM :: GettableStateVar Size -- | Contains True if a keyboard is present, False otherwise. hasKeyboard :: GettableStateVar Bool -- | Number of buttons of an input device type ButtonCount = Int -- | Contains Just the number of buttons of an attached mouse or -- Nothing if there is none. numMouseButtons :: GettableStateVar (Maybe ButtonCount) -- | Contains Just the number of buttons of the attached Spaceball -- or Nothing if there is none. numSpaceballButtons :: GettableStateVar (Maybe ButtonCount) -- | Number of dials of a dial and button box type DialCount = Int -- | Contains Just the number of dials and buttons of an attached -- dial & button box or Nothing if there is none. numDialsAndButtons :: GettableStateVar (Maybe (DialCount, ButtonCount)) -- | Contains Just the number of buttons of an attached tablet or -- Nothing if there is none. numTabletButtons :: GettableStateVar (Maybe ButtonCount) -- | Number of axes of a joystick type AxisCount = Int -- | The a rate at which a joystick is polled (in milliseconds) type PollRate = Int -- | Contains Just the number of buttons of an attached joystick, -- the number of joystick axes, and the rate at which the joystick is -- polled. Contains Nothing if there is no joystick attached. joystickInfo :: GettableStateVar (Maybe (ButtonCount, PollRate, AxisCount)) -- | (freeglut only) Contains a list of the number of auxiliary -- buffers supported, in increasing order. supportedNumAuxBuffers :: GettableStateVar [Int] -- | (freeglut only) Contains a list of the number of samples per -- pixel supported for multisampling, in increasing order. supportedSamplesPerPixel :: GettableStateVar [SampleCount] -- | Contains version of GLUT in the form of flavour -- major.minor.patchlevel, where -- flavour is one of GLUT, freeglut or -- OpenGLUT. glutVersion :: GettableStateVar String -- | (freeglut only) Contains True if GLUT has been -- initialized with initialize or getArgsAndInitialize has -- and not yet been de-initialized with exit. Contains -- False otherwise. initState :: GettableStateVar Bool -- | GLUT includes a number of routines for generating easily recognizable -- 3D geometric objects. These routines reflect functionality available -- in the aux toolkit described in the OpenGL Programmer's -- Guide and are included in GLUT to allow the construction of simple -- GLUT programs that render recognizable objects. These routines can be -- implemented as pure OpenGL rendering routines. The routines do not -- generate display lists for the objects they create. The routines -- generate normals appropriate for lighting but do not generate texture -- coordinates (except for the solid teapot, teacup and teaspoon). If -- VBOs should be used instead of the fixed function pipeline, specify at -- least one of the attribute locations vertexAttribCoord3 or -- vertexAttribNormal. module Graphics.UI.GLUT.Objects -- | Flavour of object rendering data Flavour -- | Object is rendered as a solid with shading and surface normals. Solid :: Flavour -- | Object is rendered as a wireframe without surface normals. Wireframe :: Flavour -- | GLUT offers five types of objects: -- --
-- initialDisplayCapabilities $= [ With DisplayRGB, -- Where DisplayDepth IsAtLeast 16, -- With DisplaySamples, -- Where DisplayStencil IsNotLessThan 2, -- With DisplayDouble ] ---- -- The above call requests a window with an RGBA color model (but -- requesting no bits of alpha), a depth buffer with at least 16 bits of -- precision but preferring more, multisampling if available, at least 2 -- bits of stencil (favoring less stencil to more as long as 2 bits are -- available), and double buffering. initialDisplayCapabilities :: SettableStateVar [DisplayCapabilityDescription] -- | How rendering context for new windows are created. data RenderingContext -- | Create a new context via glXCreateContext or -- wglCreateContext (default). CreateNewContext :: RenderingContext -- | Re-use the current rendering context. UseCurrentContext :: RenderingContext -- | (freeglut only) Controls the creation of rendering contexts for -- new windows. renderingContext :: StateVar RenderingContext -- | The kind of GLX rendering context used. Direct rendering provides a -- performance advantage in some implementations. However, direct -- rendering contexts cannot be shared outside a single process, and they -- may be unable to render to GLX pixmaps. data DirectRendering -- | Rendering is always done through the X server. This corresponds to the -- command line argument -indirect, see initialize. ForceIndirectContext :: DirectRendering -- | Try to use direct rendering, silently using indirect rendering if this -- is not possible. AllowDirectContext :: DirectRendering -- | Try to use direct rendering, issue a warning and use indirect -- rendering if this is not possible. TryDirectContext :: DirectRendering -- | Try to use direct rendering, issue an error and terminate the program -- if this is not possible.This corresponds to the command line argument -- -direct, see initialize. ForceDirectContext :: DirectRendering -- | (freeglut on X11 only) Controls which kind of rendering context -- is created when a new one is required. directRendering :: StateVar DirectRendering -- | (freeglut only) Controls the API major/minor version of the -- OpenGL context. If a version less than or equal to 2.1 is requested, -- the context returned may implement any version no less than that -- requested and no greater than 2.1. If version 3.0 is requested, the -- context returned must implement exactly version 3.0. Versioning -- behavior once GL versions beyond 3.0 are defined will be defined by an -- amendment to the OpenGL specification to define dependencies on such -- GL versions. -- -- glVersion and majorMinor will return the actual version -- supported by a context. -- -- The default context version is (1, 0), which will typically return an -- OpenGL 2.1 context, if one is available. initialContextVersion :: StateVar (Int, Int) -- | A flag affecting the rendering context to create, used in conjunction -- with initialContextFlags. data ContextFlag -- | Debug contexts are intended for use during application development, -- and provide additional runtime checking, validation, and logging -- functionality while possibly incurring performance penalties. The -- additional functionality provided by debug contexts may vary according -- to the implementation. In some cases a debug context may be identical -- to a non-debug context. DebugContext :: ContextFlag -- | Forward-compatible contexts are defined only for OpenGL versions 3.0 -- and later. They must not support functionality marked as -- deprecated by that version of the API, while a -- non-forward-compatible context must support all functionality in that -- version, deprecated or not. ForwardCompatibleContext :: ContextFlag -- | (freeglut only) Controls the set of flags for the rendering -- context. initialContextFlags :: StateVar [ContextFlag] -- | An OpenGL API profile, affecting the rendering context to create, used -- in conjunction with initialContextProfile. data ContextProfile -- | The OpenGL core profile, which all OpenGL 3.2 implementations -- are required to support. CoreProfile :: ContextProfile -- | The OpenGL compatibility profile, which is optional for OpenGL -- 3.2 implementations. CompatibilityProfile :: ContextProfile -- | (freeglut only) Controls the set of profiles for the rendering -- context. initialContextProfile :: StateVar [ContextProfile] instance GHC.Show.Show Graphics.UI.GLUT.Initialization.ContextProfile instance GHC.Classes.Ord Graphics.UI.GLUT.Initialization.ContextProfile instance GHC.Classes.Eq Graphics.UI.GLUT.Initialization.ContextProfile instance GHC.Show.Show Graphics.UI.GLUT.Initialization.ContextFlag instance GHC.Classes.Ord Graphics.UI.GLUT.Initialization.ContextFlag instance GHC.Classes.Eq Graphics.UI.GLUT.Initialization.ContextFlag instance GHC.Show.Show Graphics.UI.GLUT.Initialization.DirectRendering instance GHC.Classes.Ord Graphics.UI.GLUT.Initialization.DirectRendering instance GHC.Classes.Eq Graphics.UI.GLUT.Initialization.DirectRendering instance GHC.Show.Show Graphics.UI.GLUT.Initialization.RenderingContext instance GHC.Classes.Ord Graphics.UI.GLUT.Initialization.RenderingContext instance GHC.Classes.Eq Graphics.UI.GLUT.Initialization.RenderingContext instance GHC.Show.Show Graphics.UI.GLUT.Initialization.DisplayCapabilityDescription instance GHC.Classes.Ord Graphics.UI.GLUT.Initialization.DisplayCapabilityDescription instance GHC.Classes.Eq Graphics.UI.GLUT.Initialization.DisplayCapabilityDescription instance GHC.Show.Show Graphics.UI.GLUT.Initialization.DisplayCapability instance GHC.Classes.Ord Graphics.UI.GLUT.Initialization.DisplayCapability instance GHC.Classes.Eq Graphics.UI.GLUT.Initialization.DisplayCapability instance GHC.Show.Show Graphics.UI.GLUT.Initialization.DisplayMode instance GHC.Classes.Ord Graphics.UI.GLUT.Initialization.DisplayMode instance GHC.Classes.Eq Graphics.UI.GLUT.Initialization.DisplayMode -- | In addition to the functionality offered by fullScreen, GLUT -- offers an sub-API to change the screen resolution, color depth, and -- refresh rate of the display for a single full screen window. This mode -- of operation is called game mode, and is restricted in various -- ways: No pop-up menus are allowed for this full screen window, no -- other (sub-)windows can be created, and all other applications are -- hidden. -- -- X Implementation Notes: Note that game mode is not fully -- supported in the original GLUT for X, it is essentially the same as -- using fullScreen. The GLUT clone freeglut (see -- http://freeglut.sourceforge.net/) does not have this -- restriction. module Graphics.UI.GLUT.GameMode -- | Capabilities for gameModeCapabilities data GameModeCapability -- | Width of the screen resolution in pixels GameModeWidth :: GameModeCapability -- | Height of the screen resolution in pixels GameModeHeight :: GameModeCapability -- | Color depth of the screen in bits GameModeBitsPerPlane :: GameModeCapability -- | Refresh rate in Hertz GameModeRefreshRate :: GameModeCapability -- | Match the Nth frame buffer configuration compatible with the given -- capabilities (numbering starts at 1) GameModeNum :: GameModeCapability -- | A single capability description for gameModeCapabilities. data GameModeCapabilityDescription Where' :: GameModeCapability -> Relation -> Int -> GameModeCapabilityDescription -- | Controls the game mode to be used when enterGameMode is -- called. It is described by a list of zero or more capability -- descriptions, which are translated into a set of criteria used to -- select the appropriate screen configuration. The criteria are matched -- in strict left to right order of precdence. That is, the first -- specified criterion (leftmost) takes precedence over the later -- criteria for non-exact criteria (IsGreaterThan, -- IsLessThan, etc.). Exact criteria (IsEqualTo, -- IsNotEqualTo) must match exactly so precedence is not relevant. -- -- To determine which configuration will actually be tried by -- enterGameMode (if any), use gameModeInfo. -- -- Note that even for game mode the current values of -- initialDisplayModeor initialDisplayCapabilities will -- determine which buffers are available, if double buffering is used or -- not, etc. gameModeCapabilities :: SettableStateVar [GameModeCapabilityDescription] -- | Enter game mode, trying to change resolution, refresh rate, -- etc., as specified by the current value of -- gameModeCapabilities. An identifier for the game mode window -- and a flag, indicating if the display mode actually changed, are -- returned. The game mode window is made the current window. -- -- Re-entering game mode is allowed, the previous game mode window -- gets destroyed by this, and a new one is created. enterGameMode :: MonadIO m => m (Window, Bool) -- | Leave game mode, restoring the old display mode and destroying -- the game mode window. leaveGameMode :: MonadIO m => m () -- | The color depth of the screen, measured in bits (e.g. 8, 16, 24, 32, -- ...) type BitsPerPlane = Int -- | The refresh rate of the screen, measured in Hertz (e.g. 60, 75, 100, -- ...) type RefreshRate = Int data GameModeInfo GameModeInfo :: Size -> BitsPerPlane -> RefreshRate -> GameModeInfo -- | Return Just the mode which would be tried by the next call to -- enterGameMode. Returns Nothing if the mode requested by -- the current value of gameModeCapabilities is not possible, in -- which case enterGameMode would simply create a full screen -- window using the current mode. gameModeInfo :: GettableStateVar (Maybe GameModeInfo) -- | Contains True when the game mode is active, False -- otherwise. gameModeActive :: GettableStateVar Bool instance GHC.Show.Show Graphics.UI.GLUT.GameMode.GameModeInfo instance GHC.Classes.Ord Graphics.UI.GLUT.GameMode.GameModeInfo instance GHC.Classes.Eq Graphics.UI.GLUT.GameMode.GameModeInfo instance GHC.Show.Show Graphics.UI.GLUT.GameMode.GameModeCapabilityDescription instance GHC.Classes.Ord Graphics.UI.GLUT.GameMode.GameModeCapabilityDescription instance GHC.Classes.Eq Graphics.UI.GLUT.GameMode.GameModeCapabilityDescription instance GHC.Show.Show Graphics.UI.GLUT.GameMode.GameModeCapability instance GHC.Classes.Ord Graphics.UI.GLUT.GameMode.GameModeCapability instance GHC.Classes.Eq Graphics.UI.GLUT.GameMode.GameModeCapability -- | GLUT supports two types of font rendering: stroke fonts, meaning each -- character is rendered as a set of line segments; and bitmap fonts, -- where each character is a bitmap generated with bitmap. Stroke -- fonts have the advantage that because they are geometry, they can be -- arbitrarily scale and rendered. Bitmap fonts are less flexible since -- they are rendered as bitmaps but are usually faster than stroke fonts. module Graphics.UI.GLUT.Fonts class Font a -- | Render the string in the named font, without using any display lists. -- Rendering a nonexistent character has no effect. -- -- If the font is a bitmap font, renderString automatically sets -- the OpenGL unpack pixel storage modes it needs appropriately and saves -- and restores the previous modes before returning. The generated call -- to bitmap will adjust the current raster position based on the -- width of the string. If the font is a stroke font, translate is -- used to translate the current model view matrix to advance the width -- of the string. renderString :: (Font a, MonadIO m) => a -> String -> m () -- | For a bitmap font, return the width in pixels of a string. For a -- stroke font, return the width in units. While the width of characters -- in a font may vary (though fixed width fonts do not vary), the maximum -- height characteristics of a particular font are fixed. stringWidth :: (Font a, MonadIO m) => a -> String -> m GLint -- | (freeglut only) For a bitmap font, return the maximum height of -- the characters in the given font measured in pixels. For a stroke -- font, return the width in units. fontHeight :: (Font a, MonadIO m) => a -> m GLfloat -- | The bitmap fonts available in GLUT. The exact bitmap to be used is -- defined by the standard X glyph bitmaps for the X font with the given -- name. data BitmapFont -- | A fixed width font with every character fitting in an 8 by 13 pixel -- rectangle. -- (-misc-fixed-medium-r-normal--13-120-75-75-C-80-iso8859-1) Fixed8By13 :: BitmapFont -- | A fixed width font with every character fitting in an 9 by 15 pixel -- rectangle. -- (-misc-fixed-medium-r-normal--15-140-75-75-C-90-iso8859-1) Fixed9By15 :: BitmapFont -- | A 10-point proportional spaced Times Roman font. -- (-adobe-times-medium-r-normal--10-100-75-75-p-54-iso8859-1) TimesRoman10 :: BitmapFont -- | A 24-point proportional spaced Times Roman font. -- (-adobe-times-medium-r-normal--24-240-75-75-p-124-iso8859-1) TimesRoman24 :: BitmapFont -- | A 10-point proportional spaced Helvetica font. -- (-adobe-helvetica-medium-r-normal--10-100-75-75-p-56-iso8859-1) Helvetica10 :: BitmapFont -- | A 12-point proportional spaced Helvetica font. -- (-adobe-helvetica-medium-r-normal--12-120-75-75-p-67-iso8859-1) Helvetica12 :: BitmapFont -- | A 18-point proportional spaced Helvetica font. -- (-adobe-helvetica-medium-r-normal--18-180-75-75-p-98-iso8859-1) Helvetica18 :: BitmapFont -- | The stroke fonts available in GLUT. data StrokeFont -- | A proportionally spaced Roman Simplex font for ASCII characters 32 -- through 127. The maximum top character in the font is 119.05 units; -- the bottom descends 33.33 units. Roman :: StrokeFont -- | A mono-spaced spaced Roman Simplex font (same characters as -- Roman) for ASCII characters 32 through 127. The maximum top -- character in the font is 119.05 units; the bottom descends 33.33 -- units. Each character is 104.76 units wide. MonoRoman :: StrokeFont instance Graphics.UI.GLUT.Fonts.Font Graphics.UI.GLUT.Raw.Fonts.BitmapFont instance Graphics.UI.GLUT.Fonts.Font Graphics.UI.GLUT.Raw.Fonts.StrokeFont -- | GLUT offers some routines for controlling the key repeat and polling -- the joystick. module Graphics.UI.GLUT.DeviceControl -- | The state of the global key repeat data GlobalKeyRepeat GlobalKeyRepeatOff :: GlobalKeyRepeat GlobalKeyRepeatOn :: GlobalKeyRepeat GlobalKeyRepeatDefault :: GlobalKeyRepeat -- | Controls the key repeat mode for the window system on a global basis -- if possible. If supported by the window system, the key repeat can -- either be disabled, enabled, or set to the window system's default key -- repeat state. -- -- X Implementation Notes: X11 sends KeyPress events -- repeatedly when the window system's global auto repeat is enabled. -- perWindowKeyRepeat can prevent these auto repeated keystrokes -- from being reported as keyboard or special callbacks, but there is -- still some minimal overhead by the X server to continually stream -- KeyPress events to the GLUT application. The -- globalKeyRepeat state variable can be used to actually disable -- the global sending of auto repeated KeyPress events. Note -- that globalKeyRepeat affects the global window system auto -- repeat state so other applications will not auto repeat if you disable -- auto repeat globally through globalKeyRepeat. GLUT applications -- using the X11 GLUT implementation should disable key repeat with -- globalKeyRepeat to disable key repeats most efficiently, but -- are responsible for explicitly restoring the default key repeat state -- on exit. -- -- Win32 Implementation Notes: The Win32 implementation of -- globalKeyRepeat does nothing. The perWindowKeyRepeat can -- be used in the Win32 GLUT implementation to ignore repeated keys on a -- per-window basis without changing the global window system key repeat. globalKeyRepeat :: StateVar GlobalKeyRepeat -- | The state of the per-window key repeat data PerWindowKeyRepeat PerWindowKeyRepeatOff :: PerWindowKeyRepeat PerWindowKeyRepeatOn :: PerWindowKeyRepeat -- | Controls if auto repeat keystrokes are reported to the current -- window. Ignoring auto repeated keystrokes is generally done in -- conjunction with using the keyboardMouseCallback. If you do not -- ignore auto repeated keystrokes, your GLUT application will experience -- repeated release/press callbacks. Games using the keyboard will -- typically want to ignore key repeat. perWindowKeyRepeat :: StateVar PerWindowKeyRepeat -- | Execute the joystick callback set by joystickCallback once (if -- one exists). This is done in a synchronous fashion within the current -- context, i.e. when forceJoystickCallback returns, the callback -- will have already happened. forceJoystickCallback :: MonadIO m => m () instance GHC.Show.Show Graphics.UI.GLUT.DeviceControl.PerWindowKeyRepeat instance GHC.Classes.Ord Graphics.UI.GLUT.DeviceControl.PerWindowKeyRepeat instance GHC.Classes.Eq Graphics.UI.GLUT.DeviceControl.PerWindowKeyRepeat instance GHC.Show.Show Graphics.UI.GLUT.DeviceControl.GlobalKeyRepeat instance GHC.Classes.Ord Graphics.UI.GLUT.DeviceControl.GlobalKeyRepeat instance GHC.Classes.Eq Graphics.UI.GLUT.DeviceControl.GlobalKeyRepeat -- | This module contains a simple utility routine to report any pending GL -- errors. module Graphics.UI.GLUT.Debugging -- | Report any pending GL errors to stderr (which is typically the -- console). If there are no pending errors, this routine does nothing. -- Note that the error flags are reset after this action, i.e. there are -- no pending errors left afterwards. reportErrors :: MonadIO m => m () -- | OpenGL supports both RGBA and color index rendering. The RGBA mode is -- generally preferable to color index because more OpenGL rendering -- capabilities are available and color index mode requires the loading -- of colormap entries. -- -- The GLUT color index state variables are used to read and write -- entries in a window's color index colormap. Every GLUT color index -- window has its own logical color index colormap. The size of a -- window's colormap can be determined by reading -- numColorMapEntries. -- -- GLUT color index windows within a program can attempt to share -- colormap resources by copying a single color index colormap to -- multiple windows using copyColormap. If possible GLUT will -- attempt to share the actual colormap. While copying colormaps using -- copyColormap can potentially allow sharing of physical colormap -- resources, logically each window has its own colormap. So changing a -- copied colormap of a window will force the duplication of the -- colormap. For this reason, color index programs should generally load -- a single color index colormap, copy it to all color index windows -- within the program, and then not modify any colormap cells. -- -- Use of multiple colormaps is likely to result in colormap installation -- problems where some windows are displayed with an incorrect colormap -- due to limitations on colormap resources. module Graphics.UI.GLUT.Colormap -- | Controls the color index colormap entry of the current window's -- logical colormap for the layer in use. The layer in use -- of the current window should be a color index window. The color -- index should be zero or greater and less than the total number of -- colormap entries for the window (see numColorMapEntries) and -- different from an overlay's transparent index (see -- transparentIndex). -- -- If the layer in use's colormap was copied by reference, setting -- a colormap entry will force the duplication of the colormap. colorMapEntry :: Index1 GLint -> StateVar (Color3 GLfloat) -- | Copy (lazily if possible to promote sharing) the logical colormap from -- a specified window to the current window's layer in use. -- The copy will be from the normal plane to the normal plane; or from -- the overlay to the overlay (never across different layers). Once a -- colormap has been copied, avoid setting cells in the colormap via -- colorMapEntry since that will force an actual copy of the -- colormap if it was previously copied by reference. copyColormap -- should only be called when both the current window and the -- specified window are color index windows. copyColormap :: MonadIO m => Window -> m () -- | Contains the number of entries in the colormap of the current -- window's current layer (0 in RGBA mode). numColorMapEntries :: GettableStateVar GLint -- | Contains the transparent color index of the overlay of the current -- window or -1 if no overlay is in use. transparentIndex :: GettableStateVar (Index1 GLint) module Graphics.UI.GLUT.Callbacks.Window -- | A display callback type DisplayCallback = IO () -- | Controls the display callback for the current window. When GLUT -- determines that the normal plane for the window needs to be -- redisplayed, the display callback for the window is called. Before the -- callback, the current window is set to the window needing to be -- redisplayed and (if no overlay display callback is registered) the -- layer in use is set to the normal plane. The entire normal -- plane region should be redisplayed in response to the callback (this -- includes ancillary buffers if your program depends on their state). -- -- GLUT determines when the display callback should be triggered based on -- the window's redisplay state. The redisplay state for a window can be -- either set explicitly by calling postRedisplay or implicitly as -- the result of window damage reported by the window system. Multiple -- posted redisplays for a window are coalesced by GLUT to minimize the -- number of display callbacks called. -- -- When an overlay is established for a window, but there is no overlay -- display callback registered, the display callback is used for -- redisplaying both the overlay and normal plane (that is, it will be -- called if either the redisplay state or overlay redisplay state is -- set). In this case, the layer in use is not implicitly changed -- on entry to the display callback. -- -- See overlayDisplayCallback to understand how distinct callbacks -- for the overlay and normal plane of a window may be established. -- -- When a window is created, no display callback exists for the window. -- It is the responsibility of the programmer to install a display -- callback for the window before the window is shown. A display callback -- must be registered for any window that is shown. If a window becomes -- displayed without a display callback being registered, a fatal error -- occurs. There is no way to "deregister" a display callback (though -- another callback routine can always be registered). -- -- Upon return from the display callback, the normal damaged state of the -- window (see damaged) is cleared. If there is no overlay display -- callback registered the overlay damaged state of the window (see -- damaged) is also cleared. displayCallback :: SettableStateVar DisplayCallback -- | Controls the overlay display callback for the current window. -- The overlay display callback is functionally the same as the window's -- display callback except that the overlay display callback is used to -- redisplay the window's overlay. -- -- When GLUT determines that the overlay plane for the window needs to be -- redisplayed, the overlay display callback for the window is called. -- Before the callback, the current window is set to the window -- needing to be redisplayed and the layer in use is set to the -- overlay. The entire overlay region should be redisplayed in response -- to the callback (this includes ancillary buffers if your program -- depends on their state). -- -- GLUT determines when the overlay display callback should be triggered -- based on the window's overlay redisplay state. The overlay redisplay -- state for a window can be either set explicitly by calling -- postOverlayRedisplay or implicitly as the result of window -- damage reported by the window system. Multiple posted overlay -- redisplays for a window are coalesced by GLUT to minimize the number -- of overlay display callbacks called. -- -- Upon return from the overlay display callback, the overlay damaged -- state of the window (see damaged) is cleared. -- -- Initially there is no overlay display callback registered when an -- overlay is established. See displayCallback to understand how -- the display callback alone is used if an overlay display callback is -- not registered. overlayDisplayCallback :: SettableStateVar (Maybe DisplayCallback) -- | A reshape callback type ReshapeCallback = Size -> IO () -- | Controls the reshape callback for the current window. The -- reshape callback is triggered when a window is reshaped. A reshape -- callback is also triggered immediately before a window's first display -- callback after a window is created or whenever an overlay for the -- window is established. The parameter of the callback specifies the new -- window size in pixels. Before the callback, the current window -- is set to the window that has been reshaped. -- -- If a reshape callback is not registered for a window or -- reshapeCallback is set to Nothing (to deregister a -- previously registered callback), the default reshape callback is used. -- This default callback will simply call -- --
-- viewport (Position 0 0) (Size width height) ---- -- on the normal plane (and on the overlay if one exists). -- -- If an overlay is established for the window, a single reshape callback -- is generated. It is the callback's responsibility to update both the -- normal plane and overlay for the window (changing the layer in use as -- necessary). -- -- When a top-level window is reshaped, subwindows are not reshaped. It -- is up to the GLUT program to manage the size and positions of -- subwindows within a top-level window. Still, reshape callbacks will be -- triggered for subwindows when their size is changed using -- windowSize. reshapeCallback :: SettableStateVar (Maybe ReshapeCallback) -- | A position callback type PositionCallback = Position -> IO () -- | (freeglut only) Controls the position callback for the -- current window. The position callback for a window is called -- when the position of a window changes. positionCallback :: SettableStateVar (Maybe PositionCallback) -- | The visibility state of the current window data Visibility -- | No part of the current window is visible, i.e., until the -- window's visibility changes, all further rendering to the window is -- discarded. NotVisible :: Visibility -- | The current window is totally or partially visible. GLUT -- considers a window visible if any pixel of the window is visible or -- any pixel of any descendant window is visible on the screen. Visible :: Visibility -- | A visibility callback type VisibilityCallback = Visibility -> IO () -- | Controls the visibility callback for the current window. The -- visibility callback for a window is called when the visibility of a -- window changes. -- -- If the visibility callback for a window is disabled and later -- re-enabled, the visibility status of the window is undefined; any -- change in window visibility will be reported, that is if you disable a -- visibility callback and re-enable the callback, you are guaranteed the -- next visibility change will be reported. -- -- Note that you can either use visibilityCallback or -- windowStateCallback, but not both, because the former is -- implemented via the latter. visibilityCallback :: SettableStateVar (Maybe VisibilityCallback) -- | The window state of the current window data WindowState -- | The current window is unmapped. Unmapped :: WindowState -- | The current window is unobscured. FullyRetained :: WindowState -- | The current window is partially obscured. PartiallyRetained :: WindowState -- | The current window is fully obscured. FullyCovered :: WindowState -- | A window state callback type WindowStateCallback = WindowState -> IO () -- | Controls the window state callback for the current window. The -- window state callback for a window is called when the window state of -- a window changes. -- -- If the window state callback for a window is disabled and later -- re-enabled, the window state state of the window is undefined; any -- change in the window state will be reported, that is if you disable a -- window state callback and re-enable the callback, you are guaranteed -- the next window state change will be reported. -- -- Note that you can either use visibilityCallback or -- windowStateCallback, but not both, because the former is -- implemented via the latter. windowStateCallback :: SettableStateVar (Maybe WindowStateCallback) -- | A window close callback type CloseCallback = IO () -- | Controls the window close callback for the current window. closeCallback :: SettableStateVar (Maybe CloseCallback) -- | An initialize context callback type InitContextCallback = IO () -- | (freeglut only) Controls the initialize context callback for -- the /current window/. initContextCallback :: SettableStateVar (Maybe InitContextCallback) -- | The application status of the current window data AppStatus AppStatusPause :: AppStatus AppStatusResume :: AppStatus -- | An application status callback type AppStatusCallback = AppStatus -> IO () -- | Controls the application status callback for the current -- window. appStatusCallback :: SettableStateVar (Maybe AppStatusCallback) -- | A keyboard callback type KeyboardCallback = Char -> Position -> IO () -- | Controls the keyboard callback for the current window. This is -- activated only when a key is pressed. keyboardCallback :: SettableStateVar (Maybe KeyboardCallback) -- | Controls the keyboard callback for the current window. This is -- activated only when a key is released. keyboardUpCallback :: SettableStateVar (Maybe KeyboardCallback) -- | A special key callback type SpecialCallback = SpecialKey -> Position -> IO () -- | Controls the special key callback for the current window. This -- is activated only when a special key is pressed. specialCallback :: SettableStateVar (Maybe SpecialCallback) -- | Controls the special key callback for the current window. This -- is activated only when a special key is released. specialUpCallback :: SettableStateVar (Maybe SpecialCallback) -- | A mouse callback type MouseCallback = MouseButton -> KeyState -> Position -> IO () -- | Controls the mouse callback for the current window. mouseCallback :: SettableStateVar (Maybe MouseCallback) -- | A generalized view of keys data Key Char :: Char -> Key SpecialKey :: SpecialKey -> Key MouseButton :: MouseButton -> Key -- | Special keys data SpecialKey KeyF1 :: SpecialKey KeyF2 :: SpecialKey KeyF3 :: SpecialKey KeyF4 :: SpecialKey KeyF5 :: SpecialKey KeyF6 :: SpecialKey KeyF7 :: SpecialKey KeyF8 :: SpecialKey KeyF9 :: SpecialKey KeyF10 :: SpecialKey KeyF11 :: SpecialKey KeyF12 :: SpecialKey KeyLeft :: SpecialKey KeyUp :: SpecialKey KeyRight :: SpecialKey KeyDown :: SpecialKey KeyPageUp :: SpecialKey KeyPageDown :: SpecialKey KeyHome :: SpecialKey KeyEnd :: SpecialKey KeyInsert :: SpecialKey KeyNumLock :: SpecialKey KeyBegin :: SpecialKey KeyDelete :: SpecialKey KeyShiftL :: SpecialKey KeyShiftR :: SpecialKey KeyCtrlL :: SpecialKey KeyCtrlR :: SpecialKey KeyAltL :: SpecialKey KeyAltR :: SpecialKey -- | You should actually never encounter this value, it is just here as a -- safeguard against future changes in the native GLUT library. KeyUnknown :: Int -> SpecialKey -- | Mouse buttons, including a wheel data MouseButton LeftButton :: MouseButton MiddleButton :: MouseButton RightButton :: MouseButton WheelUp :: MouseButton WheelDown :: MouseButton AdditionalButton :: Int -> MouseButton -- | The current state of a key or button data KeyState Down :: KeyState Up :: KeyState -- | The state of the keyboard modifiers data Modifiers Modifiers :: KeyState -> Modifiers [shift, ctrl, alt] :: Modifiers -> KeyState -- | A keyboard/mouse callback type KeyboardMouseCallback = Key -> KeyState -> Modifiers -> Position -> IO () -- | Controls the keyboard/mouse callback for the current window. -- The keyboard/mouse callback for a window is called when the state of a -- key or mouse button changes. The callback parameters indicate the new -- state of the key/button, the state of the keyboard modifiers, and the -- mouse location in window relative coordinates. -- -- Note that this is a convenience function that should not ordinarily be -- used in conjunction with keyboardCallback, -- keyboardUpCallback, specialCallback, -- specialUpCallback, or mouseCallback. keyboardMouseCallback :: SettableStateVar (Maybe KeyboardMouseCallback) type WheelNumber = Int type WheelDirection = Int type MouseWheelCallback = WheelNumber -> WheelDirection -> Position -> IO () -- | (freeglut only) Controls the mouse wheel callback for the -- current window. The mouse wheel callback for a window is called -- when a mouse wheel is used and the wheel number is greater than or -- equal to numMouseButtons. mouseWheelCallback :: SettableStateVar (Maybe MouseWheelCallback) -- | A motion callback type MotionCallback = Position -> IO () -- | Controls the motion callback for the current window. The motion -- callback for a window is called when the mouse moves within the window -- while one or more mouse buttons are pressed. The callback parameter -- indicates the mouse location in window relative coordinates. motionCallback :: SettableStateVar (Maybe MotionCallback) -- | Controls the passive motion callback for the current window. -- The passive motion callback for a window is called when the mouse -- moves within the window while no mouse buttons are pressed. The -- callback parameter indicates the mouse location in window relative -- coordinates. passiveMotionCallback :: SettableStateVar (Maybe MotionCallback) -- | The relation between the mouse pointer and the current window -- has changed. data Crossing -- | The mouse pointer has left the current window. WindowLeft :: Crossing -- | The mouse pointer has entered the current window. WindowEntered :: Crossing -- | An enter/leave callback type CrossingCallback = Crossing -> IO () -- | Controls the mouse enter/leave callback for the current window. -- Note that some window systems may not generate accurate enter/leave -- callbacks. -- -- X Implementation Notes: An X implementation of GLUT should -- generate accurate enter/leave callbacks. crossingCallback :: SettableStateVar (Maybe CrossingCallback) -- | Translation of the Spaceball along one axis, normalized to be in the -- range of -1000 to +1000 inclusive type SpaceballMotion = Int -- | Rotation of the Spaceball along one axis, normalized to be in the -- range of -1800 .. +1800 inclusive type SpaceballRotation = Int -- | The index of a specific buttons of an input device. type ButtonIndex = Int -- | The state of the Spaceball has changed. data SpaceballInput SpaceballMotion :: SpaceballMotion -> SpaceballMotion -> SpaceballMotion -> SpaceballInput SpaceballRotation :: SpaceballRotation -> SpaceballRotation -> SpaceballRotation -> SpaceballInput SpaceballButton :: ButtonIndex -> KeyState -> SpaceballInput -- | A SpaceballButton callback type SpaceballCallback = SpaceballInput -> IO () -- | Controls the Spaceball callback for the current window. The -- Spaceball callback for a window is called when the window has -- Spaceball input focus (normally, when the mouse is in the window) and -- the user generates Spaceball translations, rotations, or button -- presses. The number of available Spaceball buttons can be determined -- with numSpaceballButtons. -- -- Registering a Spaceball callback when a Spaceball device is not -- available has no effect and is not an error. In this case, no -- Spaceball callbacks will be generated. spaceballCallback :: SettableStateVar (Maybe SpaceballCallback) -- | The dial & button box state has changed. data DialAndButtonBoxInput DialAndButtonBoxButton :: ButtonIndex -> KeyState -> DialAndButtonBoxInput DialAndButtonBoxDial :: DialIndex -> Int -> DialAndButtonBoxInput -- | The index of a specific dial of a dial and button box. type DialIndex = Int -- | A dial & button box callback type DialAndButtonBoxCallback = DialAndButtonBoxInput -> IO () -- | Controls the dial & button box callback for the current -- window. The dial & button box button callback for a window is -- called when the window has dial & button box input focus -- (normally, when the mouse is in the window) and the user generates -- dial & button box button presses or dial changes. The number of -- available dial & button box buttons and dials can be determined -- with numDialsAndButtons. -- -- Registering a dial & button box callback when a dial & button -- box device is not available is ineffectual and not an error. In this -- case, no dial & button box button will be generated. dialAndButtonBoxCallback :: SettableStateVar (Maybe DialAndButtonBoxCallback) -- | Absolute tablet position, with coordinates normalized to be in the -- range of 0 to 2000 inclusive data TabletPosition TabletPosition :: Int -> Int -> TabletPosition -- | The table state has changed. data TabletInput TabletMotion :: TabletInput TabletButton :: ButtonIndex -> KeyState -> TabletInput -- | A tablet callback type TabletCallback = TabletInput -> TabletPosition -> IO () -- | Controls the tablet callback for the current window. The tablet -- callback for a window is called when the window has tablet input focus -- (normally, when the mouse is in the window) and the user generates -- tablet motion or button presses. The number of available tablet -- buttons can be determined with numTabletButtons. -- -- Registering a tablet callback when a tablet device is not available is -- ineffectual and not an error. In this case, no tablet callbacks will -- be generated. tabletCallback :: SettableStateVar (Maybe TabletCallback) -- | The state of the joystick buttons data JoystickButtons JoystickButtons :: KeyState -> JoystickButtons [joystickButtonA, joystickButtonB, joystickButtonC, joystickButtonD] :: JoystickButtons -> KeyState -- | Absolute joystick position, with coordinates normalized to be in the -- range of -1000 to 1000 inclusive. The signs of the three axes mean the -- following: -- --