Changeset 8572 in orxonox.OLD for branches/gui/src/lib/graphics/importer/material.cc
- Timestamp:
- Jun 18, 2006, 10:02:52 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/gui/src/lib/graphics/importer/material.cc
r8571 r8572 431 431 432 432 433 /** 434 * @param blendFunc the Enumerator to convert to a String. 435 * @returns the matching String if found 436 */ 433 437 const std::string& Material::blendFuncToString(GLenum blendFunc) 434 438 { 435 439 for (unsigned int i = 0; i < 9; ++i) 436 if (blendFunc == glBlendFuncParams[i]) 437 return blendFuncNames[i]; 438 return blendFuncNames[0]; 439 } 440 440 if (blendFunc == Material::glBlendFuncParams[i]) 441 return Material::blendFuncNames[i]; 442 PRINTF(2)("Supplied an Invalid Enumerator to blendfunc %d\n", blendFunc); 443 return Material::blendFuncNames[0]; 444 } 445 446 /** 447 * @param blendFuncString the String to convert into a gl-enumeration 448 * @returns the matching GL-enumeration if found. 449 */ 441 450 GLenum Material::stringToBlendFunc(const std::string& blendFuncString) 442 451 { 443 452 for (unsigned int i = 0; i < 9; ++i) 444 if (blendFuncString == blendFuncNames[i])445 return glBlendFuncParams[i];446 return glBlendFuncParams[0];447 } 448 453 if (blendFuncString == Material::blendFuncNames[i]) 454 return Material::glBlendFuncParams[i]; 455 PRINTF(2)("BlendFunction %s not recognized using %s\n", blendFuncString.c_str(), Material::blendFuncNames[0].c_str()); 456 return Material::glBlendFuncParams[0]; 457 } 449 458 450 459
Note: See TracChangeset
for help on using the changeset viewer.