linux-wallpaperengine/src/WallpaperEngine/Render/Objects/Effects/CMaterial.cpp
Alexis Maiquez a24b1923f6 Cleanup of code:
- use of auto in some places (more of this to come)
 - use for loops instead of iterators for most of the loops
 - extracted glfw/glew code into it's own class
 - make usage of std::filesystem instead of checking things with old C libraries

Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2023-02-03 18:41:51 +01:00

39 lines
905 B
C++

#include "CMaterial.h"
using namespace WallpaperEngine::Render::Objects;
using namespace WallpaperEngine::Render::Objects::Effects;
CMaterial::CMaterial (const Render::Objects::CEffect* effect, const Core::Objects::Images::CMaterial* material) :
m_effect (effect),
m_material (material)
{
this->generatePasses ();
}
const std::vector<CPass*>& CMaterial::getPasses () const
{
return this->m_passes;
}
CImage* CMaterial::getImage () const
{
return this->m_effect->getImage ();
}
void CMaterial::generatePasses ()
{
// these are simple now, just create the entries and done
for (const auto& cur : this->m_material->getPasses ())
this->m_passes.emplace_back (new CPass (this, cur));
}
const Core::Objects::Images::CMaterial* CMaterial::getMaterial () const
{
return this->m_material;
}
const CEffect* CMaterial::getEffect () const
{
return this->m_effect;
}