lineVertices :: [Vec 3 Float] lineVertices = concat [[V3 i 0 0,V3 (i+!1.0) 0 0] | i <- [(-2)..2]] clear = FrameBuffer (DepthImage @1 1000, ColorImage @1 navy) -- ... lines = LineCtx 1.0 LastVertex colorFragmentCtx = (DepthOp Less True, ColorOp NoBlending (V4 True True True True)) cubeVertexStream = fetchArrays ((lineVertices)) rasterizeWith = rasterizePrimitives mapFragments2 s fs = accumulate colorFragmentCtx (\((a)) -> ((fs a))) s clear transform s f = mapPrimitives (\((p)) -> let v = v3FToV4F p in (f v, v)) s rotate' v = (Uniform "MVP" :: Mat 4 4 Float) *. v main = cubeVertexStream -- cube vertices `transform` (scale 0.5 . rotate') -- scale them & rasterizeWith lines ((Smooth)) -- rasterize `mapFragments2` id & ScreenOut -- draw into screen