mirror of
https://github.com/seekrs/MacroLibX.git
synced 2026-01-11 22:53:34 +00:00
fixing compilation issues, working on textures
This commit is contained in:
@@ -7,6 +7,7 @@ namespace mlx
|
||||
{
|
||||
MLX_PROFILE_FUNCTION();
|
||||
p_scene->ResetSprites();
|
||||
m_current_depth = 0;
|
||||
}
|
||||
|
||||
void GraphicsSupport::PixelPut(int x, int y, std::uint32_t color) noexcept
|
||||
@@ -22,6 +23,15 @@ namespace mlx
|
||||
void GraphicsSupport::TexturePut(NonOwningPtr<Texture> texture, int x, int y)
|
||||
{
|
||||
MLX_PROFILE_FUNCTION();
|
||||
NonOwningPtr<Sprite> sprite = p_scene->GetSpriteFromTextureAndPosition(texture, Vec2f{ static_cast<float>(x), static_cast<float>(y) });
|
||||
if(!sprite)
|
||||
{
|
||||
Sprite& new_sprite = p_scene->CreateSprite(texture);
|
||||
new_sprite.SetPosition(Vec3f{ static_cast<float>(x), static_cast<float>(y), static_cast<float>(m_current_depth) });
|
||||
}
|
||||
else
|
||||
sprite->SetPosition(Vec3f{ static_cast<float>(x), static_cast<float>(y), static_cast<float>(m_current_depth) });
|
||||
m_current_depth++;
|
||||
}
|
||||
|
||||
void GraphicsSupport::LoadFont(const std::filesystem::path& filepath, float scale)
|
||||
@@ -29,8 +39,9 @@ namespace mlx
|
||||
MLX_PROFILE_FUNCTION();
|
||||
}
|
||||
|
||||
void GraphicsSupport::TryEraseTextureFromRegistry(NonOwningPtr<Texture> texture) noexcept
|
||||
void GraphicsSupport::TryEraseSpritesInScene(NonOwningPtr<Texture> texture) noexcept
|
||||
{
|
||||
MLX_PROFILE_FUNCTION();
|
||||
p_scene->TryEraseSpriteFromTexture(texture);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user