Chronos 0.0
A advanced 2D rendering and animation system
Loading...
Searching...
No Matches
editorRenderer.hpp
Go to the documentation of this file.
1/*
2Copyright (c) 2024 Rahul Satish Vadhyar
3
4Permission is hereby granted, free of charge, to any person obtaining a copy
5of this software and associated documentation files (the "Software"), to deal
6in the Software without restriction, including without limitation the rights
7to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8copies of the Software, and to permit persons to whom the Software is
9furnished to do so, subject to the following conditions:
10
11The above copyright notice and this permission notice shall be included in all
12copies or substantial portions of the Software.
13
14THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20SOFTWARE.
21*/
22
23#pragma once
24#include "swapchain.hpp"
25namespace Chronos {
26namespace Editor {
27
29 public:
32 VkSurfaceKHR surface;
33 GLFWwindow* window;
34
35 VkCommandPool commandPool;
36 VkDescriptorPool descriptorPool;
37 std::vector<VkCommandBuffer> commandBuffers;
38 std::vector<VkFramebuffer> framebuffers;
39 VkRenderPass renderPass;
40
41 void init(Chronos::Engine::Device* device, GLFWwindow* window,
42 Chronos::Engine::SwapChain* swapChain, VkInstance instance,
43 VkSurfaceKHR surface);
44 void render(
45 uint32_t currentFrame, uint32_t imageIndex, float bgColor[3]);
46 void destroy();
47 void update(); // need to reorganize thnis
48 void recreate(); // destroy framebuffer
49 void changeMsaa(); // destroy renderpass
50 void cleanup();
52 void (*addElements)();
53 };
54}; // namespace Editor
55}; // namespace Chronos
Chronos::Engine::Device * device
std::vector< VkFramebuffer > framebuffers
std::vector< VkCommandBuffer > commandBuffers
void init(Chronos::Engine::Device *device, GLFWwindow *window, Chronos::Engine::SwapChain *swapChain, VkInstance instance, VkSurfaceKHR surface)
Chronos::Engine::SwapChain * swapChain
void render(uint32_t currentFrame, uint32_t imageIndex, float bgColor[3])
This initializes, manages and destroys the logical and physical devices(GPU).
Definition device.hpp:47
Contains the swapChain class along with all the swapChain related functions.