adding shaders compilation in makefile

This commit is contained in:
Kbz-8
2024-09-22 21:39:20 +02:00
parent c718915927
commit cf773b586e
27 changed files with 415 additions and 241 deletions

View File

@@ -2,6 +2,7 @@
#include <Graphics/Sprite.h>
#include <Renderer/Image.h>
#include <Renderer/Vertex.h>
#include <Renderer/Renderer.h>
namespace mlx
{
@@ -36,17 +37,17 @@ namespace mlx
return mesh;
}
Sprite::Sprite(NonOwningPtr<Texture> texture)
Sprite::Sprite(Renderer& renderer, NonOwningPtr<Texture> texture)
{
MLX_PROFILE_FUNCTION();
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)
func::function<void(const EventBase&)> functor = [this, &renderer](const EventBase& event)
{
if(event.What() == Event::DescriptorPoolResetEventCode)
m_set.Reallocate();
m_set.Reallocate(renderer.GetCurrentFrameIndex());
};
EventBus::RegisterListener({ functor, "__Sprite" + std::to_string(reinterpret_cast<std::uintptr_t>(this)) });
}