diff options
author | Csaba Hruska <csaba.hruska@gmail.com> | 2016-01-29 15:25:49 +0100 |
---|---|---|
committer | Csaba Hruska <csaba.hruska@gmail.com> | 2016-01-29 15:25:49 +0100 |
commit | 32646973035dcb3f35c7501d0654607dfaeec091 (patch) | |
tree | b92156c74372af734da74342e4a4a0a12d6a8fdf /examples/HelloJson.hs | |
parent | 0d46a5cda433fe1a97f3c35002c192d8050e747a (diff) |
simplify Mesh data add some missing function
Diffstat (limited to 'examples/HelloJson.hs')
-rw-r--r-- | examples/HelloJson.hs | 12 |
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 #-} |
2 | import "GLFW-b" Graphics.UI.GLFW as GLFW | 2 | import "GLFW-b" Graphics.UI.GLFW as GLFW |
3 | import qualified Data.Map as Map | 3 | import qualified Data.Map as Map |
4 | import qualified Data.Vector.Storable as SV | 4 | import qualified Data.Vector as V |
5 | 5 | ||
6 | import LambdaCube.GL as LambdaCubeGL -- renderer | 6 | import LambdaCube.GL as LambdaCubeGL -- renderer |
7 | import LambdaCube.GL.Mesh as LambdaCubeGL | 7 | import LambdaCube.GL.Mesh as LambdaCubeGL |
@@ -67,21 +67,19 @@ main = do | |||
67 | triangleA :: LambdaCubeGL.Mesh | 67 | triangleA :: LambdaCubeGL.Mesh |
68 | triangleA = Mesh | 68 | triangleA = 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 | ||
77 | triangleB :: LambdaCubeGL.Mesh | 76 | triangleB :: LambdaCubeGL.Mesh |
78 | triangleB = Mesh | 77 | triangleB = 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 | ||
87 | initWindow :: String -> Int -> Int -> IO Window | 85 | initWindow :: String -> Int -> Int -> IO Window |