luminance-samples 0.10 → 0.11
raw patch · 9 files changed
+26/−35 lines, 9 filesdep ~luminance
Dependency ranges changed: luminance
Files
- CHANGELOG.md +5/−0
- luminance-samples.cabal +8/−8
- src/Blending.hs +3/−7
- src/Blit.hs +1/−2
- src/DepthTest.hs +2/−7
- src/HelloWorld.hs +1/−2
- src/HelloWorldUniform.hs +2/−3
- src/Texture.hs +2/−3
- src/UBO.hs +2/−3
CHANGELOG.md view
@@ -1,3 +1,8 @@+## 0.11++- Updated luminance dependency to include the latest version and break compatibility with older+ versions.+ ## 0.10 - Updated luminance dependency to include the latest version and break compatibility with older
luminance-samples.cabal view
@@ -1,5 +1,5 @@ name: luminance-samples-version: 0.10+version: 0.11 synopsis: Luminance samples description: Luminance samples used as tutorial help homepage: https://github.com/phaazon/luminance-samples@@ -31,7 +31,7 @@ , FlexibleContexts build-depends: base >= 4.8 && < 4.9- , luminance >= 0.10 && < 0.11+ , luminance >= 0.11 && < 0.12 , GLFW-b >= 1.4 && < 1.5 , mtl >= 2.2 && < 2.3 , resourcet >= 1.1 && < 1.2@@ -53,7 +53,7 @@ , ScopedTypeVariables build-depends: base >= 4.8 && < 4.9- , luminance >= 0.10 && < 0.11+ , luminance >= 0.11 && < 0.12 , GLFW-b >= 1.4 && < 1.5 , mtl >= 2.2 && < 2.3 , resourcet >= 1.1 && < 1.2@@ -76,7 +76,7 @@ build-depends: base >= 4.8 && < 4.9 , contravariant >= 1.3 && < 1.5- , luminance >= 0.10 && < 0.11+ , luminance >= 0.11 && < 0.12 , GLFW-b >= 1.4 && < 1.5 , mtl >= 2.2 && < 2.3 , resourcet >= 1.1 && < 1.2@@ -99,7 +99,7 @@ build-depends: base >= 4.8 && < 4.9 , contravariant >= 1.3 && < 1.5- , luminance >= 0.10 && < 0.11+ , luminance >= 0.11 && < 0.12 , GLFW-b >= 1.4 && < 1.5 , mtl >= 2.2 && < 2.3 , resourcet >= 1.1 && < 1.2@@ -123,7 +123,7 @@ build-depends: base >= 4.8 && < 4.9 , contravariant >= 1.3 && < 1.5 , JuicyPixels >= 3.2 && < 3.4- , luminance >= 0.10 && < 0.11+ , luminance >= 0.11 && < 0.12 , GLFW-b >= 1.4 && < 1.5 , mtl >= 2.2 && < 2.3 , resourcet >= 1.1 && < 1.2@@ -146,7 +146,7 @@ build-depends: base >= 4.8 && < 4.9 , contravariant >= 1.3 && < 1.5- , luminance >= 0.10 && < 0.11+ , luminance >= 0.11 && < 0.12 , GLFW-b >= 1.4 && < 1.5 , mtl >= 2.2 && < 2.3 , resourcet >= 1.1 && < 1.2@@ -171,7 +171,7 @@ build-depends: base >= 4.8 && < 4.9 , contravariant >= 1.3 && < 1.5 , linear >= 1.20 && < 1.21- , luminance >= 0.10 && < 0.11+ , luminance >= 0.11 && < 0.12 , GLFW-b >= 1.4 && < 1.5 , mtl >= 2.2 && < 2.3 , resourcet >= 1.1 && < 1.2
src/Blending.hs view
@@ -1,5 +1,4 @@ import Common-import Data.Foldable ( for_ ) import Graphics.Luminance main :: IO ()@@ -12,12 +11,9 @@ offsetU <- uni (UniformName "offset") pure (colorU,offsetU) loop $ do- gpuRegion . newFrame defaultFramebuffer . newShading (Some program) $ do- for_ (zip colors offsets) $ \(color,offset) -> do- updateUniforms program $ \(colorU,offsetU) ->- colorU .= color- <> offsetU .= offset- drawGeometry (renderCmd blending False triangle )+ let cmd color offset =+ updateAndDraw (\(colorU,offsetU) -> (colorU .= color <> offsetU .= offset)) (renderCmd blending False triangle)+ _ <- draw $ defaultFrameCmd [ShadingCmd program mempty $ zipWith cmd colors offsets] endFrame window colors :: [(Float,Float,Float)]
src/Blit.hs view
@@ -9,8 +9,7 @@ program <- createProgram_ [vs,fs] fb :: Framebuffer RW RGBA32F () <- createFramebuffer windowW windowH 1 loop $ do- gpuRegion . newFrame fb . newShading (Some program) $ do- drawGeometry (stdRenderCmd triangle)+ _ <- draw $ FrameCmd fb [ShadingCmd program mempty [pureDraw (stdRenderCmd triangle)]] framebufferBlit fb defaultFramebuffer 0 0 windowW windowH 0 0 windowW windowH BlitColor Linear endFrame window
src/DepthTest.hs view
@@ -1,5 +1,4 @@ import Common-import Data.Foldable ( for_ ) import Graphics.Luminance main :: IO ()@@ -12,12 +11,8 @@ offsetU <- uni (UniformName "offset") pure (colorU,offsetU) loop $ do- gpuRegion . newFrame defaultFramebuffer . newShading (Some program) $ do- for_ (zip colors offsets) $ \(color,offset) -> do- updateUniforms program $ \(colorU,offsetU) ->- colorU .= color- <> offsetU .= offset- drawGeometry (renderCmd Nothing True triangle )+ let cmd color offset = updateAndDraw (\(colorU,offsetU) -> colorU .= color <> offsetU .= offset) (stdRenderCmd triangle)+ _ <- draw $ defaultFrameCmd [ShadingCmd program mempty (zipWith cmd colors offsets)] endFrame window colors :: [(Float,Float,Float)]
src/HelloWorld.hs view
@@ -6,8 +6,7 @@ triangle <- createGeometry vertices Nothing Triangle program <- sequenceA [createStage VertexShader vsSource,createStage FragmentShader fsSource] >>= createProgram_ loop $ do- gpuRegion . newFrame defaultFramebuffer . newShading (Some program) $- drawGeometry (stdRenderCmd triangle)+ _ <- draw $ defaultFrameCmd [ShadingCmd program mempty [pureDraw (stdRenderCmd triangle)]] endFrame window vertices :: [V 2 Float]
src/HelloWorldUniform.hs view
@@ -8,10 +8,9 @@ fs <- createStage FragmentShader fsSource program <- createProgram [vs,fs] $ \uni -> uni (UniformName "colors")+ updateUniforms program (.= colors) loop $ do- gpuRegion . newFrame defaultFramebuffer . newShading (Some program) $ do- updateUniforms program $ (.= colors)- drawGeometry (stdRenderCmd triangle)+ _ <- draw $ defaultFrameCmd [ShadingCmd program mempty [pureDraw $ stdRenderCmd triangle]] endFrame window colors :: [(Float,Float,Float)]
src/Texture.hs view
@@ -17,10 +17,9 @@ vs <- createStage VertexShader vsSource fs <- createStage FragmentShader fsSource program <- createProgram [vs,fs] $ \uni -> uni (UniformName "srcTex")- updateUniforms program $ (.= tex)+ updateUniforms program (.= tex) loop $ do- gpuRegion . newFrame defaultFramebuffer . newShading (Some program) $ do- drawGeometry (stdRenderCmd quad)+ _ <- draw $ defaultFrameCmd [ShadingCmd program mempty [pureDraw (stdRenderCmd quad)]] endFrame window vertices :: [V 2 Float]
src/UBO.hs view
@@ -11,10 +11,9 @@ colorBuffer :: Buffer RW (UB Color) <- createBuffer (newRegion 3) writeWhole colorBuffer (map UB colors) program <- createProgram [vs,fs] $ \uni -> uni (UniformBlockName "Colors")- updateUniforms program $ (.= colorBuffer)+ updateUniforms program (.= colorBuffer) loop $ do- gpuRegion . newFrame defaultFramebuffer . newShading (Some program) $- drawGeometry (stdRenderCmd triangle)+ _ <- draw $ defaultFrameCmd [ShadingCmd program mempty [pureDraw (stdRenderCmd triangle)]] endFrame window data Color = Color {