Kale
Loading...
Searching...
No Matches
Renderer.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
25
26#include <vulkan/vulkan.hpp>
27
28namespace Kale::Vulkan {
29
33 class Renderer : public ParentResource<Renderer>, public ChildResource<SwapChain> {
34 private:
35
39 void createRenderPass();
40
41// Used for assertion that frame buffers created with renderers have the appropriate swapchain parent
42#ifdef KALE_DEBUG
43 protected:
44
48 const SwapChain* getSwapChain() const;
49
50 friend class FrameBuffer;
51
52#endif
53
54 public:
55
59 vk::UniqueRenderPass renderPass;
60
64 Renderer();
65
69 void init();
70
74 void freeResources(bool remove = true) override;
75
76 };
77}
78
79#endif
vk::UniqueRenderPass renderPass
Definition Renderer.hpp:59
void freeResources(bool remove=true) override
Definition Renderer.cpp:62