6#ifndef TEXT_BUFFER_MANAGER_H_HEADER_GUARD
7#define TEXT_BUFFER_MANAGER_H_HEADER_GUARD
13BGFX_HANDLE(text_buffer_handle)
15#define MAX_TEXT_BUFFER_COUNT 1024
82 void append_text(text_buffer_handle
handle, font_handle fhandle,
const char*
string,
const char*
end =
nullptr);
87 const wchar_t*
string,
88 const wchar_t*
end =
nullptr);
102 uint16_t index_buffer_handle_idx{};
103 uint16_t vertex_buffer_handle_idx{};
106 uint32_t font_type{};
110 bx::HandleAllocT<MAX_TEXT_BUFFER_COUNT> text_buffer_handles_;
112 bgfx::VertexLayout vertex_layout_;
113 bgfx::UniformHandle s_tex_color_;
114 bgfx::UniformHandle u_drop_shadow_color_;
115 bgfx::UniformHandle u_params_;
116 bgfx::ProgramHandle basic_program_;
117 bgfx::ProgramHandle distance_program_;
118 bgfx::ProgramHandle distance_subpixel_program_;
119 bgfx::ProgramHandle distance_outline_program_;
120 bgfx::ProgramHandle distance_outline_image_program_;
121 bgfx::ProgramHandle distance_drop_shadow_program_;
122 bgfx::ProgramHandle distance_drop_shadow_image_program_;
123 bgfx::ProgramHandle distance_outline_drop_shadow_image_program_;
void set_pen_origin(text_buffer_handle handle, float x, float y)
void set_foreground_color(text_buffer_handle handle, uint32_t rgba=0x000000FF)
void destroy_text_buffer(text_buffer_handle handle)
void set_strike_through_color(text_buffer_handle handle, uint32_t rgba=0x000000FF)
void set_drop_shadow_softener(text_buffer_handle handle, float smoother=1.0f)
auto create_text_buffer(uint32_t type, buffer_type::Enum btype) -> text_buffer_handle
void set_style(text_buffer_handle handle, uint32_t flags=style_normal)
void clear_text_buffer(text_buffer_handle handle)
Clear the text buffer and reset its state (pen/color).
void set_outline_width(text_buffer_handle handle, float outline_width=3.0f)
void set_drop_shadow_offset(text_buffer_handle handle, float u, float v)
text_buffer_manager(font_manager *font_manager)
void submit_text_buffer(text_buffer_handle handle, font_handle fhandle, bgfx::ViewId id, uint64_t state=0, int32_t depth=0)
void set_drop_shadow_color(text_buffer_handle handle, uint32_t rgba=0x000000FF)
void set_apply_kerning(text_buffer_handle handle, bool apply_kerning)
void set_text_color(text_buffer_handle handle, uint32_t rgba=0x000000FF)
void set_background_color(text_buffer_handle handle, uint32_t rgba=0x000000FF)
void append_text(text_buffer_handle handle, font_handle fhandle, const char *string, const char *end=nullptr)
Append an ASCII/utf-8 string to the buffer using current pen position and color.
void get_pen_position(text_buffer_handle handle, float *x, float *y)
void set_pen_position(text_buffer_handle handle, float x, float y)
void set_underline_color(text_buffer_handle handle, uint32_t rgba=0x000000FF)
void set_outline_color(text_buffer_handle handle, uint32_t rgba=0x000000FF)
void set_overline_color(text_buffer_handle handle, uint32_t rgba=0x000000FF)
auto get_rectangle(text_buffer_handle handle) const -> text_rectangle
Return the rectangular size of the current text buffer (including all its content).
void append_atlas_face(text_buffer_handle handle, font_handle fhandle, uint16_t face_index)
Append a whole face of the atlas cube, mostly used for debugging and visualizing atlas.
text_style_flags
special style effect (can be combined)
void end(encoder *_encoder)
type of vertex and index buffer to use with a TextBuffer
#define MAX_TEXT_BUFFER_COUNT