/usr/share/doc/libghc-gloss-doc/html/gloss.txt is in libghc-gloss-doc 1.7.8.3-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 | -- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | Painless 2D vector graphics, animations and simulations.
--
-- Gloss hides the pain of drawing simple vector graphics behind a nice
-- data type and a few display functions. Gloss uses OpenGL under the
-- hood, but you won't need to worry about any of that. Get something
-- cool on the screen in under 10 minutes.
@package gloss
@version 1.7.8.3
module Graphics.Gloss.Data.Quad
-- | Represents a Quadrant in the 2D plane.
data Quad
-- | North West
NW :: Quad
-- | North East
NE :: Quad
-- | South West
SW :: Quad
-- | South East
SE :: Quad
-- | A list of all quadrants. Same as <tt>[NW .. SE]</tt>.
allQuads :: [Quad]
instance Show Quad
instance Eq Quad
instance Enum Quad
module Graphics.Gloss.Data.Point
-- | A point on the x-y plane. Points can also be treated as
-- <tt>Vector</tt>s, so <a>Graphics.Gloss.Data.Vector</a> may also be
-- useful.
type Point = (Float, Float)
-- | Test whether a point lies within a rectangular box that is oriented on
-- the x-y plane. The points P1-P2 are opposing points of the box, but
-- need not be in a particular order.
--
-- <pre>
-- P2 +-------+
-- | |
-- | + P0 |
-- | |
-- +-------+ P1
-- </pre>
pointInBox :: Point -> Point -> Point -> Bool
instance Num Point
-- | Geometric functions concerning angles. If not otherwise specified, all
-- angles are in radians.
module Graphics.Gloss.Geometry.Angle
-- | Convert degrees to radians
degToRad :: Float -> Float
-- | Convert radians to degrees
radToDeg :: Float -> Float
-- | Normalise an angle to be between 0 and 2*pi radians
normaliseAngle :: Float -> Float
-- | Geometric functions concerning vectors.
module Graphics.Gloss.Data.Vector
-- | A vector can be treated as a point, and vis-versa.
type Vector = Point
-- | The magnitude of a vector.
magV :: Vector -> Float
-- | The angle of this vector, relative to the +ve x-axis.
argV :: Vector -> Float
-- | The dot product of two vectors.
dotV :: Vector -> Vector -> Float
-- | The determinant of two vectors.
detV :: Vector -> Vector -> Float
-- | Multiply a vector by a scalar.
mulSV :: Float -> Vector -> Vector
-- | Rotate a vector by an angle (in radians). +ve angle is
-- counter-clockwise.
rotateV :: Float -> Vector -> Vector
-- | Compute the inner angle (in radians) between two vectors.
angleVV :: Vector -> Vector -> Float
-- | Normalise a vector, so it has a magnitude of 1.
normaliseV :: Vector -> Vector
-- | Produce a unit vector at a given angle relative to the +ve x-axis. The
-- provided angle is in radians.
unitVectorAtAngle :: Float -> Vector
-- | Geometric functions concerning lines and segments.
--
-- A <tt>Line</tt> is taken to be infinite in length, while a
-- <tt>Seg</tt> is finite length line segment represented by its two
-- endpoints.
module Graphics.Gloss.Geometry.Line
-- | Check if line segment (P1-P2) clears a box (P3-P4) by being well
-- outside it.
segClearsBox :: Point -> Point -> Point -> Point -> Bool
-- | Given an infinite line which intersects <tt>P1</tt> and <tt>P1</tt>,
-- return the point on that line that is closest to <tt>P3</tt>
closestPointOnLine :: Point -> Point -> Point -> Point
-- | Given an infinite line which intersects P1 and P2, let P4 be the point
-- on the line that is closest to P3.
--
-- Return an indication of where on the line P4 is relative to P1 and P2.
--
-- <pre>
-- if P4 == P1 then 0
-- if P4 == P2 then 1
-- if P4 is halfway between P1 and P2 then 0.5
-- </pre>
--
-- <pre>
-- |
-- P1
-- |
-- P4 +---- P3
-- |
-- P2
-- |
-- </pre>
closestPointOnLineParam :: Point -> Point -> Point -> Float
-- | Given four points specifying two lines, get the point where the two
-- lines cross, if any. Note that the lines extend off to infinity, so
-- the intersection point might not line between either of the two pairs
-- of points.
--
-- <pre>
-- \ /
-- P1 P4
-- \ /
-- +
-- / \
-- P3 P2
-- / \
-- </pre>
intersectLineLine :: Point -> Point -> Point -> Point -> Maybe Point
-- | Get the point where a segment <tt>P1-P2</tt> crosses an infinite line
-- <tt>P3-P4</tt>, if any.
intersectSegLine :: Point -> Point -> Point -> Point -> Maybe Point
-- | Get the point where a segment crosses a horizontal line, if any.
--
-- <pre>
--
-- + P1
-- /
-- -------+---------
-- / y0
-- P2 +
-- </pre>
intersectSegHorzLine :: Point -> Point -> Float -> Maybe Point
-- | Get the point where a segment crosses a vertical line, if any.
--
-- <pre>
-- |
-- | + P1
-- | /
-- +
-- / |
-- P2 + |
-- | x0
-- </pre>
intersectSegVertLine :: Point -> Point -> Float -> Maybe Point
-- | Get the point where a segment <tt>P1-P2</tt> crosses another segement
-- <tt>P3-P4</tt>, if any.
intersectSegSeg :: Point -> Point -> Point -> Point -> Maybe Point
-- | Check if an arbitrary segment intersects a horizontal segment.
--
-- <pre>
-- + P2
-- /
-- (xa, y3) +---+----+ (xb, y3)
-- /
-- P1 +
-- </pre>
intersectSegHorzSeg :: Point -> Point -> Float -> Float -> Float -> Maybe Point
-- | Check if an arbitrary segment intersects a vertical segment.
--
-- <pre>
-- (x3, yb) +
-- | + P1
-- | /
-- +
-- / |
-- P2 + |
-- + (x3, ya)
-- </pre>
intersectSegVertSeg :: Point -> Point -> Float -> Float -> Float -> Maybe Point
-- | Represents an integral rectangular area of the 2D plane. Using
-- <a>Int</a>s (instead of <a>Float</a>s) for the bounds means we can
-- safely compare extents for equality.
module Graphics.Gloss.Data.Extent
-- | A rectangular area of the 2D plane. We keep the type abstract to
-- ensure that invalid extents cannot be constructed.
data Extent
-- | An integral coordinate.
type Coord = (Int, Int)
-- | Construct an extent. The north value must be > south, and east >
-- west, else <a>error</a>.
makeExtent :: Int -> Int -> Int -> Int -> Extent
-- | Take the NSEW components of an extent.
takeExtent :: Extent -> (Int, Int, Int, Int)
-- | A square extent of a given size.
squareExtent :: Int -> Extent
-- | Get the width and height of an extent.
sizeOfExtent :: Extent -> (Int, Int)
-- | Check if an extent is a square with a width and height of 1.
isUnitExtent :: Extent -> Bool
-- | Check whether a coordinate lies inside an extent.
coordInExtent :: Extent -> Coord -> Bool
-- | Check whether a point lies inside an extent.
pointInExtent :: Extent -> Point -> Bool
-- | Get the coordinate that lies at the center of an extent.
centerCoordOfExtent :: Extent -> (Int, Int)
-- | Cut one quadrant out of an extent.
cutQuadOfExtent :: Quad -> Extent -> Extent
-- | Get the quadrant that this coordinate lies in, if any.
quadOfCoord :: Extent -> Coord -> Maybe Quad
-- | Constuct a path to a particular coordinate in an extent.
pathToCoord :: Extent -> Coord -> Maybe [Quad]
-- | If a line segment (P1-P2) intersects the outer edge of an extent then
-- return the intersection point, that is closest to P1, if any. If P1 is
-- inside the extent then <a>Nothing</a>.
--
-- <pre>
-- P2
-- /
-- ----/-
-- | / |
-- + |
-- /------
-- /
-- P1
-- </pre>
intersectSegExtent :: Point -> Point -> Extent -> Maybe Point
-- | Check whether a line segment's endpoints are inside an extent, or if
-- it intersects with the boundary.
touchesSegExtent :: Point -> Point -> Extent -> Bool
instance Eq Extent
instance Show Extent
-- | A QuadTree can be used to recursively divide up 2D space into
-- quadrants. The smallest division corresponds to an unit <a>Extent</a>,
-- so the total depth of the tree will depend on what sized <a>Extent</a>
-- you start with.
module Graphics.Gloss.Data.QuadTree
-- | The quad tree structure.
data QuadTree a
-- | An empty node.
TNil :: QuadTree a
-- | A leaf containint some value.
TLeaf :: a -> QuadTree a
-- | A node with four children.
TNode :: (QuadTree a) -> (QuadTree a) -> (QuadTree a) -> (QuadTree a) -> QuadTree a
-- | A <a>TNil</a> tree.
emptyTree :: QuadTree a
-- | A node with <a>TNil</a>. for all its branches.
emptyNode :: QuadTree a
-- | Get a quadrant from a node. If the tree does not have an outer node
-- then <a>Nothing</a>.
takeQuadOfTree :: Quad -> QuadTree a -> Maybe (QuadTree a)
-- | Apply a function to a quadrant of a node. If the tree does not have an
-- outer node then return the original tree.
liftToQuad :: Quad -> (QuadTree a -> QuadTree a) -> QuadTree a -> QuadTree a
-- | Insert a value into the tree at the position given by a path. If the
-- path intersects an existing <a>TLeaf</a> then return the original
-- tree.
insertByPath :: [Quad] -> a -> QuadTree a -> QuadTree a
-- | Insert a value into the node containing this coordinate. The node is
-- created at maximum depth, corresponding to an unit <a>Extent</a>.
insertByCoord :: Extent -> Coord -> a -> QuadTree a -> Maybe (QuadTree a)
-- | Lookup a node based on a path to it.
lookupNodeByPath :: [Quad] -> QuadTree a -> Maybe (QuadTree a)
-- | Lookup an element based given a path to it.
lookupByPath :: [Quad] -> QuadTree a -> Maybe a
-- | Lookup a node if a tree given a coordinate which it contains.
lookupByCoord :: Extent -> Coord -> QuadTree a -> Maybe a
-- | Flatten a QuadTree into a list of its contained values, with
-- coordinates.
flattenQuadTree :: Extent -> QuadTree a -> [(Coord, a)]
-- | Flatten a QuadTree into a list of its contained values, with
-- coordinates.
flattenQuadTreeWithExtents :: Extent -> QuadTree a -> [(Extent, a)]
instance Show a => Show (QuadTree a)
module Graphics.Gloss.Geometry
module Graphics.Gloss.Data.Display
-- | Describes how Gloss should display its output.
data Display
-- | Display in a window with the given name, size and position.
InWindow :: String -> (Int, Int) -> (Int, Int) -> Display
-- | Display full screen with a drawing area of the given size.
FullScreen :: (Int, Int) -> Display
instance Eq Display
instance Read Display
instance Show Display
-- | Predefined and custom colors.
module Graphics.Gloss.Data.Color
-- | An abstract color value. We keep the type abstract so we can be sure
-- that the components are in the required range. To make a custom color
-- use <a>makeColor</a>.
data Color
-- | Make a custom color. All components are clamped to the range [0..1].
makeColor :: Float -> Float -> Float -> Float -> Color
-- | Make a custom color. You promise that all components are clamped to
-- the range [0..1]
makeColor' :: Float -> Float -> Float -> Float -> Color
-- | Make a custom color. All components are clamped to the range [0..255].
makeColor8 :: Int -> Int -> Int -> Int -> Color
-- | Make a custom color. Components should be in the range [0..1] but this
-- is not checked.
rawColor :: Float -> Float -> Float -> Float -> Color
-- | Take the RGBA components of a color.
rgbaOfColor :: Color -> (Float, Float, Float, Float)
-- | Mix two colors with the given ratios.
mixColors :: Float -> Float -> Color -> Color -> Color
-- | Add RGB components of a color component-wise, then normalise them to
-- the highest resulting one. The alpha components are averaged.
addColors :: Color -> Color -> Color
-- | Make a dimmer version of a color, scaling towards black.
dim :: Color -> Color
-- | Make a brighter version of a color, scaling towards white.
bright :: Color -> Color
-- | Lighten a color, adding white.
light :: Color -> Color
-- | Darken a color, adding black.
dark :: Color -> Color
-- | A greyness of a given magnitude.
greyN :: Float -> Color
black :: Color
white :: Color
red :: Color
green :: Color
blue :: Color
yellow :: Color
cyan :: Color
magenta :: Color
rose :: Color
violet :: Color
azure :: Color
aquamarine :: Color
chartreuse :: Color
orange :: Color
instance Show Color
instance Eq Color
instance Num Color
-- | Data types for representing pictures.
module Graphics.Gloss.Data.Picture
-- | A point on the x-y plane. Points can also be treated as
-- <tt>Vector</tt>s, so <a>Graphics.Gloss.Data.Vector</a> may also be
-- useful.
type Point = (Float, Float)
-- | A vector can be treated as a point, and vis-versa.
type Vector = Point
-- | A path through the x-y plane.
type Path = [Point]
-- | A 2D picture
data Picture
-- | A blank picture, with nothing in it.
Blank :: Picture
-- | A convex polygon filled with a solid color.
Polygon :: Path -> Picture
-- | A line along an arbitrary path.
Line :: Path -> Picture
-- | A circle with the given radius.
Circle :: Float -> Picture
-- | A circle with the given thickness and radius. If the thickness is 0
-- then this is equivalent to <a>Circle</a>.
ThickCircle :: Float -> Float -> Picture
-- | A circular arc drawn counter-clockwise between two angles (in degrees)
-- at the given radius.
Arc :: Float -> Float -> Float -> Picture
-- | A circular arc drawn counter-clockwise between two angles (in
-- degrees), with the given radius and thickness. If the thickness is 0
-- then this is equivalent to <a>Arc</a>.
ThickArc :: Float -> Float -> Float -> Float -> Picture
-- | Some text to draw with a vector font.
Text :: String -> Picture
-- | A bitmap image with a width, height and some 32-bit RGBA bitmap data.
--
-- The boolean flag controls whether Gloss should cache the data between
-- frames for speed. If you are programatically generating the image for
-- each frame then use <a>False</a>. If you have loaded it from a file
-- then use <a>True</a>.
Bitmap :: Int -> Int -> BitmapData -> Bool -> Picture
-- | A picture drawn with this color.
Color :: Color -> Picture -> Picture
-- | A picture translated by the given x and y coordinates.
Translate :: Float -> Float -> Picture -> Picture
-- | A picture rotated clockwise by the given angle (in degrees).
Rotate :: Float -> Picture -> Picture
-- | A picture scaled by the given x and y factors.
Scale :: Float -> Float -> Picture -> Picture
-- | A picture consisting of several others.
Pictures :: [Picture] -> Picture
-- | Abstract 32-bit RGBA bitmap data.
data BitmapData
-- | A blank picture, with nothing in it.
blank :: Picture
-- | A convex polygon filled with a solid color.
polygon :: Path -> Picture
-- | A line along an arbitrary path.
line :: Path -> Picture
-- | A circle with the given radius.
circle :: Float -> Picture
-- | A circle with the given thickness and radius. If the thickness is 0
-- then this is equivalent to <a>Circle</a>.
thickCircle :: Float -> Float -> Picture
-- | A circular arc drawn counter-clockwise between two angles (in degrees)
-- at the given radius.
arc :: Float -> Float -> Float -> Picture
-- | A circular arc drawn counter-clockwise between two angles (in
-- degrees), with the given radius and thickness. If the thickness is 0
-- then this is equivalent to <a>Arc</a>.
thickArc :: Float -> Float -> Float -> Float -> Picture
-- | Some text to draw with a vector font.
text :: String -> Picture
-- | A bitmap image with a width, height and a Vector holding the 32-bit
-- RGBA bitmap data.
--
-- The boolean flag controls whether Gloss should cache the data between
-- frames for speed. If you are programatically generating the image for
-- each frame then use <a>False</a>. If you have loaded it from a file
-- then use <a>True</a>.
bitmap :: Int -> Int -> BitmapData -> Bool -> Picture
-- | A picture drawn with this color.
color :: Color -> Picture -> Picture
-- | A picture translated by the given x and y coordinates.
translate :: Float -> Float -> Picture -> Picture
-- | A picture rotated clockwise by the given angle (in degrees).
rotate :: Float -> Picture -> Picture
-- | A picture scaled by the given x and y factors.
scale :: Float -> Float -> Picture -> Picture
-- | A picture consisting of several others.
pictures :: [Picture] -> Picture
-- | A closed loop along a path.
lineLoop :: Path -> Picture
-- | A solid circle with the given radius.
circleSolid :: Float -> Picture
-- | A solid arc, drawn counter-clockwise between two angles at the given
-- radius.
arcSolid :: Float -> Float -> Float -> Picture
-- | A wireframe sector of a circle. An arc is draw counter-clockwise from
-- the first to the second angle at the given radius. Lines are drawn
-- from the origin to the ends of the arc.
sectorWire :: Float -> Float -> Float -> Picture
-- | A path representing a rectangle centered about the origin
rectanglePath :: Float -> Float -> Path
-- | A wireframe rectangle centered about the origin.
rectangleWire :: Float -> Float -> Picture
-- | A solid rectangle centered about the origin.
rectangleSolid :: Float -> Float -> Picture
-- | A path representing a rectangle in the y > 0 half of the x-y plane.
rectangleUpperPath :: Float -> Float -> Path
-- | A wireframe rectangle in the y > 0 half of the x-y plane.
rectangleUpperWire :: Float -> Float -> Picture
-- | A solid rectangle in the y > 0 half of the x-y plane.
rectangleUpperSolid :: Float -> Float -> Picture
-- | O(1). Use a <a>ForeignPtr</a> of RGBA data as a bitmap with the given
-- width and height.
bitmapOfForeignPtr :: Int -> Int -> ForeignPtr Word8 -> Bool -> Picture
-- | O(size). Copy a <a>ByteString</a> of RGBA data into a bitmap with the
-- given width and height.
--
-- The boolean flag controls whether Gloss should cache the data between
-- frames for speed. If you are programatically generating the image for
-- each frame then use <a>False</a>. If you have loaded it from a file
-- then use <a>True</a>.
bitmapOfByteString :: Int -> Int -> ByteString -> Bool -> Picture
-- | O(size). Copy a <a>BMP</a> file into a bitmap.
bitmapOfBMP :: BMP -> Picture
-- | Load an uncompressed 24 or 32bit RGBA BMP file as a bitmap.
loadBMP :: FilePath -> IO Picture
instance Show Picture
instance Eq Picture
instance Monoid Picture
-- | Various ray casting algorithms.
module Graphics.Gloss.Algorithms.RayCast
-- | The quadtree contains cells of unit extent (NetHack style). Given a
-- line segement (P1-P2) through the tree, get the cell closest to P1
-- that intersects the segment, if any.
--
-- TODO: This currently uses a naive algorithm. It just calls
-- <a>traceSegIntoCellularQuadTree</a> 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.
castSegIntoCellularQuadTree :: Point -> Point -> Extent -> QuadTree a -> Maybe (Point, Extent, a)
-- | The quadtree contains cells of unit extent (NetHack style). Given a
-- line segment (P1-P2) through the tree, return the list of cells that
-- intersect the segment.
traceSegIntoCellularQuadTree :: Point -> Point -> Extent -> QuadTree a -> [(Point, Extent, a)]
-- | Display mode is for drawing a static picture.
module Graphics.Gloss.Interface.Pure.Display
-- | Open a new window and display the given picture.
--
-- Use the following commands once the window is open:
--
-- <ul>
-- <li>Quit - esc-key.</li>
-- <li>Move Viewport - left-click drag, arrow keys.</li>
-- <li>Rotate Viewport - right-click drag, control-left-click drag, or
-- home/end-keys.</li>
-- <li>Zoom Viewport - mouse wheel, or page up/down-keys.</li>
-- </ul>
display :: Display -> Color -> Picture -> IO ()
-- | Display mode is for drawing a static picture.
module Graphics.Gloss.Interface.Pure.Animate
-- | Open a new window and display the given animation.
--
-- Once the window is open you can use the same commands as with
-- <tt>display</tt>.
animate :: Display -> Color -> (Float -> Picture) -> IO ()
-- | Display mode is for drawing a static picture.
module Graphics.Gloss.Interface.IO.Animate
-- | Open a new window and display the given animation.
--
-- Once the window is open you can use the same commands as with
-- <tt>display</tt>.
animateIO :: Display -> Color -> (Float -> IO Picture) -> IO ()
-- | Like <a>animateIO</a> but don't allow the display to be panned around.
animateFixedIO :: Display -> Color -> (Float -> IO Picture) -> IO ()
-- | Simulate mode is for producing an animation of some model who's
-- picture changes over finite time steps. The behavior of the model can
-- also depent on the current <a>ViewPort</a>.
module Graphics.Gloss.Interface.Pure.Simulate
-- | Run a finite-time-step simulation in a window. You decide how the
-- model is represented, how to convert the model to a picture, and how
-- to advance the model for each unit of time. This function does the
-- rest.
--
-- Once the window is open you can use the same commands as with
-- <tt>display</tt>.
simulate :: Display -> Color -> Int -> model -> (model -> Picture) -> (ViewPort -> Float -> model -> model) -> IO ()
data ViewPort
ViewPort :: !(Float, Float) -> !Float -> !Float -> ViewPort
-- | Global translation.
viewPortTranslate :: ViewPort -> !(Float, Float)
-- | Global rotation (in degrees).
viewPortRotate :: ViewPort -> !Float
-- | Global scaling (of both x and y coordinates).
viewPortScale :: ViewPort -> !Float
-- | Simulate mode is for producing an animation of some model who's
-- picture changes over finite time steps. The behavior of the model can
-- also depent on the current <a>ViewPort</a>.
module Graphics.Gloss.Interface.IO.Simulate
simulateIO :: Display -> Color -> Int -> model -> (model -> IO Picture) -> (ViewPort -> Float -> model -> IO model) -> IO ()
data ViewPort
ViewPort :: !(Float, Float) -> !Float -> !Float -> ViewPort
-- | Global translation.
viewPortTranslate :: ViewPort -> !(Float, Float)
-- | Global rotation (in degrees).
viewPortRotate :: ViewPort -> !Float
-- | Global scaling (of both x and y coordinates).
viewPortScale :: ViewPort -> !Float
-- | This game mode lets you manage your own input. Pressing ESC will still
-- abort the program, but you don't get automatic pan and zoom controls
-- like with <tt>displayInWindow</tt>.
module Graphics.Gloss.Interface.Pure.Game
-- | Play a game in a window.
play :: Display -> Color -> Int -> world -> (world -> Picture) -> (Event -> world -> world) -> (Float -> world -> world) -> IO ()
-- | Possible input events.
data Event
EventKey :: Key -> KeyState -> Modifiers -> (Float, Float) -> Event
EventMotion :: (Float, Float) -> Event
data Key
Char :: Char -> Key
SpecialKey :: SpecialKey -> Key
MouseButton :: MouseButton -> Key
data SpecialKey
KeyUnknown :: SpecialKey
KeySpace :: SpecialKey
KeyEsc :: 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
KeyF13 :: SpecialKey
KeyF14 :: SpecialKey
KeyF15 :: SpecialKey
KeyF16 :: SpecialKey
KeyF17 :: SpecialKey
KeyF18 :: SpecialKey
KeyF19 :: SpecialKey
KeyF20 :: SpecialKey
KeyF21 :: SpecialKey
KeyF22 :: SpecialKey
KeyF23 :: SpecialKey
KeyF24 :: SpecialKey
KeyF25 :: SpecialKey
KeyUp :: SpecialKey
KeyDown :: SpecialKey
KeyLeft :: SpecialKey
KeyRight :: SpecialKey
KeyTab :: SpecialKey
KeyEnter :: SpecialKey
KeyBackspace :: SpecialKey
KeyInsert :: SpecialKey
KeyNumLock :: SpecialKey
KeyBegin :: SpecialKey
KeyDelete :: SpecialKey
KeyPageUp :: SpecialKey
KeyPageDown :: SpecialKey
KeyHome :: SpecialKey
KeyEnd :: SpecialKey
KeyPad0 :: SpecialKey
KeyPad1 :: SpecialKey
KeyPad2 :: SpecialKey
KeyPad3 :: SpecialKey
KeyPad4 :: SpecialKey
KeyPad5 :: SpecialKey
KeyPad6 :: SpecialKey
KeyPad7 :: SpecialKey
KeyPad8 :: SpecialKey
KeyPad9 :: SpecialKey
KeyPadDivide :: SpecialKey
KeyPadMultiply :: SpecialKey
KeyPadSubtract :: SpecialKey
KeyPadAdd :: SpecialKey
KeyPadDecimal :: SpecialKey
KeyPadEqual :: SpecialKey
KeyPadEnter :: SpecialKey
data MouseButton
LeftButton :: MouseButton
MiddleButton :: MouseButton
RightButton :: MouseButton
WheelUp :: MouseButton
WheelDown :: MouseButton
AdditionalButton :: Int -> MouseButton
data KeyState
Down :: KeyState
Up :: KeyState
data Modifiers
Modifiers :: KeyState -> KeyState -> KeyState -> Modifiers
shift :: Modifiers -> KeyState
ctrl :: Modifiers -> KeyState
alt :: Modifiers -> KeyState
-- | This game mode lets you manage your own input. Pressing ESC will still
-- abort the program, but you don't get automatic pan and zoom controls
-- like with <tt>displayInWindow</tt>.
module Graphics.Gloss.Interface.IO.Game
-- | Play a game in a window, using IO actions to build the pictures.
playIO :: Display -> Color -> Int -> world -> (world -> IO Picture) -> (Event -> world -> IO world) -> (Float -> world -> IO world) -> IO ()
-- | Possible input events.
data Event
EventKey :: Key -> KeyState -> Modifiers -> (Float, Float) -> Event
EventMotion :: (Float, Float) -> Event
data Key
Char :: Char -> Key
SpecialKey :: SpecialKey -> Key
MouseButton :: MouseButton -> Key
data SpecialKey
KeyUnknown :: SpecialKey
KeySpace :: SpecialKey
KeyEsc :: 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
KeyF13 :: SpecialKey
KeyF14 :: SpecialKey
KeyF15 :: SpecialKey
KeyF16 :: SpecialKey
KeyF17 :: SpecialKey
KeyF18 :: SpecialKey
KeyF19 :: SpecialKey
KeyF20 :: SpecialKey
KeyF21 :: SpecialKey
KeyF22 :: SpecialKey
KeyF23 :: SpecialKey
KeyF24 :: SpecialKey
KeyF25 :: SpecialKey
KeyUp :: SpecialKey
KeyDown :: SpecialKey
KeyLeft :: SpecialKey
KeyRight :: SpecialKey
KeyTab :: SpecialKey
KeyEnter :: SpecialKey
KeyBackspace :: SpecialKey
KeyInsert :: SpecialKey
KeyNumLock :: SpecialKey
KeyBegin :: SpecialKey
KeyDelete :: SpecialKey
KeyPageUp :: SpecialKey
KeyPageDown :: SpecialKey
KeyHome :: SpecialKey
KeyEnd :: SpecialKey
KeyPad0 :: SpecialKey
KeyPad1 :: SpecialKey
KeyPad2 :: SpecialKey
KeyPad3 :: SpecialKey
KeyPad4 :: SpecialKey
KeyPad5 :: SpecialKey
KeyPad6 :: SpecialKey
KeyPad7 :: SpecialKey
KeyPad8 :: SpecialKey
KeyPad9 :: SpecialKey
KeyPadDivide :: SpecialKey
KeyPadMultiply :: SpecialKey
KeyPadSubtract :: SpecialKey
KeyPadAdd :: SpecialKey
KeyPadDecimal :: SpecialKey
KeyPadEqual :: SpecialKey
KeyPadEnter :: SpecialKey
data MouseButton
LeftButton :: MouseButton
MiddleButton :: MouseButton
RightButton :: MouseButton
WheelUp :: MouseButton
WheelDown :: MouseButton
AdditionalButton :: Int -> MouseButton
data KeyState
Down :: KeyState
Up :: KeyState
data Modifiers
Modifiers :: KeyState -> KeyState -> KeyState -> Modifiers
shift :: Modifiers -> KeyState
ctrl :: Modifiers -> KeyState
alt :: Modifiers -> KeyState
-- | Gloss hides the pain of drawing simple vector graphics behind a nice
-- data type and a few display functions.
--
-- Getting something on the screen is as easy as:
--
-- <pre>
-- import Graphics.Gloss
-- main = <a>display</a> (InWindow "Nice Window" (200, 200) (10, 10)) <a>white</a> (<a>Circle</a> 80)
-- </pre>
--
-- Once the window is open you can use the following:
--
-- <ul>
-- <li>Quit - esc-key.</li>
-- <li>Move Viewport - left-click drag, arrow keys.</li>
-- <li>Rotate Viewport - right-click drag, control-left-click drag, or
-- home/end-keys.</li>
-- <li>Zoom Viewport - mouse wheel, or page up/down-keys.</li>
-- </ul>
--
-- Animations can be constructed similarly using the <a>animate</a>.
--
-- If you want to run a simulation based around finite time steps then
-- try <a>simulate</a>.
--
-- If you want to manage your own key/mouse events then use <a>play</a>.
--
-- Gloss uses OpenGL under the hood, but you don't have to worry about
-- any of that.
--
-- Gloss programs should be compiled with <tt>-threaded</tt>, otherwise
-- the GHC runtime will limit the frame-rate to around 20Hz.
--
-- <pre>
-- Release Notes:
--
-- For 1.7.0:
-- * Tweaked circle level-of-detail reduction code.
-- * Increased frame rate cap to 100hz.
-- Thanks to Doug Burke
-- * Primitives for drawing arcs and sectors.
-- Thanks to Thomas DuBuisson
-- * IO versions of animate, simplate and play.
--
-- For 1.6.0:
-- Thanks to Anthony Cowley
-- * Full screen display mode.
--
-- For 1.5.0:
-- * O(1) Conversion of ForeignPtrs to bitmaps.
-- * An extra flag on the Bitmap constructor allows bitmaps to be cached
-- in texture memory between frames.
--
-- For 1.4.0:
-- Thanks to Christiaan Baaij:
-- * Refactoring of Gloss internals to support multiple window manager backends.
-- * Support for using GLFW as the window library instead of GLUT.
-- GLUT is still the default, but to use GLFW install gloss with:
-- cabal install gloss --flags="GLFW -GLUT"
-- </pre>
--
-- For more information, check out <a>http://gloss.ouroborus.net</a>.
module Graphics.Gloss
-- | Describes how Gloss should display its output.
data Display
-- | Display in a window with the given name, size and position.
InWindow :: String -> (Int, Int) -> (Int, Int) -> Display
-- | Display full screen with a drawing area of the given size.
FullScreen :: (Int, Int) -> Display
-- | Open a new window and display the given picture.
--
-- Use the following commands once the window is open:
--
-- <ul>
-- <li>Quit - esc-key.</li>
-- <li>Move Viewport - left-click drag, arrow keys.</li>
-- <li>Rotate Viewport - right-click drag, control-left-click drag, or
-- home/end-keys.</li>
-- <li>Zoom Viewport - mouse wheel, or page up/down-keys.</li>
-- </ul>
display :: Display -> Color -> Picture -> IO ()
-- | Open a new window and display the given animation.
--
-- Once the window is open you can use the same commands as with
-- <tt>display</tt>.
animate :: Display -> Color -> (Float -> Picture) -> IO ()
-- | Run a finite-time-step simulation in a window. You decide how the
-- model is represented, how to convert the model to a picture, and how
-- to advance the model for each unit of time. This function does the
-- rest.
--
-- Once the window is open you can use the same commands as with
-- <tt>display</tt>.
simulate :: Display -> Color -> Int -> model -> (model -> Picture) -> (ViewPort -> Float -> model -> model) -> IO ()
-- | Play a game in a window.
play :: Display -> Color -> Int -> world -> (world -> Picture) -> (Event -> world -> world) -> (Float -> world -> world) -> IO ()
|