Engine
Frameworkcreatedbymeusableforthecreationofsimplegames.CurrentlysupportsOpenGL(Verysimple)andVulkan.
VulkanDebugRenderer.hpp
Go to the documentation of this file.
1 #pragma once
3 #ifdef USING_VULKAN
4 
5 #include <ThirdParty/Vulkan/Include/vulkan/vulkan.h>
6 
12 #include <ThirdParty/glm/glm/glm.hpp>
13 #include <ThirdParty/EASTL-master/include/EASTL/unique_ptr.h>
14 
15 namespace Engine {
16 
17  class VulkanRenderer;
18 
19  class VulkanDebugRenderer
20  {
21  public:
22  VulkanDebugRenderer(VulkanRenderer* renderer, VulkanLogicalDevice* device, VulkanDescriptorPool* descriptorPool);
23  ~VulkanDebugRenderer();
24 
25  void StartRender(VkCommandBuffer commandBuffer, glm::mat4 view, glm::mat4 projection);
26 
27  void RenderLine(glm::vec3 start, glm::vec3 end, glm::vec4 color = glm::vec4(1.f,1.f,1.f,1.f));
28 
29  void FinishRender();
30 
31  void Clean();
32  void Recreate();
33 
34  protected:
35  eastl::unique_ptr<VulkanPipeline> linePipeline;
36 
37  eastl::unique_ptr<VulkanBuffer> vertexBuffer;
38  eastl::unique_ptr<VulkanBuffer> uniformBuffer;
39 
40  typedef struct {
41  glm::vec3 position;
42  }VertexInfo_t;
43 
44  typedef struct {
45  glm::mat4 view;
46  glm::mat4 proj;
47  }Ubo_t;
48 
49  Ubo_t ubo;
50 
51  typedef struct {
52  glm::mat4 model;
53  glm::vec4 color;
54  }PushConstants_t;
55 
56  eastl::vector<PushConstants_t> lines;
57 
58  VulkanRenderer* renderer;
59  VulkanLogicalDevice* device;
60  VulkanDescriptorPool* descriptorPool;
61 
62  VkDescriptorSet uboDescriptorSet;
63 
64  VkCommandBuffer commandBuffer;
65 
66  };
67 
68 }
69 
70 #endif // USING_VULKAN