mirror of
https://github.com/seekrs/MacroLibX.git
synced 2026-01-11 22:53:34 +00:00
working on code refactor
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2023/03/08 02:24:58 by maldavid #+# #+# */
|
||||
/* Updated: 2024/03/28 22:11:21 by maldavid ### ########.fr */
|
||||
/* Updated: 2024/04/23 20:03:59 by maldavid ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@@ -26,15 +26,15 @@ namespace mlx
|
||||
Texture() = default;
|
||||
|
||||
void Create(std::uint8_t* pixels, std::uint32_t width, std::uint32_t height, VkFormat format, const char* name, bool dedicated_memory = false);
|
||||
void Render(std::array<VkDescriptorSet, 2>& sets, class Renderer& renderer, int x, int y);
|
||||
void Render(class Renderer& renderer, int x, int y);
|
||||
void Destroy() noexcept override;
|
||||
|
||||
void SetPixel(int x, int y, std::uint32_t color) noexcept;
|
||||
int GetPixel(int x, int y) noexcept;
|
||||
|
||||
inline void SetDescriptor(DescriptorSet&& set) noexcept { m_set = set; }
|
||||
inline VkDescriptorSet GetSet() noexcept { return m_set.isInit() ? m_set.get() : VK_NULL_HANDLE; }
|
||||
inline void UpdateSet(int binding) noexcept { m_set.writeDescriptor(binding, *this); m_has_set_been_updated = true; }
|
||||
inline VkDescriptorSet GetSet() noexcept { return m_set.IsInit() ? m_set.get() : VK_NULL_HANDLE; }
|
||||
inline void UpdateSet(int binding) noexcept { m_set.WriteDescriptor(binding, *this); m_has_set_been_updated = true; }
|
||||
inline bool HasBeenUpdated() const noexcept { return m_has_set_been_updated; }
|
||||
inline constexpr void ResetUpdate() noexcept { m_has_set_been_updated = false; }
|
||||
|
||||
@@ -57,7 +57,7 @@ namespace mlx
|
||||
bool m_has_set_been_updated = false;
|
||||
};
|
||||
|
||||
Texture StbTextureLoad(std::filesystem::path file, int* w, int* h);
|
||||
Texture* StbTextureLoad(std::filesystem::path file, int* w, int* h);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user