mirror of
https://github.com/Almamu/linux-wallpaperengine.git
synced 2025-07-14 13:22:23 +08:00

- 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>
39 lines
905 B
C++
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;
|
|
} |