diff options
author | Joe Crayne <joe@jerkface.net> | 2019-04-30 22:59:13 -0400 |
---|---|---|
committer | Joe Crayne <joe@jerkface.net> | 2019-04-30 22:59:13 -0400 |
commit | fce8237d59397054ea467fd9b5357877342dc34b (patch) | |
tree | 8ce3ff02c5ad8edec01f54aa396005e54c1c1a98 /MeshSketch.hs | |
parent | 3a959223200961dedef69a28146662077aa0e093 (diff) |
This seems to work to use skycube and object texturing together.
Diffstat (limited to 'MeshSketch.hs')
-rw-r--r-- | MeshSketch.hs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/MeshSketch.hs b/MeshSketch.hs index 70493bd..8c46d54 100644 --- a/MeshSketch.hs +++ b/MeshSketch.hs | |||
@@ -31,6 +31,8 @@ import LambdaCube.GL as LC | |||
31 | import LambdaCube.IR as LC | 31 | import LambdaCube.IR as LC |
32 | import LambdaCube.Gtk | 32 | import LambdaCube.Gtk |
33 | import LambdaCube.GL.Data (uploadCubeMapToGPU) | 33 | import LambdaCube.GL.Data (uploadCubeMapToGPU) |
34 | import LambdaCube.GL.Type (TextureData(..)) | ||
35 | import Text.Show.Pretty (ppShow) | ||
34 | 36 | ||
35 | import CubeMap | 37 | import CubeMap |
36 | import GLWidget (nullableContext, withCurrentGL) | 38 | import GLWidget (nullableContext, withCurrentGL) |
@@ -41,6 +43,7 @@ import LoadMesh | |||
41 | import InfinitePlane | 43 | import InfinitePlane |
42 | import MtlParser (ObjMaterial(..)) | 44 | import MtlParser (ObjMaterial(..)) |
43 | import Matrix | 45 | import Matrix |
46 | import SavedPipeline | ||
44 | 47 | ||
45 | -- State created by uploadState. | 48 | -- State created by uploadState. |
46 | data State = State | 49 | data State = State |
@@ -193,7 +196,8 @@ new = do | |||
193 | m <- do | 196 | m <- do |
194 | objName <- head . (++ ["cube.obj"]) <$> getArgs | 197 | objName <- head . (++ ["cube.obj"]) <$> getArgs |
195 | mobj <- loadOBJ objName | 198 | mobj <- loadOBJ objName |
196 | mpipeline <- loadPipeline "hello_obj2.json" $ do | 199 | -- mpipeline <- loadPipeline "hello_obj2.json" $ do |
200 | mpipeline <- (\s -> return (Right (DynamicPipeline savedPipeline (makeSchema s)))) $ do | ||
197 | defObjectArray "SkyCube" Triangles $ do | 201 | defObjectArray "SkyCube" Triangles $ do |
198 | "position" @: Attribute_V3F | 202 | "position" @: Attribute_V3F |
199 | defObjectArray "objects" Triangles $ do | 203 | defObjectArray "objects" Triangles $ do |
@@ -211,6 +215,8 @@ new = do | |||
211 | return $ (,) <$> mobj <*> mpipeline | 215 | return $ (,) <$> mobj <*> mpipeline |
212 | either (\e _ -> hPutStrLn stderr e >> throwIO (userError e)) (&) m $ \(obj,pipeline) -> do | 216 | either (\e _ -> hPutStrLn stderr e >> throwIO (userError e)) (&) m $ \(obj,pipeline) -> do |
213 | 217 | ||
218 | -- putStrLn $ ppShow (dynamicPipeline pipeline) | ||
219 | |||
214 | ref <- newIORef Nothing | 220 | ref <- newIORef Nothing |
215 | -- glarea <- newGLWidget return (lambdaRender app glmethods) | 221 | -- glarea <- newGLWidget return (lambdaRender app glmethods) |
216 | do | 222 | do |