30#pragma GCC diagnostic push
31#pragma GCC diagnostic ignored "-Wunused-function"
33#pragma clang diagnostic ignored "-Weverything"
36#include "stb_font_consolas_24_latin1.inl"
38#pragma GCC diagnostic pop
61 void (*
getFontData)(stb_fontchar*,
unsigned char[][256], int);
129 void render(uint32_t currentFrame, uint32_t imageIndex,
130 float bgColor[3], VkViewport& viewport, VkRect2D& scissor,
131 std::vector<VkCommandBuffer>& commandBuffers)
override;
139 void update(uint32_t currentFrame)
override;
This initializes, manages and destroys the logical and physical devices(GPU).
Abstract class for creating and managing generic graphical objects.
VkCommandPool commandPool
Chronos::Engine::SwapChain * swapChain
Chronos::Engine::Device * device
VkRenderPass * renderPass
Class for creating a text object for rendering text.
void destroy() override
Destroys the font object and frees the memory.
Chronos::Engine::Texture fontTexture
std::vector< VkShaderStageFlagBits > getDescriptorStages() override
Gets the descriptor stages in which the descriptor sets are used.
uint32_t maxTextLength
Maximum number of characters that can be rendered.
std::vector< VkDescriptorType > getDescriptorTypes() override
Gets the descriptor types needed for rendering the text.
Chronos::Engine::TextParams params
Various parameters of the text that are set by the user.
VkDeviceMemory vertexBufferMemory
The vertex buffer memory.
std::vector< Chronos::Engine::ColorBuffer > colorBuffers
void clear()
Clears the text stored in the font object.
void update(uint32_t currentFrame) override
Updates the attributes(like position, color, etc) of the text.
void init(Chronos::Engine::Device *device, VkCommandPool commandPool, Chronos::Engine::SwapChain *swapChain, VkSampler textureSampler, VkRenderPass *renderPass, Chronos::Engine::FontTypes fontStyle)
Initializes the font object and creates the necessary objects.
stb_fontchar stbFontData[STB_FONT_consolas_24_latin1_NUM_CHARS]
void createDescriptorSets() override
Creates the descriptor sets needed for rendering the text.
unsigned char(* fontpixels)[256]
PipelineAttributes getPipelineAttributes() override
Returns the pipeline attributes that are set for the graphics pipeline.
uint32_t numLetters
The total number of letters to render.
VkBuffer vertexBuffer
The vertices of each character used for rendering.
void render(uint32_t currentFrame, uint32_t imageIndex, float bgColor[3], VkViewport &viewport, VkRect2D &scissor, std::vector< VkCommandBuffer > &commandBuffers) override
Records the commands needed for rendering the text .
void updateBuffer()
Updates the buffer with the new text.
This class holds the Vulkan data and objects needed for a texture.
Contains ShapeParams and UniformBufferObject structs.
Contains the class for creating a generic object.
The parameters needed for the font style.
void(* getFontData)(stb_fontchar *, unsigned char[][256], int)
Structure defining attributes required for creating a graphics pipeline.
Parameters for rendering text.
Contains the functions for image manipulation along with the Texture class.