mirror of
https://github.com/seekrs/MacroLibX.git
synced 2026-01-11 22:53:34 +00:00
implementing last functions, adding put pixel region
This commit is contained in:
@@ -25,6 +25,8 @@ namespace mlx
|
||||
inline void ResetRenderData(int color) noexcept;
|
||||
|
||||
inline void PixelPut(int x, int y, int color) noexcept;
|
||||
inline void PixelPutArray(int x, int y, int* pixels, std::size_t pixels_size) noexcept;
|
||||
inline void PixelPutRegion(int x, int y, int w, int h, int* pixels) noexcept;
|
||||
inline void StringPut(int x, int y, int, std::string str);
|
||||
inline void TexturePut(NonOwningPtr<class Texture> texture, int x, int y, float scale_x, float scale_y, float angle);
|
||||
|
||||
|
||||
@@ -30,6 +30,30 @@ namespace mlx
|
||||
}
|
||||
}
|
||||
|
||||
void GraphicsSupport::PixelPutArray(int x, int y, int* pixels, std::size_t pixels_size) noexcept
|
||||
{
|
||||
MLX_PROFILE_FUNCTION();
|
||||
NonOwningPtr<Texture> texture = m_put_pixel_manager.DrawPixelsArray(x, y, m_draw_layer, pixels, pixels_size);
|
||||
if(texture)
|
||||
{
|
||||
m_pixelput_called = true;
|
||||
Sprite& new_sprite = p_scene->CreateSprite(texture);
|
||||
new_sprite.SetPosition(Vec2f{ 0.0f, 0.0f });
|
||||
}
|
||||
}
|
||||
|
||||
void GraphicsSupport::PixelPutRegion(int x, int y, int w, int h, int* pixels) noexcept
|
||||
{
|
||||
MLX_PROFILE_FUNCTION();
|
||||
NonOwningPtr<Texture> texture = m_put_pixel_manager.DrawPixelsRegion(x, y, w, h, m_draw_layer, pixels);
|
||||
if(texture)
|
||||
{
|
||||
m_pixelput_called = true;
|
||||
Sprite& new_sprite = p_scene->CreateSprite(texture);
|
||||
new_sprite.SetPosition(Vec2f{ 0.0f, 0.0f });
|
||||
}
|
||||
}
|
||||
|
||||
void GraphicsSupport::StringPut(int x, int y, int color, std::string str)
|
||||
{
|
||||
MLX_PROFILE_FUNCTION();
|
||||
|
||||
Reference in New Issue
Block a user