mirror of
https://github.com/Almamu/linux-wallpaperengine.git
synced 2025-07-15 05:42:23 +08:00

~ material's binds are now a map by index so it's easier to use - removed depth buffer for FBOs as they're not really useful (at least for now) ~ separated image setup in two stages so FBO creation happens before actually requiring them - removed ping-pong FBOs where they didn't make sense ~ image's should now render to scene buffer directly whenever possible ~ better support for FBO scaling ~ rendering should now take into account targets and binds in a much better way Signed-off-by: Alexis Maiquez <almamu@almamu.com>
37 lines
912 B
C++
37 lines
912 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 ()
|
|
{
|
|
auto cur = this->m_material->getPasses ().begin ();
|
|
auto end = this->m_material->getPasses ().end ();
|
|
|
|
// these are simple now, just create the entries and done
|
|
for (; cur != end; cur ++)
|
|
this->m_passes.emplace_back (new CPass (this, *cur));
|
|
}
|
|
|
|
const Core::Objects::Images::CMaterial* CMaterial::getMaterial () const
|
|
{
|
|
return this->m_material;
|
|
} |