summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Crayne <joe@jerkface.net>2019-05-13 19:22:13 -0400
committerJoe Crayne <joe@jerkface.net>2019-05-13 19:22:13 -0400
commit9f99af1750924a0be6e003842830aec93380dfdc (patch)
tree54f67d7600310272d4db7a9ba0024366503f6308
parent4c5fe84a424cf6329c7b8cb305d6958ed33b62e6 (diff)
Use distinct types for TextureData and TextureCubeData.
-rw-r--r--MeshSketch.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/MeshSketch.hs b/MeshSketch.hs
index 440a2f7..b84cd7e 100644
--- a/MeshSketch.hs
+++ b/MeshSketch.hs
@@ -31,7 +31,7 @@ import LambdaCube.GL as LC
31import LambdaCube.IR as LC 31import LambdaCube.IR as LC
32import LambdaCube.Gtk 32import LambdaCube.Gtk
33import LambdaCube.GL.Data (uploadCubeMapToGPU) 33import LambdaCube.GL.Data (uploadCubeMapToGPU)
34import LambdaCube.GL.Type (TextureData(..)) 34import LambdaCube.GL.Type (TextureCubeData(..))
35-- import Text.Show.Pretty (ppShow) 35-- import Text.Show.Pretty (ppShow)
36 36
37import CubeMap 37import CubeMap
@@ -51,7 +51,7 @@ data State = State
51 , stFullscreen :: IO () 51 , stFullscreen :: IO ()
52 , stSkyboxes :: Skyboxes 52 , stSkyboxes :: Skyboxes
53 , stSkybox :: IORef Int 53 , stSkybox :: IORef Int
54 , stSkyTexture :: IORef TextureData 54 , stSkyTexture :: IORef TextureCubeData
55 , stDragFrom :: IORef (Maybe (Vector Float,Camera)) 55 , stDragFrom :: IORef (Maybe (Vector Float,Camera))
56 } 56 }
57 57
@@ -140,7 +140,7 @@ uploadState obj glarea storage = do
140 return skybox_id 140 return skybox_id
141 Left msg -> do 141 Left msg -> do
142 putStrLn msg 142 putStrLn msg
143 return (TextureData 0) 143 return (TextureCubeName 0)
144 skytex <- newIORef skybox_id 144 skytex <- newIORef skybox_id
145 mi <- LC.uploadMeshToGPU cubeMesh 145 mi <- LC.uploadMeshToGPU cubeMesh
146 LC.addMeshToObjectArray storage "SkyCube" [] mi 146 LC.addMeshToObjectArray storage "SkyCube" [] mi
@@ -464,7 +464,7 @@ onEvent w realized ev = do
464 idx <- readIORef (stSkybox st) 464 idx <- readIORef (stSkybox st)
465 when (skyboxCount (stSkyboxes st) > 1) $ do 465 when (skyboxCount (stSkyboxes st) > 1) $ do
466 Right ts <- skyboxLoad (stSkyboxes st) idx 466 Right ts <- skyboxLoad (stSkyboxes st) idx
467 disposeTexture =<< readIORef (stSkyTexture st) 467 disposeTextureCube =<< readIORef (stSkyTexture st)
468 skybox_id <- uploadCubeMapToGPU ts 468 skybox_id <- uploadCubeMapToGPU ts
469 LC.updateUniforms (stStorage realized) $ do 469 LC.updateUniforms (stStorage realized) $ do
470 "CubeMap" @= return skybox_id 470 "CubeMap" @= return skybox_id