diff options
Diffstat (limited to 'MeshSketch.hs')
-rw-r--r-- | MeshSketch.hs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/MeshSketch.hs b/MeshSketch.hs index d598bbd..8660119 100644 --- a/MeshSketch.hs +++ b/MeshSketch.hs | |||
@@ -59,7 +59,8 @@ import LoadMesh | |||
59 | import InfinitePlane | 59 | import InfinitePlane |
60 | import MtlParser (ObjMaterial(..)) | 60 | import MtlParser (ObjMaterial(..)) |
61 | import Matrix | 61 | import Matrix |
62 | import PointPrimitiveRing | 62 | import GPURing as GPU |
63 | import RingBuffer | ||
63 | import MaskableStream (AttributeKey,(@<-)) | 64 | import MaskableStream (AttributeKey,(@<-)) |
64 | import SmallRing | 65 | import SmallRing |
65 | 66 | ||
@@ -103,7 +104,7 @@ data State = State | |||
103 | , stSkybox :: IORef Int | 104 | , stSkybox :: IORef Int |
104 | , stSkyTexture :: IORef TextureCubeData | 105 | , stSkyTexture :: IORef TextureCubeData |
105 | , stDragFrom :: IORef (Maybe (Vector Float,Camera)) | 106 | , stDragFrom :: IORef (Maybe (Vector Float,Camera)) |
106 | , stRingBuffer :: Ring RingPoint | 107 | , stRingBuffer :: RingBuffer (GPU.Update RingPoint) |
107 | , stPenDown :: IORef Bool | 108 | , stPenDown :: IORef Bool |
108 | , stPlane :: IORef (Maybe Plane) | 109 | , stPlane :: IORef (Maybe Plane) |
109 | , stDragPlane :: IORef (Maybe (Vector Float,Plane)) | 110 | , stDragPlane :: IORef (Maybe (Vector Float,Plane)) |
@@ -204,7 +205,7 @@ uploadState obj glarea storage = do | |||
204 | -- grid plane | 205 | -- grid plane |
205 | uploadMeshToGPU xzplane >>= addMeshToObjectArray storage "plane" [] | 206 | uploadMeshToGPU xzplane >>= addMeshToObjectArray storage "plane" [] |
206 | 207 | ||
207 | ring <- newRing storage 100 ringPointAttr | 208 | ring <- newRing 100 (GPU.new storage ringPointAttr 100) |
208 | 209 | ||
209 | -- setup FrameClock | 210 | -- setup FrameClock |
210 | w <- toWidget glarea | 211 | w <- toWidget glarea |
@@ -298,7 +299,7 @@ setUniforms gl storage st = do | |||
298 | "CameraPosition" @= return (pos :: Vector Float) | 299 | "CameraPosition" @= return (pos :: Vector Float) |
299 | "ViewProjection" @= return (mvp :: Matrix Float) | 300 | "ViewProjection" @= return (mvp :: Matrix Float) |
300 | "PlaneModel" @= return planeModel | 301 | "PlaneModel" @= return planeModel |
301 | updateRingUniforms storage (stRingBuffer st) | 302 | -- updateRingUniforms storage (stRingBuffer st) |
302 | 303 | ||
303 | data MeshSketch = MeshSketch | 304 | data MeshSketch = MeshSketch |
304 | { mmWidget :: GLArea | 305 | { mmWidget :: GLArea |