mirror of
https://github.com/seekrs/MacroLibX.git
synced 2026-01-11 22:53:34 +00:00
fixing put pixel, adding scene change checker
This commit is contained in:
@@ -37,18 +37,11 @@ namespace mlx
|
||||
return mesh;
|
||||
}
|
||||
|
||||
Sprite::Sprite(Renderer& renderer, NonOwningPtr<Texture> texture)
|
||||
Sprite::Sprite(NonOwningPtr<Texture> texture)
|
||||
{
|
||||
MLX_PROFILE_FUNCTION();
|
||||
Verify((bool)texture, "Sprite: invalid texture (internal mlx issue, please report to devs)");
|
||||
p_mesh = CreateQuad(0, 0, texture->GetWidth(), texture->GetHeight());
|
||||
p_texture = texture;
|
||||
|
||||
func::function<void(const EventBase&)> functor = [this, &renderer](const EventBase& event)
|
||||
{
|
||||
if(event.What() == Event::DescriptorPoolResetEventCode)
|
||||
m_set.Reallocate(renderer.GetCurrentFrameIndex());
|
||||
};
|
||||
EventBus::RegisterListener({ functor, "__MlxSprite" + std::to_string(reinterpret_cast<std::uintptr_t>(this)) });
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user