vinyl-gl 0.2.0.2 → 0.2.1
raw patch · 3 files changed
+9/−4 lines, 3 files
Files
src/Graphics/VinylGL/Uniforms.hs view
@@ -7,7 +7,8 @@ -- record corresponds to a uniform parameter of the given shader -- program, and that the types all agree. module Graphics.VinylGL.Uniforms (setAllUniforms, setSomeUniforms, setUniforms,- HasFieldGLTypes(..), SetUniformFields) where+ HasFieldGLTypes(..), UniformFields,+ SetUniformFields) where import Control.Applicative ((<$>)) import Data.Foldable (traverse_) import qualified Data.Map as M@@ -34,6 +35,8 @@ fieldGLTypes _ = variableType (undefined::t) : fieldGLTypes (undefined::PlainFieldRec ts) +-- | Constraint synonym for 'PlainFieldRec's that carry valid GLSL+-- uniforms. type UniformFields a = (HasFieldNames a, HasFieldGLTypes a, SetUniformFields a) -- | Set GLSL uniform parameters from a 'PlainRec'. A check is@@ -138,6 +141,8 @@ glTypeEquiv :: VariableType -> VariableType -> Bool glTypeEquiv x y = glTypeEquiv' x y || glTypeEquiv' y x +-- | Zips up lists of 'UniformLocation's and a 'PlainFieldRec' setting+-- uniform parameters using the record fields. class SetUniformFields a where setUniformFields :: [Maybe UniformLocation] -> a -> IO ()
src/Graphics/VinylGL/Vertex.hs view
@@ -5,7 +5,7 @@ -- with vertices represented as vinyl records. module Graphics.VinylGL.Vertex (bufferVertices, bindVertices, reloadVertices, deleteVertices, enableVertices, enableVertices',- enableVertexFields,+ enableVertexFields, ViableVertex, BufferedVertices(..), fieldToVAD) where import Control.Applicative import Control.Arrow (second)@@ -94,7 +94,7 @@ n = fromSing (sing::Sing sy) #endif --- Constraint alias capturing the requirements of a vertex type.+-- | Constraint alias capturing the requirements of a vertex type. type ViableVertex t = (HasFieldNames t, HasFieldSizes t, HasFieldDims t, HasFieldGLTypes t, Storable t)
vinyl-gl.cabal view
@@ -1,5 +1,5 @@ name: vinyl-gl-version: 0.2.0.2+version: 0.2.1 synopsis: Utilities for working with OpenGL's GLSL shading language and vinyl records. description: Using "Data.Vinyl" records (similar in spirit to @HList@) to carry GLSL uniform parameters and vertex data enables