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:
@@ -19,7 +19,6 @@ namespace mlx
|
||||
|
||||
enum class Event
|
||||
{
|
||||
DescriptorPoolResetEventCode = 55,
|
||||
ResizeEventCode = 56,
|
||||
FrameBeginEventCode = 57,
|
||||
FatalErrorEventCode = 168,
|
||||
|
||||
@@ -44,6 +44,8 @@ namespace mlx
|
||||
std::shared_ptr<Window> p_window;
|
||||
std::unique_ptr<Scene> p_scene;
|
||||
|
||||
std::uint64_t m_draw_layer = 0;
|
||||
|
||||
int m_id;
|
||||
|
||||
bool m_has_window;
|
||||
|
||||
@@ -9,6 +9,7 @@ namespace mlx
|
||||
p_scene->ResetSprites();
|
||||
m_put_pixel_manager.ResetRenderData();
|
||||
m_insert_new_pixel_put_texture = true;
|
||||
m_draw_layer = 0;
|
||||
}
|
||||
|
||||
void GraphicsSupport::PixelPut(int x, int y, std::uint32_t color) noexcept
|
||||
@@ -19,6 +20,7 @@ namespace mlx
|
||||
{
|
||||
Sprite& new_sprite = p_scene->CreateSprite(texture);
|
||||
new_sprite.SetPosition(Vec2f{ 0.0f, 0.0f });
|
||||
m_draw_layer++;
|
||||
}
|
||||
m_insert_new_pixel_put_texture = false;
|
||||
}
|
||||
@@ -42,8 +44,12 @@ namespace mlx
|
||||
new_sprite.SetPosition(Vec2f{ static_cast<float>(x), static_cast<float>(y) });
|
||||
m_insert_new_pixel_put_texture = true;
|
||||
}
|
||||
else
|
||||
else if(!p_scene->IsTextureAtGivenDrawLayer(texture, m_draw_layer))
|
||||
{
|
||||
p_scene->BringToFront(std::move(sprite));
|
||||
m_insert_new_pixel_put_texture = true;
|
||||
}
|
||||
m_draw_layer++;
|
||||
}
|
||||
|
||||
void GraphicsSupport::LoadFont(const std::filesystem::path& filepath, float scale)
|
||||
|
||||
Reference in New Issue
Block a user