diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 6738097..ba0366a 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -13,10 +13,8 @@ - - - + \ No newline at end of file diff --git a/wallpaperengine/image.cpp b/wallpaperengine/image.cpp index 20e2e53..31c87ad 100644 --- a/wallpaperengine/image.cpp +++ b/wallpaperengine/image.cpp @@ -129,8 +129,12 @@ namespace wp { this->getMaterial ().setTexture (i, (*cur)->getIrrTexture ()); } - } + // set basic material flags + this->setType (irr::video::EMT_TRANSPARENT_ALPHA_CHANNEL); + this->setFlag (irr::video::EMF_LIGHTING, false); + this->setFlag (irr::video::EMF_BLEND_OPERATION, true); + } void image::setFlag(irr::video::E_MATERIAL_FLAG flag, bool newvalue) @@ -150,12 +154,14 @@ namespace wp void image::render () { + if (this->m_visible == false) return; + uint16_t indices[] = { 0, 1, 2, 3 }; - wp::irrlicht::driver->setMaterial (this->m_material); + wp::irrlicht::driver->setMaterial (this->getMaterial ()); wp::irrlicht::driver->drawVertexPrimitiveList (this->m_vertices, 4, indices, 1, irr::video::EVT_STANDARD, irr::scene::EPT_QUADS, irr::video::EIT_16BIT); } diff --git a/wallpaperengine/texture.cpp b/wallpaperengine/texture.cpp index 8edd2b4..cb67dad 100644 --- a/wallpaperengine/texture.cpp +++ b/wallpaperengine/texture.cpp @@ -1,16 +1,17 @@ #include +#include "irrlicht.h" namespace wp { texture::texture (irr::io::path file) { - + this->m_texture = wp::irrlicht::driver->getTexture (file); } irr::video::ITexture* texture::getIrrTexture () { - return nullptr; + return this->m_texture; } } \ No newline at end of file