gdk-graphics 0a0aef92e917cfbac53dffbc32c295e4de914093
Loading...
Searching...
No Matches
font_texture.h
1// © Joseph Cameron - MIT License
2
3#ifndef GDK_GRAPHICS_EXT_FONT_TEXTURE_H
4#define GDK_GRAPHICS_EXT_FONT_TEXTURE_H
5
6#include <gdk/graphics/context.h>
7#include <gdk/graphics/ext/font.h>
8#include <gdk/graphics/texture.h>
10
11#include <cstddef>
12#include <memory>
13
14namespace gdk::graphics::ext {
16 class font_texture final {
17 public:
21 void upload();
22
24 [[nodiscard]] texture_ptr_type texture() const;
25
27 [[nodiscard]] std::size_t uploaded_atlas_generation() const;
28
30 [[nodiscard]] const std::shared_ptr<font> &typeface() const;
31
32 font_texture(context_ptr_type aContext, std::shared_ptr<font> aFont);
33
34 private:
35 context_ptr_type m_pContext;
36 std::shared_ptr<font> m_pFont;
37 texture_ptr_type m_pTexture;
38 std::size_t m_UploadedAtlasGeneration = 0;
39 texture_data::channel_data m_Rgba;
40 };
41}
42
43#endif
void upload()
brings the texture up to the atlas: what has changed since the last upload is patched in,...
std::size_t uploaded_atlas_generation() const
the atlas generation the texture holds
texture_ptr_type texture() const
the texture, null before the first upload
const std::shared_ptr< font > & typeface() const
the font whose atlas this is
what the core takes: decoded channel data and the metadata describing it