| Fling Engine 0.00.1 Fling Engine is a game engine written in Vulkan

DepthBuffer.h
Go to the documentation of this file.
1 #pragma once
2
3 #include "FlingVulkan.h"
4
5 namespace Fling
6 {
7 class LogicalDevice;
8
9 class DepthBuffer
10 {
11 public:
12 explicit DepthBuffer(LogicalDevice* t_Dev, VkSampleCountFlagBits t_SampleCount, VkExtent2D t_Extents);
13
14 ~DepthBuffer();
15
16 FORCEINLINE const VkImage& GetVkImage() const { return m_Image; }
17 FORCEINLINE const VkDeviceMemory& GetVkMemory() const { return m_Memory; }
18 FORCEINLINE const VkImageView& GetVkImageView() const { return m_ImageView; }
19 FORCEINLINE const VkFormat& GetFormat() const { return m_Format; }
20
21
27 void Create();
28
33 void Cleanup();
34
35 static VkFormat GetDepthBufferFormat();
36
37 void SetExtents(VkExtent2D t_Extents);
38
39 private:
40
41 void CreateImage();
42
43 void CreateImageView();
44
45 const LogicalDevice* m_Device;
46
47 VkImage m_Image = VK_NULL_HANDLE;
48 VkDeviceMemory m_Memory = VK_NULL_HANDLE;
49 VkImageView m_ImageView = VK_NULL_HANDLE;
50 VkFormat m_Format{};
51 VkExtent2D m_Extents{};
52
53 VkSampleCountFlagBits m_SampleCount = VK_SAMPLE_COUNT_1_BIT;
54 };
55 } // namespace Fling
Fling::DepthBuffer::m_Format
VkFormat m_Format
Definition: DepthBuffer.h:50
FlingVulkan.h
Fling::DepthBuffer::m_SampleCount
VkSampleCountFlagBits m_SampleCount
Definition: DepthBuffer.h:53
Fling::DepthBuffer::GetVkImageView
FORCEINLINE const VkImageView & GetVkImageView() const
Definition: DepthBuffer.h:18
Fling::DepthBuffer::CreateImageView
void CreateImageView()
Definition: DepthBuffer.cpp:93
Fling::DepthBuffer::m_Memory
VkDeviceMemory m_Memory
Definition: DepthBuffer.h:48
Fling::DepthBuffer::Cleanup
void Cleanup()
Cleans up all Vulkan resources of this depth buffer.
Definition: DepthBuffer.cpp:41
Fling::DepthBuffer::m_Device
const LogicalDevice * m_Device
Definition: DepthBuffer.h:45
Fling::LogicalDevice
A logical device represents the application view of the device.
Definition: LogicalDevice.h:13
Fling::DepthBuffer::GetFormat
FORCEINLINE const VkFormat & GetFormat() const
Definition: DepthBuffer.h:19
Fling::DepthBuffer::m_Extents
VkExtent2D m_Extents
Definition: DepthBuffer.h:51
Fling::DepthBuffer::SetExtents
void SetExtents(VkExtent2D t_Extents)
Definition: DepthBuffer.cpp:72
Fling::DepthBuffer::Create
void Create()
Creates all VK resources.
Definition: DepthBuffer.cpp:17
Fling::DepthBuffer::~DepthBuffer
~DepthBuffer()
Definition: DepthBuffer.cpp:36
Fling::DepthBuffer::GetVkMemory
FORCEINLINE const VkDeviceMemory & GetVkMemory() const
Definition: DepthBuffer.h:17
Fling::DepthBuffer::m_Image
VkImage m_Image
Definition: DepthBuffer.h:47
Fling::DepthBuffer::DepthBuffer
DepthBuffer(LogicalDevice *t_Dev, VkSampleCountFlagBits t_SampleCount, VkExtent2D t_Extents)
Definition: DepthBuffer.cpp:8
Fling
Definition: Engine.h:29
Fling::DepthBuffer::GetVkImage
FORCEINLINE const VkImage & GetVkImage() const
Definition: DepthBuffer.h:16
Fling::DepthBuffer::m_ImageView
VkImageView m_ImageView
Definition: DepthBuffer.h:49
Fling::DepthBuffer::GetDepthBufferFormat
static VkFormat GetDepthBufferFormat()
Definition: DepthBuffer.cpp:63
Fling::DepthBuffer::CreateImage
void CreateImage()
Definition: DepthBuffer.cpp:77
Fling::DepthBuffer
Definition: DepthBuffer.h:9