working on code refactor

This commit is contained in:
Kbz-8
2024-04-23 20:59:50 +02:00
parent 810417a251
commit f8a856db1c
53 changed files with 1378 additions and 1403 deletions

View File

@@ -6,7 +6,7 @@
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/01/25 11:54:21 by maldavid #+# #+# */
/* Updated: 2024/03/28 22:08:35 by maldavid ### ########.fr */
/* Updated: 2024/04/23 20:00:53 by maldavid ### ########.fr */
/* */
/* ************************************************************************** */
@@ -45,7 +45,7 @@ namespace mlx
void CreateSampler() noexcept;
void CopyFromBuffer(class Buffer& buffer);
void CopyToBuffer(class Buffer& buffer);
void TransitionLayout(VkImageLayout new_layout, CmdBuffer* cmd = nullptr);
void TransitionLayout(VkImageLayout new_layout, NonOwningPtr<CommandBuffer> cmd = nullptr);
virtual void Destroy() noexcept;
inline VkImage Get() noexcept { return m_image; }

View File

@@ -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