diff options
author | Joe Crayne <joe@jerkface.net> | 2019-04-07 02:53:16 -0400 |
---|---|---|
committer | Joe Crayne <joe@jerkface.net> | 2019-04-07 02:53:16 -0400 |
commit | 483ffac7da055342598b44800e69ee5217cb47cd (patch) | |
tree | f2c5780ea4bbcbfd443a3c77cd789d34905e2d90 /hello.lc |
initial commit
Diffstat (limited to 'hello.lc')
-rw-r--r-- | hello.lc | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/hello.lc b/hello.lc new file mode 100644 index 0000000..5837a82 --- /dev/null +++ b/hello.lc | |||
@@ -0,0 +1,16 @@ | |||
1 | makeFrame (time :: Float) | ||
2 | (texture :: Texture) | ||
3 | (prims :: PrimitiveStream Triangle (Vec 2 Float, Vec 2 Float)) | ||
4 | |||
5 | = imageFrame ((emptyColorImage (V4 0 0 0.4 1))) | ||
6 | `overlay` | ||
7 | prims | ||
8 | & mapPrimitives (\(p,uv) -> (rotMatrixZ time *. (V4 p%x p%y (-1) 1), uv)) | ||
9 | & rasterizePrimitives (TriangleCtx CullNone PolygonFill NoOffset LastVertex) ((Smooth)) | ||
10 | & mapFragments (\((uv)) -> ((texture2D (Sampler PointFilter MirroredRepeat texture) uv))) | ||
11 | & accumulateWith ((ColorOp NoBlending (V4 True True True True))) | ||
12 | |||
13 | main = renderFrame $ | ||
14 | makeFrame (Uniform "time") | ||
15 | (Texture2DSlot "diffuseTexture") | ||
16 | (fetch "objects" (Attribute "position", Attribute "uv")) | ||