Safe Haskell | None |
---|---|
Language | Haskell2010 |
Tools for binding vinyl records to GLSL program uniform
parameters. The most common usage is to use the setUniforms
function to set each field of a Record
to the GLSL uniform
parameter with the same name. This verifies that each field of the
record corresponds to a uniform parameter of the given shader
program, and that the types all agree.
- setAllUniforms :: forall record. UniformFields record => ShaderProgram -> record -> IO ()
- setSomeUniforms :: forall r. UniformFields r => ShaderProgram -> r -> IO ()
- setUniforms :: forall record. UniformFields record => ShaderProgram -> record -> IO ()
- class HasFieldGLTypes a where
- fieldGLTypes :: a -> [VariableType]
- type UniformFields a = (HasFieldNames a, HasFieldGLTypes a, SetUniformFields a)
- class SetUniformFields a
Operations for binding uniform values
setAllUniforms :: forall record. UniformFields record => ShaderProgram -> record -> IO () Source
Set GLSL uniform parameters from a Record
. A check is
performed to verify that all uniforms used by a program are
represented by the record type. In other words, the record is a
superset of the parameters used by the program.
setSomeUniforms :: forall r. UniformFields r => ShaderProgram -> r -> IO () Source
Set GLSL uniform parameters from those fields of a PlainRec
whose names correspond to uniform parameters used by a program.
setUniforms :: forall record. UniformFields record => ShaderProgram -> record -> IO () Source
Set GLSL uniform parameters form a Record
representing
a subset of all uniform parameters used by a program.
Useful type classes for setting and verifying fields
class HasFieldGLTypes a where Source
Provide the VariableType
of each field in a Record
. The list
of types has the same order as the fields of the Record
.
fieldGLTypes :: a -> [VariableType] Source
type UniformFields a = (HasFieldNames a, HasFieldGLTypes a, SetUniformFields a) Source
class SetUniformFields a Source
Zips up lists of UniformLocation
s and a Record
setting
uniform parameters using the record fields.
setUniformFields
AsUniform v1 => SetUniformFields (Record1 n1 v1) | |
(AsUniform v1, AsUniform v2) => SetUniformFields (Record2 n1 v1 n2 v2) | |
(AsUniform v1, AsUniform v2, AsUniform v3) => SetUniformFields (Record3 n1 v1 n2 v2 n3 v3) | |
(AsUniform v1, AsUniform v2, AsUniform v3, AsUniform v4) => SetUniformFields (Record4 n1 v1 n2 v2 n3 v3 n4 v4) | |
(AsUniform v1, AsUniform v2, AsUniform v3, AsUniform v4, AsUniform v5) => SetUniformFields (Record5 n1 v1 n2 v2 n3 v3 n4 v4 n5 v5) | |
(AsUniform v1, AsUniform v2, AsUniform v3, AsUniform v4, AsUniform v5, AsUniform v6) => SetUniformFields (Record6 n1 v1 n2 v2 n3 v3 n4 v4 n5 v5 n6 v6) | |
(AsUniform v1, AsUniform v2, AsUniform v3, AsUniform v4, AsUniform v5, AsUniform v6, AsUniform v7) => SetUniformFields (Record7 n1 v1 n2 v2 n3 v3 n4 v4 n5 v5 n6 v6 n7 v7) | |
(AsUniform v1, AsUniform v2, AsUniform v3, AsUniform v4, AsUniform v5, AsUniform v6, AsUniform v7, AsUniform v8) => SetUniformFields (Record8 n1 v1 n2 v2 n3 v3 n4 v4 n5 v5 n6 v6 n7 v7 n8 v8) | |
(AsUniform v1, AsUniform v2, AsUniform v3, AsUniform v4, AsUniform v5, AsUniform v6, AsUniform v7, AsUniform v8, AsUniform v9) => SetUniformFields (Record9 n1 v1 n2 v2 n3 v3 n4 v4 n5 v5 n6 v6 n7 v7 n8 v8 n9 v9) | |
(AsUniform v1, AsUniform v2, AsUniform v3, AsUniform v4, AsUniform v5, AsUniform v6, AsUniform v7, AsUniform v8, AsUniform v9, AsUniform v10) => SetUniformFields (Record10 n1 v1 n2 v2 n3 v3 n4 v4 n5 v5 n6 v6 n7 v7 n8 v8 n9 v9 n10 v10) | |
(AsUniform v1, AsUniform v2, AsUniform v3, AsUniform v4, AsUniform v5, AsUniform v6, AsUniform v7, AsUniform v8, AsUniform v9, AsUniform v10, AsUniform v11) => SetUniformFields (Record11 n1 v1 n2 v2 n3 v3 n4 v4 n5 v5 n6 v6 n7 v7 n8 v8 n9 v9 n10 v10 n11 v11) | |
(AsUniform v1, AsUniform v2, AsUniform v3, AsUniform v4, AsUniform v5, AsUniform v6, AsUniform v7, AsUniform v8, AsUniform v9, AsUniform v10, AsUniform v11, AsUniform v12) => SetUniformFields (Record12 n1 v1 n2 v2 n3 v3 n4 v4 n5 v5 n6 v6 n7 v7 n8 v8 n9 v9 n10 v10 n11 v11 n12 v12) | |
(AsUniform v1, AsUniform v2, AsUniform v3, AsUniform v4, AsUniform v5, AsUniform v6, AsUniform v7, AsUniform v8, AsUniform v9, AsUniform v10, AsUniform v11, AsUniform v12, AsUniform v13) => SetUniformFields (Record13 n1 v1 n2 v2 n3 v3 n4 v4 n5 v5 n6 v6 n7 v7 n8 v8 n9 v9 n10 v10 n11 v11 n12 v12 n13 v13) | |
(AsUniform v1, AsUniform v2, AsUniform v3, AsUniform v4, AsUniform v5, AsUniform v6, AsUniform v7, AsUniform v8, AsUniform v9, AsUniform v10, AsUniform v11, AsUniform v12, AsUniform v13, AsUniform v14) => SetUniformFields (Record14 n1 v1 n2 v2 n3 v3 n4 v4 n5 v5 n6 v6 n7 v7 n8 v8 n9 v9 n10 v10 n11 v11 n12 v12 n13 v13 n14 v14) | |
(AsUniform v1, AsUniform v2, AsUniform v3, AsUniform v4, AsUniform v5, AsUniform v6, AsUniform v7, AsUniform v8, AsUniform v9, AsUniform v10, AsUniform v11, AsUniform v12, AsUniform v13, AsUniform v14, AsUniform v15) => SetUniformFields (Record15 n1 v1 n2 v2 n3 v3 n4 v4 n5 v5 n6 v6 n7 v7 n8 v8 n9 v9 n10 v10 n11 v11 n12 v12 n13 v13 n14 v14 n15 v15) | |
(AsUniform v1, AsUniform v2, AsUniform v3, AsUniform v4, AsUniform v5, AsUniform v6, AsUniform v7, AsUniform v8, AsUniform v9, AsUniform v10, AsUniform v11, AsUniform v12, AsUniform v13, AsUniform v14, AsUniform v15, AsUniform v16) => SetUniformFields (Record16 n1 v1 n2 v2 n3 v3 n4 v4 n5 v5 n6 v6 n7 v7 n8 v8 n9 v9 n10 v10 n11 v11 n12 v12 n13 v13 n14 v14 n15 v15 n16 v16) | |
(AsUniform v1, AsUniform v2, AsUniform v3, AsUniform v4, AsUniform v5, AsUniform v6, AsUniform v7, AsUniform v8, AsUniform v9, AsUniform v10, AsUniform v11, AsUniform v12, AsUniform v13, AsUniform v14, AsUniform v15, AsUniform v16, AsUniform v17) => SetUniformFields (Record17 n1 v1 n2 v2 n3 v3 n4 v4 n5 v5 n6 v6 n7 v7 n8 v8 n9 v9 n10 v10 n11 v11 n12 v12 n13 v13 n14 v14 n15 v15 n16 v16 n17 v17) | |
(AsUniform v1, AsUniform v2, AsUniform v3, AsUniform v4, AsUniform v5, AsUniform v6, AsUniform v7, AsUniform v8, AsUniform v9, AsUniform v10, AsUniform v11, AsUniform v12, AsUniform v13, AsUniform v14, AsUniform v15, AsUniform v16, AsUniform v17, AsUniform v18) => SetUniformFields (Record18 n1 v1 n2 v2 n3 v3 n4 v4 n5 v5 n6 v6 n7 v7 n8 v8 n9 v9 n10 v10 n11 v11 n12 v12 n13 v13 n14 v14 n15 v15 n16 v16 n17 v17 n18 v18) | |
(AsUniform v1, AsUniform v2, AsUniform v3, AsUniform v4, AsUniform v5, AsUniform v6, AsUniform v7, AsUniform v8, AsUniform v9, AsUniform v10, AsUniform v11, AsUniform v12, AsUniform v13, AsUniform v14, AsUniform v15, AsUniform v16, AsUniform v17, AsUniform v18, AsUniform v19) => SetUniformFields (Record19 n1 v1 n2 v2 n3 v3 n4 v4 n5 v5 n6 v6 n7 v7 n8 v8 n9 v9 n10 v10 n11 v11 n12 v12 n13 v13 n14 v14 n15 v15 n16 v16 n17 v17 n18 v18 n19 v19) | |
(AsUniform v1, AsUniform v2, AsUniform v3, AsUniform v4, AsUniform v5, AsUniform v6, AsUniform v7, AsUniform v8, AsUniform v9, AsUniform v10, AsUniform v11, AsUniform v12, AsUniform v13, AsUniform v14, AsUniform v15, AsUniform v16, AsUniform v17, AsUniform v18, AsUniform v19, AsUniform v20) => SetUniformFields (Record20 n1 v1 n2 v2 n3 v3 n4 v4 n5 v5 n6 v6 n7 v7 n8 v8 n9 v9 n10 v10 n11 v11 n12 v12 n13 v13 n14 v14 n15 v15 n16 v16 n17 v17 n18 v18 n19 v19 n20 v20) | |
(AsUniform v1, AsUniform v2, AsUniform v3, AsUniform v4, AsUniform v5, AsUniform v6, AsUniform v7, AsUniform v8, AsUniform v9, AsUniform v10, AsUniform v11, AsUniform v12, AsUniform v13, AsUniform v14, AsUniform v15, AsUniform v16, AsUniform v17, AsUniform v18, AsUniform v19, AsUniform v20, AsUniform v21) => SetUniformFields (Record21 n1 v1 n2 v2 n3 v3 n4 v4 n5 v5 n6 v6 n7 v7 n8 v8 n9 v9 n10 v10 n11 v11 n12 v12 n13 v13 n14 v14 n15 v15 n16 v16 n17 v17 n18 v18 n19 v19 n20 v20 n21 v21) | |
(AsUniform v1, AsUniform v2, AsUniform v3, AsUniform v4, AsUniform v5, AsUniform v6, AsUniform v7, AsUniform v8, AsUniform v9, AsUniform v10, AsUniform v11, AsUniform v12, AsUniform v13, AsUniform v14, AsUniform v15, AsUniform v16, AsUniform v17, AsUniform v18, AsUniform v19, AsUniform v20, AsUniform v21, AsUniform v22) => SetUniformFields (Record22 n1 v1 n2 v2 n3 v3 n4 v4 n5 v5 n6 v6 n7 v7 n8 v8 n9 v9 n10 v10 n11 v11 n12 v12 n13 v13 n14 v14 n15 v15 n16 v16 n17 v17 n18 v18 n19 v19 n20 v20 n21 v21 n22 v22) | |
(AsUniform v1, AsUniform v2, AsUniform v3, AsUniform v4, AsUniform v5, AsUniform v6, AsUniform v7, AsUniform v8, AsUniform v9, AsUniform v10, AsUniform v11, AsUniform v12, AsUniform v13, AsUniform v14, AsUniform v15, AsUniform v16, AsUniform v17, AsUniform v18, AsUniform v19, AsUniform v20, AsUniform v21, AsUniform v22, AsUniform v23) => SetUniformFields (Record23 n1 v1 n2 v2 n3 v3 n4 v4 n5 v5 n6 v6 n7 v7 n8 v8 n9 v9 n10 v10 n11 v11 n12 v12 n13 v13 n14 v14 n15 v15 n16 v16 n17 v17 n18 v18 n19 v19 n20 v20 n21 v21 n22 v22 n23 v23) | |
(AsUniform v1, AsUniform v2, AsUniform v3, AsUniform v4, AsUniform v5, AsUniform v6, AsUniform v7, AsUniform v8, AsUniform v9, AsUniform v10, AsUniform v11, AsUniform v12, AsUniform v13, AsUniform v14, AsUniform v15, AsUniform v16, AsUniform v17, AsUniform v18, AsUniform v19, AsUniform v20, AsUniform v21, AsUniform v22, AsUniform v23, AsUniform v24) => SetUniformFields (Record24 n1 v1 n2 v2 n3 v3 n4 v4 n5 v5 n6 v6 n7 v7 n8 v8 n9 v9 n10 v10 n11 v11 n12 v12 n13 v13 n14 v14 n15 v15 n16 v16 n17 v17 n18 v18 n19 v19 n20 v20 n21 v21 n22 v22 n23 v23 n24 v24) |