mirror of
https://github.com/seekrs/MacroLibX.git
synced 2026-01-11 22:53:34 +00:00
adding shaders compilation in makefile
This commit is contained in:
@@ -16,7 +16,7 @@ namespace mlx
|
||||
Sprite& Scene::CreateSprite(NonOwningPtr<Texture> texture) noexcept
|
||||
{
|
||||
MLX_PROFILE_FUNCTION();
|
||||
std::shared_ptr<Sprite> sprite = std::make_shared<Sprite>(texture);
|
||||
std::shared_ptr<Sprite> sprite = std::make_shared<Sprite>(*m_descriptor.renderer, texture);
|
||||
m_sprites.push_back(sprite);
|
||||
return *sprite;
|
||||
}
|
||||
@@ -24,9 +24,9 @@ namespace mlx
|
||||
NonOwningPtr<Sprite> Scene::GetSpriteFromTextureAndPosition(NonOwningPtr<Texture> texture, const Vec2f& position) const
|
||||
{
|
||||
MLX_PROFILE_FUNCTION();
|
||||
auto it = std::find_if(m_sprites.begin(), m_sprites.end(), [texture, position](std::shared_ptr<Sprite> sprite)
|
||||
auto it = std::find_if(m_sprites.begin(), m_sprites.end(), [&texture, &position](std::shared_ptr<Sprite> sprite)
|
||||
{
|
||||
return sprite->GetPosition().x == position.x && sprite->GetPosition().y == position.y && sprite->GetTexture() == texture;
|
||||
return sprite->GetTexture() == texture && sprite->GetPosition().x == position.x && sprite->GetPosition().y == position.y;
|
||||
});
|
||||
return (it != m_sprites.end() ? it->get() : nullptr);
|
||||
}
|
||||
@@ -37,7 +37,7 @@ namespace mlx
|
||||
auto it = m_sprites.begin();
|
||||
do
|
||||
{
|
||||
it = std::find_if(m_sprites.begin(), m_sprites.end(), [texture](std::shared_ptr<Sprite> sprite)
|
||||
it = std::find_if(m_sprites.begin(), m_sprites.end(), [&texture](std::shared_ptr<Sprite> sprite)
|
||||
{
|
||||
return sprite->GetTexture() == texture;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user