Changeset 9222 for code/branches/testing/src/libraries/tools
- Timestamp:
- May 19, 2012, 11:27:07 AM (13 years ago)
- Location:
- code/branches/testing/src/libraries/tools
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/testing/src/libraries/tools/Shader.cc
r8858 r9222 161 161 void Shader::setParameter(size_t technique, size_t pass, const std::string& parameter, int value) 162 162 { 163 ParameterContainer container = {technique, pass, parameter, value , 0.0f, MT_Type::Int};163 ParameterContainer container = {technique, pass, parameter, value}; 164 164 this->parameters_.push_back(container); 165 165 this->addAsListener(); … … 171 171 void Shader::setParameter(size_t technique, size_t pass, const std::string& parameter, float value) 172 172 { 173 ParameterContainer container = {technique, pass, parameter, 0, value, MT_Type::Float};173 ParameterContainer container = {technique, pass, parameter, value}; 174 174 this->parameters_.push_back(container); 175 175 this->addAsListener(); … … 204 204 { 205 205 // change the value of the parameter depending on its type 206 switch (it->valueType_) 207 { 208 case MT_Type::Int: 209 passPtr->getFragmentProgramParameters()->setNamedConstant(it->parameter_, it->valueInt_); 210 break; 211 case MT_Type::Float: 212 passPtr->getFragmentProgramParameters()->setNamedConstant(it->parameter_, it->valueFloat_); 213 break; 214 default: 215 break; 216 } 206 if (it->value_.isType<int>()) 207 passPtr->getFragmentProgramParameters()->setNamedConstant(it->parameter_, it->value_.getInt()); 208 else if (it->value_.isType<float>()) 209 passPtr->getFragmentProgramParameters()->setNamedConstant(it->parameter_, it->value_.getFloat()); 217 210 } 218 211 else -
code/branches/testing/src/libraries/tools/Shader.h
r8729 r9222 114 114 std::string parameter_; ///< The name of the parameter 115 115 116 int valueInt_; ///< The desired int value of the parameter 117 float valueFloat_; ///< The desired float value of the parameter 118 119 MT_Type::Value valueType_; ///< The type of the parameter (currently only int or float) 116 MultiType value_; ///< The desired value of the parameter 120 117 }; 121 118
Note: See TracChangeset
for help on using the changeset viewer.