Skip to content

Commit

Permalink
Fix Domain warping
Browse files Browse the repository at this point in the history
  • Loading branch information
alt-romes committed Jul 6, 2024
1 parent 0ecdac0 commit aac9266
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions examples/common/Common.hs
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ makeMainPipeline shaderPipeline = makeRenderPipeline (shaderPipeline WINDOW_SIZE
-- | we should be getting the window size dynamically (in ghengin utils we can even pass it automatically)
-- pattern WINDOW_SIZE = (3840, 2160)
-- pattern WINDOW_SIZE = (2560, 1600)
-- pattern WINDOW_SIZE = (1920, 1200)
pattern WINDOW_SIZE = (640, 480)
pattern WINDOW_SIZE = (1920, 1200)
-- pattern WINDOW_SIZE = (640, 480)

renderQueueWithViewport :: (Typeable w, Compatible '[Vec3] '[] '[] PipelineProps w, _) => ((Word32, Word32) -> G.ShaderPipeline w) -> Renderer (RenderQueue (), Ur (PipelineKey w PipelineProps))
renderQueueWithViewport sp = Linear.do
Expand Down
2 changes: 1 addition & 1 deletion examples/domain-warping/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ gameLoop (WithVec2 previousPosX previousPosY) pkey rq = Linear.do
Ur (double2Float -> newPosX, double2Float -> newPosY) <- (getMousePos )
liftSystemIO $ print (newPosX, newPosY)

let pos = vec2 (0.5 * (previousPosX + newPosX)) (0.5 * (previousPosY + newPosY))
let Ur pos = Ur $ vec2 (0.5 * (previousPosX + newPosX)) (0.5 * (previousPosY + newPosY))

rq' <- (editPipeline pkey rq (propertyAt @1 (\(Ur (Time time)) -> pure $ Ur $ Time ((time+0.001))) <=< propertyAt @0 (\(Ur _) -> pure $ Ur $ MousePos pos)) )

Expand Down

0 comments on commit aac9266

Please sign in to comment.