diff options
author | Péter Diviánszky <divipp@gmail.com> | 2016-02-18 18:34:47 +0100 |
---|---|---|
committer | Péter Diviánszky <divipp@gmail.com> | 2016-02-19 02:50:09 +0100 |
commit | 998ae8f884f4b1d4e092ebdf3a441b97b2cf05b7 (patch) | |
tree | 6ced17ee38fa78de69b05c8765288ecabe52fb6e /testdata/Graphics.lc | |
parent | 27c8f3aeb2d13da0bec522ee8a8a98f534fa39e8 (diff) |
tuples are heterogeneous lists
Diffstat (limited to 'testdata/Graphics.lc')
-rw-r--r-- | testdata/Graphics.lc | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/testdata/Graphics.lc b/testdata/Graphics.lc index a9a87021..29c110da 100644 --- a/testdata/Graphics.lc +++ b/testdata/Graphics.lc | |||
@@ -229,7 +229,7 @@ mkVertexShader ca sa = \(p,n,d,l,c) -> | |||
229 | --saTxName sa = saTextureUniform sa | 229 | --saTxName sa = saTextureUniform sa |
230 | saTextureUniform' (StageAttrs _ _ _ _ _ _ _ _ _ _ a) = a | 230 | saTextureUniform' (StageAttrs _ _ _ _ _ _ _ _ _ _ a) = a |
231 | 231 | ||
232 | mkFragmentShader :: StageAttrs -> (Vec 2 Float,Vec 4 Float) -> Vec 4 Float | 232 | mkFragmentShader :: StageAttrs -> (Vec 2 Float,Vec 4 Float) -> ((Vec 4 Float)) |
233 | mkFragmentShader sa{- @(StageAttrs _ _ _ _ _ _ _ _ _ _ texName)-} = \(uv,rgba) -> | 233 | mkFragmentShader sa{- @(StageAttrs _ _ _ _ _ _ _ _ _ _ texName)-} = \(uv,rgba) -> |
234 | let | 234 | let |
235 | texName = saTextureUniform' sa | 235 | texName = saTextureUniform' sa |
@@ -240,7 +240,7 @@ mkFragmentShader sa{- @(StageAttrs _ _ _ _ _ _ _ _ _ _ texName)-} = \(uv,rgba) - | |||
240 | ST_Map _ -> rgba * texColor Repeat texName | 240 | ST_Map _ -> rgba * texColor Repeat texName |
241 | ST_ClampMap _ -> rgba * texColor ClampToEdge texName | 241 | ST_ClampMap _ -> rgba * texColor ClampToEdge texName |
242 | ST_AnimMap _ _ -> rgba * texColor Repeat texName | 242 | ST_AnimMap _ _ -> rgba * texColor Repeat texName |
243 | in color | 243 | in ((color)) |
244 | 244 | ||
245 | mkFilterFunction :: StageAttrs -> Maybe ((Vec 2 Float,Vec 4 Float) -> Bool) | 245 | mkFilterFunction :: StageAttrs -> Maybe ((Vec 2 Float,Vec 4 Float) -> Bool) |
246 | mkFilterFunction sa = case saAlphaFunc sa of | 246 | mkFilterFunction sa = case saAlphaFunc sa of |
@@ -306,10 +306,10 @@ errorShaderFill fb = accumulate fragCtx frag rast fb | |||
306 | rastCtx = TriangleCtx CullNone PolygonFill NoOffset LastVertex | 306 | rastCtx = TriangleCtx CullNone PolygonFill NoOffset LastVertex |
307 | input = fetch "missing shader" Triangle (Attribute "position" :: Vec 3 Float, Attribute "color" :: Vec 4 Float) | 307 | input = fetch "missing shader" Triangle (Attribute "position" :: Vec 3 Float, Attribute "color" :: Vec 4 Float) |
308 | prims = mapPrimitives vert input | 308 | prims = mapPrimitives vert input |
309 | rast = rasterizePrimitives rastCtx Smooth prims | 309 | rast = rasterizePrimitives rastCtx ((Smooth)) prims |
310 | 310 | ||
311 | -- frag :: Vec 4 Float -> (Depth Float, Color (Vec 4 Float)) | 311 | -- frag :: Vec 4 Float -> (Depth Float, Color (Vec 4 Float)) |
312 | frag = \v -> v | 312 | frag = \((v)) -> ((v)) |
313 | 313 | ||
314 | errorShader :: FB -> FB | 314 | errorShader :: FB -> FB |
315 | errorShader fb = accumulate fragCtx frag rast (errorShaderFill fb) | 315 | errorShader fb = accumulate fragCtx frag rast (errorShaderFill fb) |
@@ -327,12 +327,12 @@ errorShader fb = accumulate fragCtx frag rast (errorShaderFill fb) | |||
327 | rastCtx = TriangleCtx CullNone (PolygonLine 1) offset LastVertex | 327 | rastCtx = TriangleCtx CullNone (PolygonLine 1) offset LastVertex |
328 | input = fetch "missing shader" Triangle (Attribute "position" :: Vec 3 Float, Attribute "color" :: Vec 4 Float) | 328 | input = fetch "missing shader" Triangle (Attribute "position" :: Vec 3 Float, Attribute "color" :: Vec 4 Float) |
329 | prims = mapPrimitives vert input | 329 | prims = mapPrimitives vert input |
330 | rast = rasterizePrimitives rastCtx Smooth prims | 330 | rast = rasterizePrimitives rastCtx ((Smooth)) prims |
331 | 331 | ||
332 | -- frag :: Vec 4 Float -> (Depth Float, Color (Vec 4 Float)) | 332 | -- frag :: Vec 4 Float -> (Depth Float, Color (Vec 4 Float)) |
333 | frag = \v -> let | 333 | frag = \((v)) -> let |
334 | one = 1 | 334 | one = 1 |
335 | in V4 (one -! v%r) (one -! v%g) (one -! v%b) one | 335 | in ((V4 (one -! v%r) (one -! v%g) (one -! v%b) one)) |
336 | 336 | ||
337 | q3GFX :: [(String,CommonAttrs)] -> FB | 337 | q3GFX :: [(String,CommonAttrs)] -> FB |
338 | q3GFX shl = {-blurVH $ PrjFrameBuffer "" tix0 $ -}errorShader (foldl' mkShader clear ordered) | 338 | q3GFX shl = {-blurVH $ PrjFrameBuffer "" tix0 $ -}errorShader (foldl' mkShader clear ordered) |