Changeset 9823 in orxonox.OLD for branches/new_class_id/src/lib/graphics/resource_shader.cc
- Timestamp:
- Sep 25, 2006, 11:28:28 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/new_class_id/src/lib/graphics/resource_shader.cc
r9820 r9823 2 2 #include "resource_shader.h" 3 3 #include "debug.h" 4 4 #include "substring.h" 5 5 6 6 ResourceShader::ResourceShader(const std::string& vertexShaderName, const std::string& fragmentShaderName) 7 7 : NewResource(&ResourceShader::type) 8 8 { 9 Resources::StorePointer* ptr = this->acquireResource(vertexShaderName +' |'+fragmentShaderName);9 Resources::StorePointer* ptr = this->acquireResource(vertexShaderName +','+fragmentShaderName); 10 10 11 11 if (ptr) … … 23 23 24 24 this->Shader::load(vertexFileName, fragmentFileName); 25 this->NewResource::addResource(new ResourceShader::ShaderResourcePointer(vertexShaderName+' |'+fragmentShaderName, Resources::KeepLevel(0), this->Shader::dataPointer()));25 this->NewResource::addResource(new ResourceShader::ShaderResourcePointer(vertexShaderName+','+fragmentShaderName, Resources::KeepLevel(0), this->Shader::dataPointer())); 26 26 } 27 27 } 28 28 29 ResourceShader ResourceShader::createFromString(const std::string& loadString) 30 { 31 std::string vertexShaderName; 32 std::string fragmentShaderName; 29 33 30 Resources::Type ResourceShader::type("Shader"); 34 SubString shaderNames(loadString, ','); 35 if (shaderNames.size() > 0) 36 vertexShaderName = shaderNames[0]; 37 if (shaderNames.size() > 1) 38 fragmentShaderName = shaderNames[1]; 31 39 40 return ResourceShader(vertexShaderName, fragmentShaderName); 41 } 32 42 33 34 43 Resources::tType<ResourceShader> ResourceShader::type("Shader"); 35 44 36 45 ResourceShader::ShaderResourcePointer::ShaderResourcePointer(const std::string& loadString, const Resources::KeepLevel& keepLevel, const ShaderData::Pointer& data)
Note: See TracChangeset
for help on using the changeset viewer.