You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
899 B
41 lines
899 B
/* |
|
* Copyright (C) 2022 Riyyi |
|
* |
|
* SPDX-License-Identifier: MIT |
|
*/ |
|
|
|
#pragma once |
|
|
|
#include <cstdint> // std::uint32_t |
|
#include <memory> // std::shared_ptr |
|
#include <optional> // std::optional |
|
#include <vector> // std::vector |
|
|
|
#include "glm/ext/vector_float3.hpp" // glm::vec3 |
|
#include "ruc/singleton.h" |
|
|
|
#include "inferno/render/renderer.h" |
|
|
|
namespace Inferno { |
|
|
|
using CharacterQuad = std::array<CharacterVertex, Renderer::vertexPerQuad>; |
|
|
|
class Font; |
|
class Scene; |
|
|
|
class TextAreaSystem final : public ruc::Singleton<TextAreaSystem> { |
|
public: |
|
TextAreaSystem(s); |
|
virtual ~TextAreaSystem(); |
|
|
|
void render(); |
|
|
|
void setScene(Scene* scene) { m_scene = scene; } |
|
|
|
private: |
|
std::optional<CharacterQuad> calculateCharacterQuad(unsigned char character, unsigned char previous, std::shared_ptr<Font> font, float& advanceX, float& advanceY); |
|
|
|
Scene* m_scene { nullptr }; |
|
}; |
|
|
|
} // namespace Inferno
|
|
|