mirror of
https://github.com/seekrs/MacroLibX.git
synced 2026-03-03 20:46:37 +00:00
fixing put pixel resize issue
This commit is contained in:
@@ -8,7 +8,7 @@ namespace mlx
|
||||
class PutPixelManager
|
||||
{
|
||||
public:
|
||||
PutPixelManager(NonOwningPtr<class Renderer> renderer) : p_renderer(renderer) {}
|
||||
PutPixelManager(NonOwningPtr<class Renderer> renderer);
|
||||
|
||||
// Returns a valid pointer when a new texture has been created
|
||||
NonOwningPtr<Texture> DrawPixel(int x, int y, std::uint64_t draw_layer, mlx_color color);
|
||||
@@ -20,6 +20,7 @@ namespace mlx
|
||||
|
||||
private:
|
||||
NonOwningPtr<Texture> GetLayer(std::uint64_t draw_layer, bool& is_newlayer);
|
||||
std::unique_ptr<Texture> NewTexture();
|
||||
|
||||
private:
|
||||
std::unordered_map<std::uint64_t, NonOwningPtr<Texture>> m_placements;
|
||||
|
||||
@@ -89,7 +89,13 @@ namespace mlx
|
||||
mlx_color GetPixel(int x, int y) noexcept;
|
||||
void GetRegion(int x, int y, int w, int h, mlx_color* dst) noexcept;
|
||||
void Clear(VkCommandBuffer cmd, Vec4f color) override;
|
||||
void CopyTo(Texture& other);
|
||||
void Resize(std::uint32_t width, std::uint32_t height);
|
||||
|
||||
void Swap(Texture& texture) noexcept;
|
||||
|
||||
// If a valid cmd buffer is passed, this function takes ownership and makes it invalid after
|
||||
void SyncCPUBuffer(VkCommandBuffer cmd = VK_NULL_HANDLE);
|
||||
void Update(VkCommandBuffer cmd);
|
||||
|
||||
~Texture() override { Destroy(); }
|
||||
|
||||
Reference in New Issue
Block a user