Change TextDrawable base class

This commit is contained in:
Georg Hagen
2025-01-04 03:08:06 +01:00
parent 94025c79c6
commit ca93036f31
5 changed files with 101 additions and 45 deletions

View File

@@ -6,9 +6,8 @@
#pragma once
#include "SimpleDrawable.hpp"
#include "Drawable.hpp"
#include "Texture.hpp"
#include "Material.hpp"
#include "Geometry.hpp"
#include "UniformBuffer.hpp"
#include "AtlasData.hpp"
@@ -26,10 +25,9 @@ namespace OpenVulkano::Scene
float smoothing = 1.f/32.f;
};
class TextDrawable : public SimpleDrawable
class TextDrawable : public Drawable
{
Geometry m_geometry;
Material m_material;
UniformBuffer m_uniBuffer;
std::shared_ptr<AtlasData> m_atlasData;
Math::AABB m_bbox;
@@ -52,5 +50,9 @@ namespace OpenVulkano::Scene
[[nodiscard]] TextConfig& GetConfig() { return m_cfg; }
[[nodiscard]] const std::string& GetText() const { return m_text; }
[[nodiscard]] const std::shared_ptr<AtlasData> GetAtlasData() { return m_atlasData; }
[[nodiscard]] Geometry* GetGeometry() { return &m_geometry; }
[[nodiscard]] Texture* GetTexture() { return &m_atlasData->texture; }
[[nodiscard]] UniformBuffer* GetUniformBuffer() { return &m_uniBuffer; }
};
}