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 
8  class DepthBuffer
9  {
10  public:
11  DepthBuffer();
12 
13  ~DepthBuffer();
14 
15  FORCEINLINE const VkImage& GetVkImage() const { return m_Image; }
16  FORCEINLINE const VkDeviceMemory& GetVkMemory() const { return m_Memory; }
17  FORCEINLINE const VkImageView& GetVkImageView() const { return m_ImageView; }
18  FORCEINLINE const VkFormat& GetFormat() const { return m_Format; }
19 
20 
26  void Create();
27 
32  void Cleanup();
33 
34  static VkFormat GetDepthBufferFormat();
35 
36  private:
37 
38  void CreateImage();
39 
40  void CreateImageView();
41 
42  VkImage m_Image = VK_NULL_HANDLE;
43  VkDeviceMemory m_Memory = VK_NULL_HANDLE;
44  VkImageView m_ImageView = VK_NULL_HANDLE;
45  VkFormat m_Format;
46  };
47 } // namespace Fling
VkFormat m_Format
Definition: DepthBuffer.h:45
FORCEINLINE const VkImageView & GetVkImageView() const
Definition: DepthBuffer.h:17
void CreateImageView()
Definition: DepthBuffer.cpp:85
VkDeviceMemory m_Memory
Definition: DepthBuffer.h:43
void Cleanup()
Cleans up all Vulkan resources of this depth buffer.
Definition: DepthBuffer.cpp:37
FORCEINLINE const VkFormat & GetFormat() const
Definition: DepthBuffer.h:18
void Create()
Creates all VK resources.
Definition: DepthBuffer.cpp:13
~DepthBuffer()
Definition: DepthBuffer.cpp:32
DepthBuffer()
Definition: DepthBuffer.cpp:8
FORCEINLINE const VkDeviceMemory & GetVkMemory() const
Definition: DepthBuffer.h:16
VkImage m_Image
Definition: DepthBuffer.h:42
Definition: Engine.h:13
FORCEINLINE const VkImage & GetVkImage() const
Definition: DepthBuffer.h:15
VkImageView m_ImageView
Definition: DepthBuffer.h:44
static VkFormat GetDepthBufferFormat()
Definition: DepthBuffer.cpp:59
void CreateImage()
Definition: DepthBuffer.cpp:68
Definition: DepthBuffer.h:8