GLBackend.setShader

Set the current shader and its attributes

The GL backend passes a uniform 3x3 matrix to a uniform with a name given by 'transformAttributeName.' This matrix is a transformation applied to every vertex. Each vertex receives a vec2 of its position and texture coordinate, given by 'positionAttributeName' and 'texPositionAttributeName.' Vertices also are blended with a color, given by 'colorAttributeName.' The texture is passed as a uniform sampler2D to 'textureAttributeName.' The output of the shader is a vec4 for a color, given by 'colorOutputName'

struct GLBackend
@trusted @nogc nothrow
void
setShader
(
in string vertexShader
,
in string fragmentShader
,
in string transformAttributeName = "transform"
,
in string positionAttributeName = "position"
,
in string texPositionAttributeName = "tex_coord"
,
in string colorAttributeName = "color"
,
in string textureAttributeName = "tex"
,
in string colorOutputName = "outColor"
)

Meta