Chronos 0.0
A advanced 2D rendering and animation system
|
#include <objectManager.hpp>
Public Member Functions | |
void | init (Chronos::Engine::Device *device, Chronos::Engine::SwapChain *swapChain, VkCommandPool commandPool) |
void | destroy () |
int | addObject (Object *object) |
void | remove (int objectNo) |
void | update (uint32_t currentFrame) |
void | render (uint32_t currentFrame, uint32_t imageIndex, float bgColor[3]) |
void | changeMsaa () |
void | recreate () |
void | cleanup () |
Public Attributes | |
std::map< int, Object * > | objects |
int | nextFreeObjectNo = 0 |
std::vector< VkCommandBuffer > | commandBuffers |
VkRenderPass | renderPass |
VkSampler | textureSampler |
Private Attributes | |
Chronos::Engine::Device * | device |
Chronos::Engine::SwapChain * | swapChain |
VkCommandPool | commandPool |
std::vector< VkFramebuffer > | framebuffers |
std::map< int, std::array< bool, MAX_FRAMES_IN_FLIGHT > > | objectsToBeRemoved |
Definition at line 35 of file objectManager.hpp.
int Chronos::Engine::ObjectManager::addObject | ( | Object * | object | ) |
Definition at line 130 of file objectManager.cpp.
void Chronos::Engine::ObjectManager::changeMsaa | ( | ) |
Definition at line 107 of file objectManager.cpp.
References Chronos::Engine::createRenderPass().
void Chronos::Engine::ObjectManager::cleanup | ( | ) |
Definition at line 124 of file objectManager.cpp.
void Chronos::Engine::ObjectManager::destroy | ( | ) |
Definition at line 47 of file objectManager.cpp.
void Chronos::Engine::ObjectManager::init | ( | Chronos::Engine::Device * | device, |
Chronos::Engine::SwapChain * | swapChain, | ||
VkCommandPool | commandPool | ||
) |
Definition at line 29 of file objectManager.cpp.
References commandBuffers, commandPool, Chronos::Engine::createCommandBuffer(), Chronos::Engine::createFramebuffer(), Chronos::Engine::createRenderPass(), Chronos::Engine::createTextureSampler(), device, framebuffers, renderPass, swapChain, and textureSampler.
void Chronos::Engine::ObjectManager::recreate | ( | ) |
Definition at line 119 of file objectManager.cpp.
References Chronos::Engine::createFramebuffer().
void Chronos::Engine::ObjectManager::remove | ( | int | objectNo | ) |
Definition at line 137 of file objectManager.cpp.
void Chronos::Engine::ObjectManager::render | ( | uint32_t | currentFrame, |
uint32_t | imageIndex, | ||
float | bgColor[3] | ||
) |
Definition at line 57 of file objectManager.cpp.
void Chronos::Engine::ObjectManager::update | ( | uint32_t | currentFrame | ) |
Definition at line 143 of file objectManager.cpp.
References Chronos::Engine::Object::destroy(), Chronos::Engine::Object::objectType, Chronos::Engine::TypeColoredRectangle, Chronos::Engine::TypeText, and Chronos::Engine::TypeTexturedRectangle.
std::vector<VkCommandBuffer> Chronos::Engine::ObjectManager::commandBuffers |
Vector of Vulkan command buffers.
Definition at line 41 of file objectManager.hpp.
|
private |
Vulkan command pool used for rendering.
Definition at line 67 of file objectManager.hpp.
|
private |
Pointer to the Chronos::Engine::Device used for rendering.
Definition at line 61 of file objectManager.hpp.
|
private |
Vector of Vulkan framebuffers.
Definition at line 69 of file objectManager.hpp.
int Chronos::Engine::ObjectManager::nextFreeObjectNo = 0 |
The index for the next free object.
Definition at line 39 of file objectManager.hpp.
std::map<int, Object*> Chronos::Engine::ObjectManager::objects |
A map of object indices to their corresponding objects.
Definition at line 37 of file objectManager.hpp.
|
private |
Map of objects to be removed.
Definition at line 71 of file objectManager.hpp.
VkRenderPass Chronos::Engine::ObjectManager::renderPass |
Vulkan render pass used for rendering.
Definition at line 56 of file objectManager.hpp.
|
private |
Pointer to the Chronos::Engine::SwapChain used for rendering.
Definition at line 64 of file objectManager.hpp.
VkSampler Chronos::Engine::ObjectManager::textureSampler |
Vulkan sampler for textures.
Definition at line 57 of file objectManager.hpp.