reactive-glut 0.1.9 → 0.1.10
raw patch · 8 files changed
+23/−65 lines, 8 filesdep ~base
Dependency ranges changed: base
Files
- Makefile +0/−1
- README +0/−14
- reactive-glut.cabal +3/−3
- src/.ghci +0/−2
- src/CheckTimes.hs +0/−17
- src/FRP/Reactive/GLUT/SimpleGL.hs +6/−4
- src/Test.hs +14/−6
- wikipage.tw +0/−18
− Makefile
@@ -1,1 +0,0 @@-include ../cho-cabal-make.inc
− README
@@ -1,14 +0,0 @@-reactive-glut [1] connects the Reactive [2] and GLUT [3] packages.--You can configure, build, and install all in the usual way with Cabal-commands.-- runhaskell Setup.lhs configure- runhaskell Setup.lhs build- runhaskell Setup.lhs install--References:--[1] http://haskell.org/haskellwiki/reactive-glut-[2] http://haskell.org/haskellwiki/reactive-[3] http://hackage.haskell.org/cgi-bin/hackage-scripts/package/GLUT
reactive-glut.cabal view
@@ -1,5 +1,5 @@ Name: reactive-glut-Version: 0.1.9+Version: 0.1.10 Cabal-Version: >= 1.2 Synopsis: Connects Reactive and GLUT Category: FRP, graphics@@ -12,7 +12,7 @@ © 2008 by Conal Elliott; BSD3 license. . With contributions from Andy Gill, David Sankel, Eyal Lotem, Claus Reinke,- and Achim Schneider.+ Achim Schneider, and Alexander Göransson. Author: Conal Elliott Maintainer: conal@conal.net@@ -26,7 +26,7 @@ Library hs-Source-Dirs: src Extensions:- Build-Depends: base, old-time, OpenGL, GLUT, vector-space, reactive >= 0.10.7+ Build-Depends: base<5, old-time, OpenGL, GLUT, vector-space, reactive >= 0.10.7 Exposed-Modules: FRP.Reactive.GLUT.Adapter Other-Modules:
− src/.ghci
@@ -1,2 +0,0 @@--- While actively tweaking Reactive, make its sources visible to ghci--- :set -i../../reactive/src
− src/CheckTimes.hs
@@ -1,17 +0,0 @@--- Hack to check some timings. Requires some editor magic to format times.--import Data.List (findIndices)--ts :: [Float]--ts = [6.484375,6.5,6.515625,6.53125,6.5625,6.578125,6.59375,6.609375,6.625]--diffs xs = uncurry subtract `fmap` (xs `zip` tail xs)--ds = diffs ts--es = (round . (* 100000)) `fmap` ds--esi = findIndices (> 20) es-esid = diffs esi-
src/FRP/Reactive/GLUT/SimpleGL.hs view
@@ -38,11 +38,11 @@ -- | Simple initialization for GL graphics simpleInit :: String -> IO () simpleInit title = do- do getArgsAndInitialize+ do _ <- getArgsAndInitialize initialDisplayMode $= [ DoubleBuffered, RGBAMode, WithDepthBuffer, WithAlphaComponent ] initialWindowSize $= Size 800 600- createWindow title+ _ <- createWindow title get windowSize >>= resizeScene @@ -109,11 +109,13 @@ -- go backward through the viewing transform to the XY plane. windowPoint :: Position -> IO (Double, Double) windowPoint (Position x y) = do Size w h <- get windowSize- return (f w x, - f h y)+ let w' = fromIntegral w+ h' = fromIntegral h+ return (f w' x, - f h' y) where -- Scale and translate coordinate. Put zero at the center, and give one -- unit to 100 pixels.- -- f _ z = realToFrac z+ f :: GLint -> GLint -> Double f maxZ z = realToFrac (z - (maxZ `div` 2)) / 100
src/Test.hs view
@@ -19,6 +19,7 @@ import FRP.Reactive (Behavior,time) import FRP.Reactive.GLUT.Adapter + main :: IO () main = adaptSimple "Reactive on GLUT" $ (fmap.fmap) view t2 @@ -26,18 +27,24 @@ t1, t2 :: G -t1 = const (pure (drawBox (0::Double,0)))+t1 = const (pure (drawBox zeros))+ where+ zeros :: (G.GLdouble,G.GLdouble)+ zeros = (0,0) -t2 = const (f <$> time)- where- f t = drawBox (t',t') where t' = t * 1 +t2 = const (f <$> fmap realToFrac time)+ where+ f t = drawBox (t',t')+ where+ t' = t * 1 :: G.GLdouble + ---- Utilities view :: IO () -> IO () view act = G.preservingMatrix $- do G.translate (G.Vector3 0 0 (-30 :: Double))+ do G.translate (G.Vector3 0 0 (-30 :: G.GLdouble)) act @@ -49,5 +56,6 @@ do G.translate $ G.Vector3 centerX centerY 0 G.renderPrimitive G.Polygon (mapM_ vertexPF ps) where- ps :: [(Float,Float)]+ ps :: [(G.GLfloat,G.GLfloat)] ps = [(-1,-1),(-1,1),(1,1),(1,-1)]+
− wikipage.tw
@@ -1,18 +0,0 @@-[[Category:Packages]]-[[Category:FRP]]-[[Category:Graphics]]-[[Category:3D]]--== Abstract ==--'''reactive-glut''' connects [[Reactive]] with [[OpenGL#Additional_software|GLUT]].-It also serves as a demonstration for how to hook up imperative (i.e., legacy) libraries [[Reactive]].-For a functional alternative to OpenGL/GLUT and reactive-glut, see [[FieldTrip]] and [[reactive-fieldtrip]].--Besides this wiki page, here are more ways to find out about reactive-glut:-* Visit the [http://hackage.haskell.org/cgi-bin/hackage-scripts/package/reactive-glut Hackage page] for library documentation and to download & install.-* Or install with <tt>cabal install reactive-glut</tt>.-* Get the code repository: <tt>darcs get http://code.haskell.org/reactive-glut</tt>.-<!-- * See the [[reactive-glut/Versions| version history]]. -->--Please leave comments at the [[Talk:reactive-glut|Talk page]].