summaryrefslogtreecommitdiff
path: root/examples/HelloJson.hs
diff options
context:
space:
mode:
authorCsaba Hruska <csaba.hruska@gmail.com>2016-01-29 15:25:49 +0100
committerCsaba Hruska <csaba.hruska@gmail.com>2016-01-29 15:25:49 +0100
commit32646973035dcb3f35c7501d0654607dfaeec091 (patch)
treeb92156c74372af734da74342e4a4a0a12d6a8fdf /examples/HelloJson.hs
parent0d46a5cda433fe1a97f3c35002c192d8050e747a (diff)
simplify Mesh data add some missing function
Diffstat (limited to 'examples/HelloJson.hs')
-rw-r--r--examples/HelloJson.hs12
1 files changed, 5 insertions, 7 deletions
diff --git a/examples/HelloJson.hs b/examples/HelloJson.hs
index 45821f7..081fd93 100644
--- a/examples/HelloJson.hs
+++ b/examples/HelloJson.hs
@@ -1,7 +1,7 @@
1{-# LANGUAGE PackageImports, LambdaCase, OverloadedStrings #-} 1{-# LANGUAGE PackageImports, LambdaCase, OverloadedStrings #-}
2import "GLFW-b" Graphics.UI.GLFW as GLFW 2import "GLFW-b" Graphics.UI.GLFW as GLFW
3import qualified Data.Map as Map 3import qualified Data.Map as Map
4import qualified Data.Vector.Storable as SV 4import qualified Data.Vector as V
5 5
6import LambdaCube.GL as LambdaCubeGL -- renderer 6import LambdaCube.GL as LambdaCubeGL -- renderer
7import LambdaCube.GL.Mesh as LambdaCubeGL 7import LambdaCube.GL.Mesh as LambdaCubeGL
@@ -67,21 +67,19 @@ main = do
67triangleA :: LambdaCubeGL.Mesh 67triangleA :: LambdaCubeGL.Mesh
68triangleA = Mesh 68triangleA = Mesh
69 { mAttributes = Map.fromList 69 { mAttributes = Map.fromList
70 [ ("position", A_V2F $ SV.fromList [V2 1 1, V2 1 (-1), V2 (-1) (-1)]) 70 [ ("position", A_V2F $ V.fromList [V2 1 1, V2 1 (-1), V2 (-1) (-1)])
71 , ("uv", A_V2F $ SV.fromList [V2 1 1, V2 0 1, V2 0 0]) 71 , ("uv", A_V2F $ V.fromList [V2 1 1, V2 0 1, V2 0 0])
72 ] 72 ]
73 , mPrimitive = P_Triangles 73 , mPrimitive = P_Triangles
74 , mGPUData = Nothing
75 } 74 }
76 75
77triangleB :: LambdaCubeGL.Mesh 76triangleB :: LambdaCubeGL.Mesh
78triangleB = Mesh 77triangleB = Mesh
79 { mAttributes = Map.fromList 78 { mAttributes = Map.fromList
80 [ ("position", A_V2F $ SV.fromList [V2 1 1, V2 (-1) (-1), V2 (-1) 1]) 79 [ ("position", A_V2F $ V.fromList [V2 1 1, V2 (-1) (-1), V2 (-1) 1])
81 , ("uv", A_V2F $ SV.fromList [V2 1 1, V2 0 0, V2 1 0]) 80 , ("uv", A_V2F $ V.fromList [V2 1 1, V2 0 0, V2 1 0])
82 ] 81 ]
83 , mPrimitive = P_Triangles 82 , mPrimitive = P_Triangles
84 , mGPUData = Nothing
85 } 83 }
86 84
87initWindow :: String -> Int -> Int -> IO Window 85initWindow :: String -> Int -> Int -> IO Window