Kale
Loading...
Searching...
No Matches
FrameBuffer.hpp
Go to the documentation of this file.
1/*
2 Copyright 2022 Rishi Challa
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15*/
16
17#pragma once
18
19#ifdef KALE_VULKAN
20
26
27#include <vulkan/vulkan.hpp>
28
29namespace Kale::Vulkan {
30
35 class FrameBuffer : public ParentResource<FrameBuffer>, public ChildResource<Renderer> {
36 private:
37
44 void createFrameBuffer(const vk::UniqueImageView& imageView, const vk::Extent2D& extent,
45 const vk::UniqueRenderPass& renderPass);
46
47 protected:
48
53 void freeResources(bool remove) override;
54
55 public:
56
61
65 vk::UniqueImage image;
66
70 vk::UniqueImageView imageView;
71
75 vk::UniqueFramebuffer framebuffer;
76
81
86 FrameBuffer(Renderer& renderer, const Vector2ui32& size);
87
92 void init(Renderer& renderer, const Vector2ui32& size);
93
98 void freeResources();
99 };
100}
101
102#endif
void init(Renderer &renderer, const Vector2ui32 &size)
vk::UniqueImageView imageView
vk::UniqueFramebuffer framebuffer
void createFrameBuffer(const vk::UniqueImageView &imageView, const vk::Extent2D &extent, const vk::UniqueRenderPass &renderPass)