"      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrs t u v w x y z { | } ~  %The OpenGL library doesn'%t seem to provide a nice way convert ' a Float to a GLfloat, even though they're the same thing  under the covers. )Using realToFrac is too slow, as it doesn't get fused in at  least GHC 6.12.1 )Render a circle with the given thickness :Decide how many line segments to use to render the circle Render a circle as a line. ;Render a circle with a given thickness as a triangle strip  -The commands suported by the view controller   Simulation state The iteration number we' re up to. 7Whether the animation is free-running (or single step) ASignals to callbackIdle to take a single step of the automation. ;Signals to callbackIdle to roll-back to the initial world. ?How many simulation setps to take for each second of real time 'How many seconds worth of simulation we've done so far Record how many steps we've been taking per frame   Dump the internal state of GLUT .Dump internal state of the OpenGL framebuffer .Dump internal state of the fragment renderer. Holds callback functions.  Animation State "Whether the animation is running. 2Whether this is the first frame of the animation. 2Number of msec the animation has been running for EThe time when we entered the display callback for the current frame. >Clamp the minimum time between frames to this value (in msec) 5 Most LCD monitors refresh at around 50Hz so setting  this to < 20msec probably isn't worthwhile. CThe time when the last call to the users render function finished. KThe time when displayInWindow last finished (after sleeping to clamp fps). $How long it took to draw this frame  $State for controlling the viewport. 3 These are used by the viewport control component. .The command list for the viewport controller. 9 These can be safely overwridden at any time by deleting / adding entries to the list. 3 Entries at the front of the list take precedence. AHow much to scale the world by for each step of the mouse wheel. DHow many degrees to rotate the world by for each pixel of x motion. During viewport translation, , where the mouse was clicked on the window. During viewport rotation, + where the mouse was clicked on the window The initial view state. Render options settings Whether to use color %Whether to force wireframe mode only Whether to use alpha blending Whether to use line smoothing "Handles animation timing details. 0 Call this function at the start of each frame. "Handles animation timing details. . Call this function at the end of each frame. 4Callback to handle keyboard and mouse button events  for controlling the viewport. ,'Represents a Quadrant in the 2D plane. - South East . South West / North East 0 North West 1!A list of all quadrants. Same as  [NW .. SE]. ,-./01,0/.-1,0/.--./012Convert degrees to radians 3Convert radians to degrees 44Normalise an angle to be between 0 and 2*pi radians 234234234567Global translation. 8Global rotation (in degrees). 9.Global scaling (of both x and y coordinates). :#The initial state of the viewport. 56789:56789:567896789:;Perform a rendering action whilst using the given viewport The viewport to use. !The rendering action to perform. 8The graphics library calls back on this function when it's finished drawing  and it's time to do some computation. the simulation state the animation statea the viewport state the current world the initial world fn to advance the world #how much time to advance world by  in single step mode ;An abstract color value. A We keep the type abstract so we can be sure that the components 7 are in the required range. To make a custom color use <. CHolds the color components. All components lie in the range [0..1. <CMake a custom color. All components are clamped to the range [0..1]. Red component. Green component. Blue component. Alpha component. =DMake a custom color. All components are clamped to the range [0..255]. Red component. Green component. Blue component. Alpha component. >%Take the RGBA components of a color. 5Clamp components of a color into the required range. =Normalise a color to the value of its largest RGB component. ?&Mix two colors with the given ratios. Ratio of first color. Ratio of second color.  First color. Second color. Resulting color. @=Add RGB components of a color component-wise, then normalise G them to the highest resulting one. The alpha components are averaged. A9Make a dimmer version of a color, scaling towards black. B;Make a brighter version of a color, scaling towards white. CLighten a color, adding white. DDarken a color, adding black. E!A greyness of a given magnitude. "Range is 0 = black, to 1 = white. FGHIJKLMNOPQRS;<=>?@ABCDEFGHIJKLMNOPQRS;<=>?@ABCDEFGHIJKLMNOPQRS;<=>?@ABCDEFGHIJKLMNOPQRS#Convert one of our Colors to OpenGL's representation. FOpen a window and use the supplied callbacks to handle window events. Name of the window. 'Initial size of the window, in pixels. 7Initial position of the window, in pixels relative to $ the top left corner of the screen. Color to use when clearing. Callbacks to use TA 2D picture. U(A picture consisting of several others. V/A picture scaled by the given x and y factors. W3A picture rotated by the given angle (in degrees). X7A picture translated by the given x and y coordinates. Y!A picture drawn with this color. Z&Some text to draw with a vector font. [_A circle with the given thickness and radius. If the thickness is 0 then this is equivalent to \. \ A circle with the given radius. ] A line along an arbitrary path. ^%A polygon filled with a solid color. _%A blank picture, with nothing in it. `A path through the x-y plane. a3A vector can be treated as a point, and vis-versa. bA point on the x-y plane. TUVWXYZ[\]^_`abba`T_^]\[ZYXWVUT _^]\[ZYXWVUUVWXYZ[\]^_`abcA closed loop along this path. d1A wireframe rectangle centered about the origin. width height e-A solid rectangle centered about the origin. width height f;A path representing a rectangle centered about the origin. width height g:A wireframe rectangle in the y > 0 half of the x-y plane. width height h5A sold rectangle in the y > 0 half of the x-y plane. width height iDA path representing a rectangle in the y > 0 half of the x-y plane. width height cdefghicdefghicdefghi jThe magnitude of a vector. k6The angle of this vector, relative to the +ve x-axis. l The dot product of two vectors. m The determinant of two vectors. nMultiply a vector by a scalar. oJRotate a vector by an angle (in radians). +ve angle is counter-clockwise. p:Compute the inner angle (in radians) between two vectors. q0Normalise a vector, so it has a magnitude of 1. rCProduce a unit vector at a given angle relative to the +ve x-axis. # The provided angle is in radians. Pretend a vector is a number.  Vectors aren'4t real numbes according to Haskell, because they don't F support the multiply and divide field operators. We can pretend they A are though, and use the (+) and (-) operators as component-wise  addition and subtraction. jklmnopqr jklmnopqr jklmnopqr4Callback to handle keyboard and mouse button events  for controlling the viewport. ref to ViewPort state ref to ViewPort Control state 4Callback to handle keyboard and mouse button events  for controlling the viewport. ref to ViewPort state ref to ViewPort Control state  s(Given an infinite line which intersects P1 and P1, 2 return the point on that line that is closest to P3 P1 P2 P3 /the point on the line P1-P2 that is closest to P3 t3Given an infinite line which intersects P1 and P2, 8 let P4 be the point on the line that is closest to P3. GReturn an indication of where on the line P4 is relative to P1 and P2.    if P4 == P1 then 0  if P4 == P2 then 1 2 if P4 is halfway between P1 and P2 then 0.5    |  P1  |  P4 +---- P3  |  P2  | P1 P2 P3 MCheck if line segment (P1-P2) clears a box (P3-P4) by being well outside it. P1 First point of segment. P2 Second point of segment. P3 Lower left point of box. P4 Upper right point of box. u?Check if an arbitrary segment intersects a horizontal segment.   P2  /  (xa, y3) ---+---- (xb, y3)  /  /  P1 P1 First point of segment. P2 Second point of segment. $(y3) y value of horizontal segment. -(xa) Leftmost x value of horizontal segment. .(xb) Rightmost x value of horizontal segment. %(x3, y3) Intersection point, if any. v=Check if an arbitrary segment intersects a vertical segment.   (x3, yb)  | P1  | /  +  / |  P2 |  (x3, ya) P1 First point of segment. P2 Second point of segment. !(x3) x value of vertical segment )(ya) Lowest y value of vertical segment. *(yb) Highest y value of vertical segment. %(x3, y3) Intersection point, if any. stuvstuvstuv 234jklmnopqrstuv wAn integral coordinate. x$A rectangular area of the 2D plane. S We keep the type abstract to ensure that invalid extents cannot be constructed. yConstruct an extent. 8 The north value must be > south, and east > west, else . y max (north) y min (south)  x max (east)  x min (west) z'Take the NSEW components of an extent. {!A square extent of a given size. |'Get the width and height of an extent. }=Check if an extent is a square with a width and height of 1. ~2Check whether a coordinate lies inside an extent. -Check whether a point lies inside an extent. 9Get the coordinate that lies at the center of an extent. #Cut one quadrant out of an extent. 7Get the quadrant that this coordinate lies in, if any. 9Constuct a path to a particular coordinate in an extent. fIf a line segment (P1-P2) intersects the outer edge of an extent then return the intersection point, B that is closest to P1, if any. If P1 is inside the extent then .   P2  /  ----/-  | / |  + |  /------  /  P1 Check whether a line segment'Is endpoints are inside an extent, or if it intersects with the boundary. wxyz{|}~xwyz{|}~wxyz{|}~ The quad tree structure. A node with four children. A leaf containint some value. An empty node. A  tree.  A node with . for all its branches. Get a quadrant from a node. 0 If the tree does not have an outer node then . *Apply a function to a quadrant of a node. J If the tree does not have an outer node then return the original tree. >Insert a value into the tree at the position given by a path. & If the path intersects an existing  then return the original tree. 9Insert a value into the node containing this coordinate. B The node is created at maximum depth, corresponding to an unit x. %Lookup a node based on a path to it. ,Lookup an element based given a path to it. >Lookup a node if a tree given a coordinate which it contains. #Extent that covers the whole tree. %Coordinate of the value of interest. JFlatten a QuadTree into a list of its contained values, with coordinates. #Extent that covers the whole tree. JFlatten a QuadTree into a list of its contained values, with coordinates. #Extent that covers the whole tree.  <The quadtree contains cells of unit extent (NetHack style). A Given a line segement (P1-P2) through the tree, get the cell 6 closest to P1 that intersects the segment, if any. <TODO: This currently uses a naive algorithm. It just calls   and sorts the results ) to get the one closest to P1. It'd be better to do a @ proper walk over the tree in the direction of the ray. (P1) Starting point of seg. (P2) Final point of seg. !Extent convering the whole tree.  The tree. <Intersection point, extent of cell, value of cell (if any). <The quadtree contains cells of unit extent (NetHack style). L Given a line segment (P1-P2) through the tree, return the list of cells  that intersect the segment. (P1) Starting point of seg. (P2) Final point of seg.  Extent covering the whole tree.  The tree. 3Intersection point, extent of cell, value of cell. !>Render a picture using the given render options and viewport. The render options to use The current viewport. The picture to render. Turn alpha blending on or off Turn line smoothing on or off "1Open a new window and display the given picture. 4Use the following commands once the window is open:  Quit - esc-key. . Move Viewport - left-click drag, arrow keys. E Rotate Viewport - right-click drag, control-left-click drag, or home/ end-keys. ( Zoom Viewport - mouse wheel, or page up/ down-keys. Name of the window. 'Initial size of the window, in pixels. +Initial position of the window, in pixels. Background color. The picture to draw. #3Open a new window and display the given animation. >Once the window is open you can use the same commands as with displayInWindow. Name of the window. 'Initial size of the window, in pixels. +Initial position of the window, in pixels. Background color. 2Function to produce the next frame of animation. = It is passed the time in seconds since the program started. $XRun a finite-time-step simulation in a window. You decide how the world is represented, ] how to convert the world to a picture, and how to advance the world for each unit of time.  This function does the rest. >Once the window is open you can use the same commands as with displayInWindow. Name of the window. 'Initial size of the window, in pixels. +Initial position of the window, in pixels. Background color. ANumber of simulation steps to take for each second of real time. The initial world. +A function to convert the world a picture. >A function to step the world one iteration. It is passed the = current viewport and the amount of time for this simulation  step (in seconds). %Possible input events. Run a game in a window. Name of the window. 'Initial size of the window, in pixels. +Initial position of the window, in pixels. Background color. ANumber of simulation steps to take for each second of real time. The initial world. +A function to convert the world a picture. #A function to handle input events. ,A function to step the world one iteration. H It is passed the period of time (in seconds) needing to be advanced. Callback for KeyMouse events. ref to world state fn to handle input events Callback for Motion events. ref to world state fn to handle input events ^  !"#$%&'()*+56789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ab0$!"# +%&'()*  156789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ab&'(&')&'*&'+&',&'-&'.&'/&'0&'1&'2&'3&'4&'5&'6&'7&'8&'9&':&';&'<&'=&'>&'?&'@&'A&'B&'C&'D&'E&'F&'G&'G&'H&'@&'I&'J&KL&KM&KN&KO&KP&KQ&KIRSTUVWXYZ[[\]^_`abcdefghijklmnopqrstuvwxyz{|}`~       "#$%%%%           !!%% gloss-1.1.0.0Graphics.Gloss.GameGraphics.Gloss.Data.QuadGraphics.Gloss.Geometry.AngleGraphics.Gloss.ViewPortGraphics.Gloss.ColorGraphics.Gloss.PictureGraphics.Gloss.ShapesGraphics.Gloss.Geometry.VectorGraphics.Gloss.Geometry.LineGraphics.Gloss.Data.ExtentGraphics.Gloss.Data.QuadTree!Graphics.Gloss.Algorithms.RayCastGraphics.Gloss&Graphics.Gloss.Internals.Render.Common&Graphics.Gloss.Internals.Render.Circle3Graphics.Gloss.Internals.Interface.ViewPort.Command1Graphics.Gloss.Internals.Interface.Simulate.State(Graphics.Gloss.Internals.Interface.Debug+Graphics.Gloss.Internals.Interface.Callback0Graphics.Gloss.Internals.Interface.Animate.State8Graphics.Gloss.Internals.Interface.ViewPort.ControlState'Graphics.Gloss.Internals.Render.Options1Graphics.Gloss.Internals.Interface.Animate.Timing3Graphics.Gloss.Internals.Interface.ViewPort.Reshape.Graphics.Gloss.Internals.Interface.Common.Exit(Graphics.Gloss.Internals.Render.ViewPort0Graphics.Gloss.Internals.Interface.Simulate.IdleGraphics.Gloss.Internals.Color)Graphics.Gloss.Internals.Interface.Window4Graphics.Gloss.Internals.Interface.ViewPort.KeyMouse2Graphics.Gloss.Internals.Interface.ViewPort.MotionGraphics.Gloss.Geometry'Graphics.Gloss.Internals.Render.Picture*Graphics.Gloss.Internals.Interface.Display*Graphics.Gloss.Internals.Interface.Animate+Graphics.Gloss.Internals.Interface.Simulate'Graphics.Gloss.Internals.Interface.Game GLUT-2.2.2.0!Graphics.UI.GLUT.Callbacks.WindowKeyF1KeyF2KeyF3KeyF4KeyF5KeyF6KeyF7KeyF8KeyF9KeyF10KeyF11KeyF12KeyLeftKeyUpKeyRightKeyDown KeyPageUp KeyPageDownKeyHomeKeyEnd KeyInsert KeyNumLockKeyBegin KeyDelete SpecialKeyDownUpKeyStatealtctrlshift ModifiersChar MouseButtonKeyGraphics.UI.GLUT.Types LeftButton MiddleButton RightButtonWheelUp WheelDownAdditionalButtonQuadSESWNENWallQuadsdegToRadradToDegnormaliseAngleViewPortviewPortTranslateviewPortRotate viewPortScale viewPortInitColor makeColor makeColor8 rgbaOfColor mixColors addColorsdimbrightlightdarkgreyNblackwhiteredgreenblueyellowcyanmagentarosevioletazure aquamarine chartreuseorangePicturePicturesScaleRotate TranslateText ThickCircleCircleLinePolygonBlankPathVectorPointlineLoop rectangleWirerectangleSolid rectanglePathrectangleUpperWirerectangleUpperSolidrectangleUpperPathmagVargVdotVdetVmulSVrotateVangleVV normaliseVunitVectorAtAngleclosestPointOnLineclosestPointOnLineParamintersectSegHorzSegintersectSegVertSegCoordExtent makeExtent takeExtent squareExtent sizeOfExtent isUnitExtent coordInExtent pointInExtentcenterCoordOfExtentcutQuadOfExtent quadOfCoord pathToCoordintersectSegExtenttouchesSegExtentQuadTreeTNodeTLeafTNil emptyTree emptyNodetakeQuadOfTree liftToQuad insertByPath insertByCoordlookupNodeByPath lookupByPath lookupByCoordflattenQuadTreeflattenQuadTreeWithExtentscastSegIntoCellularQuadTreetraceSegIntoCellularQuadTreedisplayInWindowanimateInWindowsimulateInWindowEvent EventMotionEventKey gameInWindowgf renderCircle circleStepsrenderCircleLinerenderCircleLine_steprenderCircleStriprenderCircleStrip_stepCommandCBumpCClockwiseCBumpClockwise CBumpDownCBumpUp CBumpRight CBumpLeft CBumpZoomIn CBumpZoomOutCRotate CTranslateCRestoredefaultCommandConfig isCommandStatestateIterationstateRun stateStep stateResetstateResolution stateSimTimestateStepsPerFrame stateInit dumpGlutStatedumpFramebufferStatedumpFragmentStateCallbackReshapeMotionIdleKeyMouseDisplay stateAnimatestateAnimateStartstateAnimateTimestateDisplayTimestateDisplayTimeLaststateDisplayTimeClampstateGateTimeStartstateGateTimeEndstateGateTimeElapsed stateCommandsstateScaleStepstateRotateFactorstateTranslateMarkstateRotateMarkOptions optionsColoroptionsWireframeoptionsBlendAlphaoptionsLineSmooth optionsInit animateBegin animateEndcallback_viewPort_reshape callback_exit withViewPortcallback_simulate_idle simulate_run simulate_stepRGBA clampColornormaliseColorglColor4OfColor createWindow$fNum(,)callback_viewPort_keyMousecallback_viewPort_motion segClearsBox extentNorth extentSouth extentEast extentWestbaseGHC.Errerror Data.MaybeNothingcompareDistanceTodistance renderPicture vertexPFscallback_keyMousecallback_motion