mirror of
https://github.com/seekrs/MacroLibX.git
synced 2026-01-11 14:43:34 +00:00
working on swapchains
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#ifndef __MLX_RENDER_CORE__
|
||||
#define __MLX_RENDER_CORE__
|
||||
|
||||
constexpr const int MAX_FRAMES_IN_FLIGHT = 3;
|
||||
constexpr const int MAX_FRAMES_IN_FLIGHT = 2;
|
||||
|
||||
#include <Renderer/Memory.h>
|
||||
#include <Renderer/Descriptor.h>
|
||||
|
||||
@@ -16,6 +16,7 @@ namespace mlx
|
||||
Renderer() = default;
|
||||
|
||||
void Init(NonOwningPtr<Window> window);
|
||||
void Init(NonOwningPtr<Texture> render_target);
|
||||
|
||||
void BeginFrame();
|
||||
void EndFrame();
|
||||
@@ -28,6 +29,7 @@ namespace mlx
|
||||
[[nodiscard]] inline std::size_t& GetPolygonDrawnCounterRef() noexcept { return m_polygons_drawn; }
|
||||
[[nodiscard]] inline std::size_t GetCurrentFrameIndex() const noexcept { return m_current_frame_index; }
|
||||
[[nodiscard]] inline NonOwningPtr<Window> GetWindow() const noexcept { return p_window; }
|
||||
[[nodiscard]] inline NonOwningPtr<Texture> GetRenderTarget() const noexcept { return p_render_target; }
|
||||
[[nodiscard]] inline const Swapchain& GetSwapchain() const noexcept { return m_swapchain; }
|
||||
|
||||
void Destroy() noexcept;
|
||||
@@ -41,6 +43,7 @@ namespace mlx
|
||||
std::array<VkCommandBuffer, MAX_FRAMES_IN_FLIGHT> m_cmd_buffers;
|
||||
std::array<VkFence, MAX_FRAMES_IN_FLIGHT> m_cmd_fences;
|
||||
NonOwningPtr<Window> p_window;
|
||||
NonOwningPtr<Texture> p_render_target;
|
||||
std::uint32_t m_current_frame_index = 0;
|
||||
std::size_t m_polygons_drawn = 0;
|
||||
std::size_t m_drawcalls = 0;
|
||||
|
||||
Reference in New Issue
Block a user