mirror of
https://github.com/seekrs/MacroLibX.git
synced 2026-01-11 22:53:34 +00:00
adding clear color in mlx_clear_window
This commit is contained in:
@@ -27,7 +27,7 @@ namespace mlx
|
||||
inline void SetFPSCap(std::uint32_t fps) noexcept;
|
||||
|
||||
inline Handle NewGraphicsSuport(std::size_t w, std::size_t h, const char* title, bool is_resizable);
|
||||
inline void ClearGraphicsSupport(Handle win);
|
||||
inline void ClearGraphicsSupport(Handle win, int color);
|
||||
inline void DestroyGraphicsSupport(Handle win);
|
||||
inline void SetGraphicsSupportPosition(Handle win, int x, int y);
|
||||
|
||||
|
||||
@@ -101,11 +101,11 @@ namespace mlx
|
||||
return static_cast<void*>(&m_graphics.back()->GetID());
|
||||
}
|
||||
|
||||
void Application::ClearGraphicsSupport(Handle win)
|
||||
void Application::ClearGraphicsSupport(Handle win, int color)
|
||||
{
|
||||
MLX_PROFILE_FUNCTION();
|
||||
CHECK_WINDOW_PTR(win);
|
||||
m_graphics[*static_cast<int*>(win)]->ResetRenderData();
|
||||
m_graphics[*static_cast<int*>(win)]->ResetRenderData(color);
|
||||
}
|
||||
|
||||
void Application::DestroyGraphicsSupport(Handle win)
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace mlx
|
||||
|
||||
void Render() noexcept;
|
||||
|
||||
inline void ResetRenderData() noexcept;
|
||||
inline void ResetRenderData(int color) noexcept;
|
||||
|
||||
inline void PixelPut(int x, int y, std::uint32_t color) noexcept;
|
||||
inline void StringPut(int x, int y, std::uint32_t color, std::string str);
|
||||
|
||||
@@ -3,10 +3,16 @@
|
||||
|
||||
namespace mlx
|
||||
{
|
||||
void GraphicsSupport::ResetRenderData() noexcept
|
||||
void GraphicsSupport::ResetRenderData(int color) noexcept
|
||||
{
|
||||
MLX_PROFILE_FUNCTION();
|
||||
p_scene->ResetScene();
|
||||
Vec4f vec_color = {
|
||||
static_cast<float>((color & 0x000000FF)) / 255.0f,
|
||||
static_cast<float>((color & 0x0000FF00) >> 8) / 255.0f,
|
||||
static_cast<float>((color & 0x00FF0000) >> 16) / 255.0f,
|
||||
static_cast<float>((color & 0xFF000000) >> 24) / 255.0f
|
||||
};
|
||||
p_scene->ResetScene(std::move(vec_color));
|
||||
m_put_pixel_manager.ResetRenderData();
|
||||
m_draw_layer = 0;
|
||||
m_pixelput_called = false;
|
||||
|
||||
Reference in New Issue
Block a user