Chronos 0.0
A advanced 2D rendering and animation system
|
#include <ColoredRectangle.hpp>
Public Member Functions | |
void | init (Chronos::Engine::Device *device, VkCommandPool commandPool, Chronos::Engine::SwapChain *swapChain, VkSampler textureSampler, VkRenderPass *renderPass) |
void | update (uint32_t currentFrame) override |
Updates the object for the current frame. | |
void | destroy () override |
Destroys the object and releases associated resources. | |
void | render (uint32_t currentFrame, uint32_t imageIndex, float bgColor[3], VkViewport &viewport, VkRect2D &scissor, std::vector< VkCommandBuffer > &commandBuffers) override |
![]() | |
void | init (Chronos::Engine::Device *device, VkCommandPool commandPool, SwapChain *swapChain, VkSampler textureSampler, VkRenderPass *renderPass, ObjectType objectType, unsigned char *vertShaderCode, int vertShaderCodeSize, unsigned char *fragShaderCode, int fragShaderCodeSize) |
Initializes the object. | |
void | recreateGraphicsPipeline () |
Recreates the graphics pipeline for the object. | |
Public Attributes | |
const std::vector< uint16_t > | indices = std::vector<uint16_t> { 0, 1, 2, 2, 3, 0 } |
Chronos::Manager::ShapeParams | params |
const std::vector< ColorVertex > | vertices |
Chronos::Engine::Buffer | vertexBuffer |
The vertex buffer that is used to store the vertices. | |
Chronos::Engine::Buffer | indexBuffer |
The index buffer that is used to store the indices. | |
![]() | |
VkPipeline | graphicsPipeline |
VkPipelineLayout | pipelineLayout |
std::vector< VkDescriptorSet > | descriptorSets |
Chronos::Engine::ObjectType | objectType |
Private Member Functions | |
void | createDescriptorSets () override |
std::vector< VkDescriptorType > | getDescriptorTypes () override |
std::vector< VkShaderStageFlagBits > | getDescriptorStages () override |
PipelineAttributes | getPipelineAttributes () override |
Private Attributes | |
std::vector< Chronos::Engine::ColorBuffer > | colorBuffers |
Additional Inherited Members | |
![]() | |
void | createGraphicsPipeline () |
Creates the graphics pipeline for the object. | |
void | createDescriptorPool () |
Creates the Vulkan descriptor pool for the object. | |
void | createDescriptorSetLayout () |
Creates the Vulkan descriptor set layout for the object. | |
![]() | |
Chronos::Engine::Device * | device |
Chronos::Engine::SwapChain * | swapChain |
VkCommandPool | commandPool |
VkSampler | textureSampler |
VkRenderPass * | renderPass |
VkDescriptorSetLayout | descriptorSetLayout |
VkDescriptorPool | descriptorPool |
std::vector< Chronos::Engine::UniformBuffer > | uniformBuffers |
Definition at line 33 of file ColoredRectangle.hpp.
|
overrideprivatevirtual |
Implements Chronos::Engine::Object.
Definition at line 74 of file ColoredRectangle.cpp.
References MAX_FRAMES_IN_FLIGHT.
|
overridevirtual |
Destroys the object and releases associated resources.
This method is responsible for cleaning up the object's resources, including uniform buffers, descriptor pool, descriptor set layout, graphics pipeline, and pipeline layout.
Implements Chronos::Engine::Object.
Definition at line 64 of file ColoredRectangle.cpp.
References Chronos::Engine::Object::destroy(), and MAX_FRAMES_IN_FLIGHT.
|
overrideprivatevirtual |
Implements Chronos::Engine::Object.
Definition at line 132 of file ColoredRectangle.cpp.
|
overrideprivatevirtual |
Implements Chronos::Engine::Object.
Definition at line 125 of file ColoredRectangle.cpp.
|
overrideprivatevirtual |
Implements Chronos::Engine::Object.
Definition at line 139 of file ColoredRectangle.cpp.
References Chronos::Engine::PipelineAttributes::attributeDescriptions, Chronos::Engine::PipelineAttributes::bindingDescriptions, Chronos::Engine::PipelineAttributes::colorBlendAttachment, Chronos::Engine::PipelineAttributes::frontFace, Chronos::Engine::ColorVertex::getAttributeDescriptions(), Chronos::Engine::ColorVertex::getBindingDescription(), and Chronos::Engine::PipelineAttributes::topology.
void Chronos::Engine::ColoredRectangle::init | ( | Chronos::Engine::Device * | device, |
VkCommandPool | commandPool, | ||
Chronos::Engine::SwapChain * | swapChain, | ||
VkSampler | textureSampler, | ||
VkRenderPass * | renderPass | ||
) |
Definition at line 27 of file ColoredRectangle.cpp.
References colorBuffers, Chronos::Engine::Object::commandPool, Chronos::Engine::Buffer::copy(), Chronos::Engine::Buffer::create(), Chronos::Engine::Object::device, indexBuffer, indices, Chronos::Engine::Object::init(), MAX_FRAMES_IN_FLIGHT, Chronos::Engine::Object::renderPass, Chronos::Engine::Buffer::size, Chronos::Engine::Object::swapChain, Chronos::Engine::Object::textureSampler, Chronos::Engine::TypeColoredRectangle, vertexBuffer, and vertices.
|
overridevirtual |
Implements Chronos::Engine::Object.
Definition at line 178 of file ColoredRectangle.cpp.
|
overridevirtual |
Updates the object for the current frame.
This pure virtual method must be implemented by derived classes to perform any updates required for the object during each frame. The currentFrame
parameter represents the index of the current frame in the application.
currentFrame | Index of the current frame. |
Implements Chronos::Engine::Object.
Definition at line 56 of file ColoredRectangle.cpp.
|
private |
Definition at line 66 of file ColoredRectangle.hpp.
Chronos::Engine::Buffer Chronos::Engine::ColoredRectangle::indexBuffer |
The index buffer that is used to store the indices.
Definition at line 59 of file ColoredRectangle.hpp.
const std::vector<uint16_t> Chronos::Engine::ColoredRectangle::indices = std::vector<uint16_t> { 0, 1, 2, 2, 3, 0 } |
Definition at line 40 of file ColoredRectangle.hpp.
Chronos::Manager::ShapeParams Chronos::Engine::ColoredRectangle::params |
Definition at line 42 of file ColoredRectangle.hpp.
Chronos::Engine::Buffer Chronos::Engine::ColoredRectangle::vertexBuffer |
The vertex buffer that is used to store the vertices.
Definition at line 51 of file ColoredRectangle.hpp.
const std::vector<ColorVertex> Chronos::Engine::ColoredRectangle::vertices |
Definition at line 43 of file ColoredRectangle.hpp.