Renders themed background effects for docking windows. More...
#include <background_renderer.h>
Classes | |
struct | GridSettings |
Public Member Functions | |
void | RenderDockingBackground (ImDrawList *draw_list, const ImVec2 &window_pos, const ImVec2 &window_size, const Color &theme_color) |
void | RenderGridBackground (ImDrawList *draw_list, const ImVec2 &window_pos, const ImVec2 &window_size, const Color &grid_color) |
void | RenderRadialGradient (ImDrawList *draw_list, const ImVec2 ¢er, float radius, const Color &inner_color, const Color &outer_color) |
void | SetGridSettings (const GridSettings &settings) |
const GridSettings & | GetGridSettings () const |
void | UpdateAnimation (float delta_time) |
void | SetAnimationEnabled (bool enabled) |
void | UpdateForTheme (const Color &primary_color, const Color &background_color) |
void | DrawSettingsUI () |
Static Public Member Functions | |
static BackgroundRenderer & | Get () |
Private Member Functions | |
BackgroundRenderer ()=default | |
float | CalculateRadialFade (const ImVec2 &pos, const ImVec2 ¢er, float max_distance) const |
ImU32 | BlendColorWithFade (const Color &base_color, float fade_factor) const |
void | DrawGridLine (ImDrawList *draw_list, const ImVec2 &start, const ImVec2 &end, ImU32 color, float thickness) const |
void | DrawGridDot (ImDrawList *draw_list, const ImVec2 &pos, ImU32 color, float size) const |
Private Attributes | |
GridSettings | grid_settings_ |
float | animation_time_ = 0.0f |
Color | cached_grid_color_ {0.5f, 0.5f, 0.5f, 0.1f} |
Renders themed background effects for docking windows.
Definition at line 14 of file background_renderer.h.
|
privatedefault |
|
static |
Definition at line 18 of file background_renderer.cc.
Referenced by yaze::gui::DockSpaceRenderer::BeginEnhancedDockSpace(), yaze::gui::DrawDisplaySettings(), yaze::gui::DrawDisplaySettingsForPopup(), and yaze::editor::EditorManager::Update().
void yaze::gui::BackgroundRenderer::RenderDockingBackground | ( | ImDrawList * | draw_list, |
const ImVec2 & | window_pos, | ||
const ImVec2 & | window_size, | ||
const Color & | theme_color | ||
) |
Definition at line 23 of file background_renderer.cc.
References yaze::gui::Color::alpha, animation_time_, yaze::gui::ConvertColorToImVec4(), yaze::core::TimingManager::Get(), yaze::gui::ThemeManager::Get(), grid_settings_, yaze::gui::BackgroundRenderer::GridSettings::grid_size, yaze::gui::Color::red, RenderGridBackground(), and UpdateAnimation().
void yaze::gui::BackgroundRenderer::RenderGridBackground | ( | ImDrawList * | draw_list, |
const ImVec2 & | window_pos, | ||
const ImVec2 & | window_size, | ||
const Color & | grid_color | ||
) |
Definition at line 73 of file background_renderer.cc.
References yaze::gui::Color::alpha, yaze::gui::BackgroundRenderer::GridSettings::animation_speed, animation_time_, BlendColorWithFade(), yaze::gui::Color::blue, yaze::gui::BackgroundRenderer::GridSettings::breathing_intensity, yaze::gui::BackgroundRenderer::GridSettings::breathing_speed, yaze::gui::BackgroundRenderer::GridSettings::dot_size, DrawGridDot(), DrawGridLine(), yaze::gui::BackgroundRenderer::GridSettings::enable_animation, yaze::gui::BackgroundRenderer::GridSettings::enable_breathing, yaze::gui::BackgroundRenderer::GridSettings::enable_dots, yaze::gui::BackgroundRenderer::GridSettings::fade_distance, yaze::gui::Color::green, grid_settings_, yaze::gui::BackgroundRenderer::GridSettings::grid_size, yaze::gui::BackgroundRenderer::GridSettings::line_thickness, yaze::gui::BackgroundRenderer::GridSettings::opacity, yaze::gui::BackgroundRenderer::GridSettings::radial_fade, and yaze::gui::Color::red.
Referenced by DrawSettingsUI(), and RenderDockingBackground().
void yaze::gui::BackgroundRenderer::RenderRadialGradient | ( | ImDrawList * | draw_list, |
const ImVec2 & | center, | ||
float | radius, | ||
const Color & | inner_color, | ||
const Color & | outer_color | ||
) |
Definition at line 179 of file background_renderer.cc.
References yaze::gui::Color::alpha, yaze::gui::Color::blue, yaze::gui::ConvertColorToImVec4(), yaze::gui::Color::green, M_PI, and yaze::gui::Color::red.
|
inline |
Definition at line 42 of file background_renderer.h.
References grid_settings_.
|
inline |
Definition at line 43 of file background_renderer.h.
References grid_settings_.
void yaze::gui::BackgroundRenderer::UpdateAnimation | ( | float | delta_time | ) |
Definition at line 225 of file background_renderer.cc.
References animation_time_, yaze::gui::BackgroundRenderer::GridSettings::enable_animation, and grid_settings_.
Referenced by RenderDockingBackground().
|
inline |
Definition at line 47 of file background_renderer.h.
References yaze::gui::BackgroundRenderer::GridSettings::enable_animation, and grid_settings_.
void yaze::gui::BackgroundRenderer::UpdateForTheme | ( | const Color & | primary_color, |
const Color & | background_color | ||
) |
Definition at line 231 of file background_renderer.cc.
References yaze::gui::Color::blue, cached_grid_color_, yaze::gui::Color::green, grid_settings_, yaze::gui::BackgroundRenderer::GridSettings::opacity, and yaze::gui::Color::red.
void yaze::gui::BackgroundRenderer::DrawSettingsUI | ( | ) |
Definition at line 241 of file background_renderer.cc.
References yaze::gui::BackgroundRenderer::GridSettings::animation_speed, yaze::gui::BackgroundRenderer::GridSettings::breathing_intensity, yaze::gui::BackgroundRenderer::GridSettings::breathing_speed, yaze::gui::BackgroundRenderer::GridSettings::dot_size, yaze::gui::BackgroundRenderer::GridSettings::enable_animation, yaze::gui::BackgroundRenderer::GridSettings::enable_breathing, yaze::gui::BackgroundRenderer::GridSettings::enable_dots, yaze::gui::BackgroundRenderer::GridSettings::fade_distance, yaze::gui::ThemeManager::Get(), grid_settings_, yaze::gui::BackgroundRenderer::GridSettings::grid_size, yaze::gui::BackgroundRenderer::GridSettings::line_thickness, yaze::gui::BackgroundRenderer::GridSettings::opacity, yaze::gui::BackgroundRenderer::GridSettings::radial_fade, and RenderGridBackground().
|
private |
Definition at line 310 of file background_renderer.cc.
|
private |
Definition at line 317 of file background_renderer.cc.
References yaze::gui::Color::alpha, yaze::gui::Color::blue, yaze::gui::ConvertColorToImVec4(), yaze::gui::Color::green, and yaze::gui::Color::red.
Referenced by RenderGridBackground().
|
private |
Definition at line 327 of file background_renderer.cc.
Referenced by RenderGridBackground().
|
private |
Definition at line 332 of file background_renderer.cc.
Referenced by RenderGridBackground().
|
private |
Definition at line 58 of file background_renderer.h.
Referenced by DrawSettingsUI(), GetGridSettings(), RenderDockingBackground(), RenderGridBackground(), SetAnimationEnabled(), SetGridSettings(), UpdateAnimation(), and UpdateForTheme().
|
private |
Definition at line 59 of file background_renderer.h.
Referenced by RenderDockingBackground(), RenderGridBackground(), and UpdateAnimation().
|
private |
Definition at line 60 of file background_renderer.h.
Referenced by UpdateForTheme().