mirror of
https://github.com/zhenyan121/Cubed.git
synced 2026-08-09 02:07:04 +08:00
refactor(ui): replace Text with Label/Widget component system
Replace the old `Text` class with a new component-based UI system consisting of `Widget` and `Label` classes. Key changes: - Remove `Text` class and its GPU upload logic; introduce `Label` as a `Widget` subclass with dirty-flag vertex update. - Add `UIVertexData` struct to manage per-label vertex buffer/array and memory. - Refactor `DebugCollector` to store labels in a `Widget` tree, removing hash-based lookup. - Simplify `Font::vertices()` signature by removing position/scale parameters; scaling is now applied in the renderer’s model matrix. - Update `Renderer` with `render_label()` and move UI rendering to a `render_ui()` that renders the widget tree. - Add new source files `label.cpp`, `widget.cpp`, `ui_vertex_data.cpp` and update CMakeLists.
This commit is contained in:
@@ -17,7 +17,6 @@ target_sources(${PROJECT_NAME}
|
||||
tools/shader_tools.cpp
|
||||
tools/font.cpp
|
||||
tools/perlin_noise.cpp
|
||||
ui/text.cpp
|
||||
window.cpp
|
||||
gameplay/builders/biome_builder.cpp
|
||||
gameplay/builders/plain_builder.cpp
|
||||
@@ -59,4 +58,7 @@ target_sources(${PROJECT_NAME}
|
||||
render/frame_buffer.cpp
|
||||
render/shader_manager.cpp
|
||||
render/world_renderer.cpp
|
||||
ui/widget.cpp
|
||||
ui/label.cpp
|
||||
ui/ui_vertex_data.cpp
|
||||
)
|
||||
Reference in New Issue
Block a user