mirror of
https://github.com/seekrs/MacroLibX.git
synced 2026-01-11 22:53:34 +00:00
adding depth buffer, ci skip
This commit is contained in:
@@ -3,11 +3,13 @@
|
||||
#include <Renderer/Renderer.h>
|
||||
#include <Renderer/RenderCore.h>
|
||||
|
||||
namespace Scop
|
||||
namespace mlx
|
||||
{
|
||||
Scene::Scene(SceneDescriptor desc)
|
||||
: m_descriptor(std::move(desc))
|
||||
{
|
||||
Verify((bool)m_descriptor.renderer, "invalid renderer");
|
||||
m_depth.Init(m_descriptor.renderer->GetSwapchainImages().back().GetWidth(), m_descriptor.renderer->GetSwapchainImages().back().GetHeight());
|
||||
}
|
||||
|
||||
Sprite& Scene::CreateSprite(std::shared_ptr<Texture> texture) noexcept
|
||||
|
||||
@@ -40,5 +40,12 @@ namespace mlx
|
||||
Verify((bool)texture, "Sprite: invalid texture");
|
||||
p_mesh = CreateQuad(0, 0, texture->GetWidth(), texture->GetHeight());
|
||||
p_texture = texture;
|
||||
|
||||
func::function<void(const EventBase&)> functor = [this](const EventBase& event)
|
||||
{
|
||||
if(event.What() == Event::DescriptorPoolResetEventCode)
|
||||
m_set.Reallocate();
|
||||
};
|
||||
EventBus::RegisterListener({ functor, "__Sprite" + std::to_string(reinterpret_cast<std::uintptr_t>(this)) });
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user