hylogen 0.1.1.1 → 0.1.1.2
raw patch · 6 files changed
+67/−58 lines, 6 filesnew-component:exe:hylide
Files
- README.md +7/−5
- hylogen.cabal +3/−3
- src/Hylogen/Globals.hs +3/−2
- src/Hylogen/Vec.hs +6/−0
- src/Hylogen/WithHyde.hs +0/−48
- src/Hylogen/WithHylide.hs +48/−0
README.md view
@@ -1,6 +1,8 @@ # [*H Y L O G E N*](https://hylogen.com) [](https://hackage.haskell.org/package/hylogen) ++ Hylogen is a purely functional language [embedded in Haskell](https://wiki.haskell.org/Embedded_domain_specific_language) for live-coding fragment shaders, featuring: - a simple and pure syntax@@ -9,7 +11,7 @@  -It comes with `hyde`, an accompanying rendering environment featuring:+It comes with `hylide`, an accompanying rendering environment featuring: - *hot-reloading* - audio-reactive primitives - texture backbuffering@@ -23,7 +25,7 @@ cabal install hylogen ``` -This will install the hylogen package and `hyde`, the rendering environment.+This will install the hylogen package and `hylide`, the rendering environment.  @@ -32,7 +34,7 @@ ```haskell -- ./Main.hs module Main where-import Hylogen.WithHyde+import Hylogen.WithHylide color = vec4 (a, a, a, 1) where@@ -42,10 +44,10 @@ main = putStrLn . toGLSL $ color ``` -#### 1. run hyde...+#### 1. run hylo... ```-hyde Main.hs+hylo Main.hs ``` #### 2. ... live-code!
hylogen.cabal view
@@ -1,5 +1,5 @@ name: hylogen-version: 0.1.1.1+version: 0.1.1.2 synopsis: an EDSL for live-coding fragment shaders description: an EDSL for live-coding fragment shaders homepage: https://hylogen.com@@ -24,14 +24,14 @@ , Hylogen.Texture , Hylogen.Globals , Hylogen.Program- , Hylogen.WithHyde+ , Hylogen.WithHylide build-depends: base >=4.8 && <4.9 , vector-space , data-reify hs-source-dirs: src default-language: Haskell2010 -executable hyde+executable hylide main-is: Main.hs other-extensions: OverloadedStrings other-modules: Paths_hylogen
src/Hylogen/Globals.hs view
@@ -42,8 +42,9 @@ -mix :: Vec1 -> Vec4 -> Vec4 -> Vec4-mix p a b = p *^ a + (1 - p) *^ b+mix :: (Veccable n) => Vec1 -> Vec n -> Vec n -> Vec n+mix p x y = op3pre "mix" x y p+-- mix p x y = x ^* (1 - p) + y ^* p true :: Booly true = uniform "true"
src/Hylogen/Vec.hs view
@@ -148,6 +148,12 @@ type OutputDim W = 1 swizzShow _ = "w" +data XYZ = XYZ+instance Swizzle XYZ where+ type InputMin XYZ = 3+ type OutputDim XYZ = 3+ swizzShow _ = "xyz"+ -- TODO: finish swizzling!
− src/Hylogen/WithHyde.hs
@@ -1,48 +0,0 @@-module Hylogen.WithHyde ( module Hylogen.WithHyde- , module Hylogen- ) where--import Data.Monoid-import Hylogen-import Hylogen.Expr-import Hylogen.Program (toProgram)---- TODO: flip these definitions! Normalized means ??-uv :: Vec2-uv = uniform "uv()"--uvN :: Vec2-uvN = uniform "uvN"--time :: Vec1-time = uniform "time"---resolution :: Vec2-resolution = uniform "resolution"--mouse :: Vec2-mouse = uniform "mouse"---audio :: Vec4-audio = uniform "audio"--backBuffer :: Texture-backBuffer = uniform "backBuffer"--channel1 :: Texture-channel1 = uniform "channel1"----- | No sharing-toGLSL' :: Vec4 -> String-toGLSL' v = unlines [ "void main() {"- , " gl_FragColor = " <> show v <> ";"- , "}"- ]----- | sharing via Data.reify-toGLSL :: Vec4 -> String-toGLSL = show . toProgram . toMono
+ src/Hylogen/WithHylide.hs view
@@ -0,0 +1,48 @@+module Hylogen.WithHylide ( module Hylogen.WithHylide+ , module Hylogen+ ) where++import Data.Monoid+import Hylogen+import Hylogen.Expr+import Hylogen.Program (toProgram)++-- TODO: flip these definitions! Normalized means ??+uv :: Vec2+uv = uniform "uv()"++uvN :: Vec2+uvN = uniform "uvN"++time :: Vec1+time = uniform "time"+++resolution :: Vec2+resolution = uniform "resolution"++mouse :: Vec2+mouse = uniform "mouse"+++audio :: Vec4+audio = uniform "audio"++backBuffer :: Texture+backBuffer = uniform "backBuffer"++channel1 :: Texture+channel1 = uniform "channel1"+++-- | No sharing+toGLSL' :: Vec4 -> String+toGLSL' v = unlines [ "void main() {"+ , " gl_FragColor = " <> show v <> ";"+ , "}"+ ]+++-- | sharing via Data.reify+toGLSL :: Vec4 -> String+toGLSL = show . toProgram . toMono