aztecs-gl 0.1.0 → 0.1.1
raw patch · 2 files changed
+12/−1 lines, 2 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Aztecs.GL: Mesh :: !BufferObject -> !NumArrayIndices -> !PrimitiveMode -> Mesh
+ Aztecs.GL: [meshPrimitiveMode] :: Mesh -> !PrimitiveMode
+ Aztecs.GL: [meshVBO] :: Mesh -> !BufferObject
+ Aztecs.GL: [meshVertexCount] :: Mesh -> !NumArrayIndices
+ Aztecs.GL: data Mesh
Files
- aztecs-gl.cabal +1/−1
- src/Aztecs/GL.hs +11/−0
aztecs-gl.cabal view
@@ -1,6 +1,6 @@ cabal-version: 3.0 name: aztecs-gl-version: 0.1.0+version: 0.1.1 license: BSD-3-Clause license-file: LICENSE maintainer: matt@hunzinger.me
src/Aztecs/GL.hs view
@@ -7,6 +7,9 @@ ( -- * Colors Color (..), + -- * Meshes+ Mesh (..),+ -- * Shapes Rectangle (..), Circle (..),@@ -14,6 +17,8 @@ -- * Rendering render,++ -- * Transform module Aztecs.Transform, ) where@@ -188,6 +193,7 @@ GL.bindBuffer GL.ArrayBuffer $= Nothing return $ Mesh vbo vertexCount mode +-- | Render all @Mesh@ components that are descendants of @Window@s render :: (MonadIO m) => Access m () render = do windows <- system . readQuery $ (,,) <$> query @_ @Window <*> query @_ @RawWindow <*> query @_ @Children@@ -216,6 +222,11 @@ let res = (,,) <$> meshRes <*> transformRes <*> colorRes case res of Just (mesh, trans, color) -> liftIO $ renderMesh (mesh, trans, color)+ Nothing -> return ()++ childrenRes <- lookup e+ case childrenRes of+ Just (Children cs) -> mapM_ go' cs Nothing -> return () -- | Render a mesh with transform and color