8 #include <GLFW/glfw3.h> 37 virtual void Init()
override;
const VkQueue & GetGraphicsQueue() const
Definition: Renderer.h:83
void UpdateUniformBuffer(UINT32 t_CurrentImage)
Update the uniform buffer data.
Definition: Renderer.cpp:823
Core renderer for the application
Definition: Renderer.h:33
PhysicalDevice * GetPhysicalDevice() const
Definition: Renderer.h:79
void CreateSyncObjects()
Create semaphores and fence objects.
Definition: Renderer.cpp:453
const VkDevice & GetLogicalVkDevice() const
Get the logical graphics Device object.
Definition: Renderer.h:68
std::vector< VkCommandBuffer > m_CommandBuffers
Command buffers.
Definition: Renderer.h:249
const VkPhysicalDevice & GetPhysicalVkDevice() const
Get the Physical Device object used by this renderer.
Definition: Renderer.h:77
FlingWindow * m_CurrentWindow
Definition: Renderer.h:198
std::unique_ptr< FirstPersonCamera > m_camera
Camera Instance.
Definition: Renderer.h:196
std::vector< VkSemaphore > m_RenderFinishedSemaphores
Definition: Renderer.h:252
VkCommandPool m_CommandPool
Definition: Renderer.h:220
Base class that represents a window to the Fling Engine.
Definition: FlingWindow.h:20
VkSurfaceKHR m_Surface
Handle to the surface extension used to interact with the windows system.
Definition: Renderer.h:207
VkPresentModeKHR ChooseSwapChainPresentMode(const std::vector< VkPresentModeKHR > &t_AvialableFormats)
Choose a present mode for the swap chain based on the given formats.
Definition: Renderer.cpp:662
LogicalDevice * GetLogicalDevice() const
Definition: Renderer.h:70
const VkDevice & GetVkDevice() const
Definition: LogicalDevice.h:18
A physical device represents the Vulkan physical device (the GPU) that we are currently using...
Definition: PhyscialDevice.h:11
LogicalDevice * m_LogicalDevice
Definition: Renderer.h:202
VkPipelineLayout m_PipelineLayout
Definition: Renderer.h:215
void CreateCommandPool()
Create the command pool to be sent every frame.
Definition: Renderer.cpp:371
void CreateGraphicsPipeline()
Create the graphics pipeline (IA, VS, FS, etc)
Definition: Renderer.cpp:156
VkRenderPass m_RenderPass
Definition: Renderer.h:211
void CleanupFrameResources()
Definition: Renderer.cpp:477
Class that can have only one instance.
Definition: Singleton.hpp:11
virtual void Shutdown() override
Definition: Renderer.cpp:866
static const int MAX_FRAMES_IN_FLIGHT
Definition: Renderer.h:232
std::vector< VkFramebuffer > m_SwapChainFramebuffers
The frame buffers for the swap chain.
Definition: Renderer.h:243
A logical device represents the application view of the device.
Definition: LogicalDevice.h:10
Swapchain * GetSwapChain() const
Definition: Renderer.h:89
The instance is a representation of this application graphics instance in Vulkan. ...
Definition: Instance.h:11
void CreateFrameBuffers()
Create the frame buffers for use by the swap chain.
Definition: Renderer.cpp:338
std::vector< VkFence > m_InFlightFences
Definition: Renderer.h:253
void RecreateFrameResources()
Re-create the image views, render passes, and command buffers.
Definition: Renderer.cpp:508
void SetFrameBufferHasBeenResized(bool t_Setting)
Definition: Renderer.h:85
VkExtent2D ChooseSwapExtent()
Determine the best match extents based on our window width and height.
Definition: Renderer.cpp:681
void CreateRenderPass()
Create the frame buffer that will be used by the graphics pipeline.
Definition: Renderer.cpp:57
Represents a swap chain that can be used throughout the program.
Definition: SwapChain.h:19
std::vector< VkDescriptorSet > m_DescriptorSets
Definition: Renderer.h:237
SwapChainSupportDetails QuerySwapChainSupport(VkPhysicalDevice t_Device)
Check the swap chain support of a given device.
Definition: Renderer.cpp:623
void Tick()
Happens before draw frame.
Definition: Renderer.cpp:759
const VkQueue & GetGraphicsQueue() const
Definition: LogicalDevice.h:20
void CreateGameWindow(const UINT32 t_width, const UINT32 t_height)
Init GLFW and create the game window
Definition: Renderer.cpp:722
std::vector< Buffer * > m_UniformBuffers
Uniform buffers.
Definition: Renderer.h:235
virtual void Init() override
Definition: Renderer.cpp:13
VkPipeline m_GraphicsPipeline
Definition: Renderer.h:217
Instance * m_Instance
Definition: Renderer.h:200
void CreateDescriptorLayout()
Create a Descriptor Layout object.
Definition: Renderer.cpp:125
void CreateDescriptorPool()
Definition: Renderer.cpp:545
const VkCommandPool & GetCommandPool() const
Definition: Renderer.h:81
void InitGraphics()
Init the current graphics API
Definition: Renderer.cpp:21
std::vector< VkSemaphore > m_ImageAvailableSemaphores
Definition: Renderer.h:251
Swapchain * m_SwapChain
Definition: Renderer.h:209
const VkSurfaceKHR & GetVkSurface() const
Definition: Renderer.h:87
VkDescriptorPool m_DescriptorPool
Definition: Renderer.h:223
std::shared_ptr< class Image > m_TestImage
Definition: Renderer.h:255
void CreateCommandBuffers()
Definition: Renderer.cpp:385
void CreateUniformBuffers()
Definition: Renderer.cpp:531
size_t CurrentFrameIndex
Definition: Renderer.h:227
void CreateDescriptorSets()
Definition: Renderer.cpp:567
VkShaderModule CreateShaderModule(std::shared_ptr< File > t_ShaderCode)
Create a shader module based on the given shader code.
Definition: Renderer.cpp:706
void PrepShutdown()
Prepare for shutdown of the rendering pipeline, close any open semaphores.
Definition: Renderer.cpp:850
uint32_t UINT32
Definition: FlingTypes.h:10
const VkPhysicalDevice & GetVkPhysicalDevice() const
Definition: PhyscialDevice.h:21
VkDescriptorSetLayout m_DescriptorSetLayout
Pipeline layout stores uniforms (global shader vars)
Definition: Renderer.h:214
DepthBuffer * m_DepthBuffer
Definition: Renderer.h:225
void DrawFrame()
Draw the frame!
Definition: Renderer.cpp:764
PhysicalDevice * m_PhysicalDevice
Definition: Renderer.h:204
Definition: SwapChain.h:8
FlingWindow * GetCurrentWindow() const
Definition: Renderer.h:48
bool m_FrameBufferResized
Used to determine if the frame buffer has been resized or not.
Definition: Renderer.h:230
VkSurfaceFormatKHR ChooseSwapChainSurfaceFormat(const std::vector< VkSurfaceFormatKHR > &t_AvailableFormats)
Choose a swap chain format based on the available formats.
Definition: Renderer.cpp:649
std::shared_ptr< Model > m_TestModel
Definition: Renderer.h:257
Definition: DepthBuffer.h:8