6#include "vulkan/vulkan.h"
15 virtual ~VulkanRendererAPI();
17 virtual void Clear()
override;
20 virtual void DrawIndexed(std::shared_ptr<VertexArray> vertexArray)
override;
29 void RecordCommandBuffers(VkCommandBuffer commandBuffer, uint32_t imageIndex);
30 void SubmitCommandBuffers();
31 void CreateSynchronicity();
32 void ClearVulkanRendererAPI();
33 void RemoveSynchronicity();
34 void RecreateCommandBuffersPipelineSwapchain();
35 void RecreateCommandBuffersAndSwapChain();
38 const std::vector<VkCommandBuffer>& GetCommandBuffers()
const {
return m_commandBuffers; }
39 const int& GetMaxFramesInFlight()
const {
return MAX_FRAMES_IN_FLIGHT; }
40 const std::vector<VkFence>& GetFences()
const {
return m_InFlightFences; }
41 const std::vector<VkSemaphore>& GetImageAvailableSemaphores()
const {
return m_ImageAvailableSemaphores; }
42 const std::vector<VkSemaphore> GetRenderFinishedSemaphore()
const {
return m_RenderFinishedSemaphores; }
45 size_t m_CurrentFrame = 0;
47 std::vector<VkCommandBuffer> m_commandBuffers;
48 std::vector<std::shared_ptr<VulkanVertexArray>> m_VulkaVertexArrays;
50 std::vector<VkSemaphore> m_ImageAvailableSemaphores;
51 std::vector<VkSemaphore> m_RenderFinishedSemaphores;
52 std::vector<VkFence> m_InFlightFences;
56 const int MAX_FRAMES_IN_FLIGHT = 2;
58 bool m_bAllocateCommandBuffers;
#define KARMA_API
Defining Karma's API macro for storage class information.
Definition Core.h:41
This file contains the class RendererAPI.
An abstract class for a renderer.
Definition RendererAPI.h:23
virtual void DrawIndexed(std::shared_ptr< VertexArray > vertexArray) override
Routine for drawing primitives.
Definition VulkanRendererAPI.cpp:262
virtual void Clear() override
Clear the rendering screen.
Definition VulkanRendererAPI.cpp:32
virtual void SetClearColor(const glm::vec4 &color) override
Set the color to be used for clear (rendering) screen.
Definition VulkanRendererAPI.cpp:27
virtual void EndScene() override
Instructions for end of the scene.
Definition VulkanRendererAPI.cpp:112
void AllocateCommandBuffers()
Allocates resources for command buffers. Command buffers are objects used to record commands which ca...
Definition VulkanRendererAPI.cpp:46
virtual void BeginScene() override
Setting up resources for rendering of a scene.
Definition VulkanRendererAPI.cpp:36
Definition VulkanVertexArray.h:12