CShaderVariableFloat.cpp 788 B

12345678910111213141516171819202122232425262728293031323334
  1. #include "CShaderVariableFloat.h"
  2. #include <utility>
  3. using namespace WallpaperEngine::Render::Shaders::Variables;
  4. CShaderVariableFloat::CShaderVariableFloat(float defaultValue) :
  5. m_defaultValue (defaultValue),
  6. m_value (0),
  7. CShaderVariable (&this->m_defaultValue, nullptr, Type)
  8. {
  9. }
  10. CShaderVariableFloat::CShaderVariableFloat(float defaultValue, std::string name) :
  11. m_defaultValue (defaultValue),
  12. m_value (0),
  13. CShaderVariable (&this->m_defaultValue, nullptr, Type)
  14. {
  15. this->setName (std::move(name));
  16. }
  17. void CShaderVariableFloat::setValue (float value)
  18. {
  19. this->m_value = value;
  20. CShaderVariable::setValue (&this->m_value);
  21. }
  22. const int CShaderVariableFloat::getSize () const
  23. {
  24. return 1;
  25. }
  26. const std::string CShaderVariableFloat::Type = "float";