Renderer/ShaderAst: Add Constant overloads

This commit is contained in:
Lynix
2017-01-06 01:16:03 +01:00
parent 021ac3d971
commit a5a228e0c7
3 changed files with 50 additions and 3 deletions

View File

@@ -157,11 +157,35 @@ namespace Nz
throw std::runtime_error("Component count doesn't match required component count");
}
inline Constant::Constant(bool value) :
exprType(ExpressionType::Boolean)
{
values.bool1 = value;
}
inline Constant::Constant(float value) :
exprType(ExpressionType::Float1)
{
values.vec1 = value;
}
inline Constant::Constant(const Vector2f& value) :
exprType(ExpressionType::Float2)
{
values.vec2 = value;
}
inline Constant::Constant(const Vector3f& value) :
exprType(ExpressionType::Float3)
{
values.vec3 = value;
}
inline Constant::Constant(const Vector4f& value) :
exprType(ExpressionType::Float4)
{
values.vec4 = value;
}
}
}