summaryrefslogtreecommitdiff
path: root/examples/hello.lc
diff options
context:
space:
mode:
authorCsaba Hruska <csaba.hruska@gmail.com>2016-01-10 22:58:12 +0100
committerCsaba Hruska <csaba.hruska@gmail.com>2016-01-10 22:58:12 +0100
commit2344d2af7eb3e5515408d134a074b989e7b5efde (patch)
tree01b905a55d0b8e0560097241dd2cd277f6bfab46 /examples/hello.lc
parente936d3c32c17c0d00939893fa85996c3807ed3e7 (diff)
update example
Diffstat (limited to 'examples/hello.lc')
-rw-r--r--examples/hello.lc12
1 files changed, 12 insertions, 0 deletions
diff --git a/examples/hello.lc b/examples/hello.lc
new file mode 100644
index 0000000..1087fbe
--- /dev/null
+++ b/examples/hello.lc
@@ -0,0 +1,12 @@
1sampler = Sampler PointFilter MirroredRepeat (Texture2DSlot "diffuseTexture")
2main = let
3 emptyFB = FrameBuffer (colorImage1 (V4 0.0 0.0 0.4 1.0))
4 rasterCtx = TriangleCtx CullNone PolygonFill NoOffset LastVertex
5 fragmentCtx = AccumulationContext (ColorOp NoBlending (V4 True True True True))
6 vertexShader (p,uv) = VertexOut (V4 p%x p%y (-1) 1) 1.0 () (Smooth uv)
7 vertexStream = Fetch "objects" Triangles (Attribute "position" :: Vec 2 Float, Attribute "uv" :: Vec 2 Float)
8 primitiveStream = Transform vertexShader vertexStream
9 fragmentStream = Rasterize rasterCtx primitiveStream
10 fragmentShader uv = FragmentOut $ texture2D sampler uv
11 frame = Accumulate fragmentCtx PassAll fragmentShader fragmentStream emptyFB
12 in ScreenOut frame