29 #include <glm/vec2.hpp>
31 #include "eng3d/ui/barchart.hpp"
32 #include "eng3d/ui/widget.hpp"
33 #include "eng3d/ui/ui.hpp"
34 #include "eng3d/ui/tooltip.hpp"
35 #include "eng3d/texture.hpp"
36 #include "eng3d/rectangle.hpp"
37 #include "eng3d/state.hpp"
60 for(
const auto& slice : data)
66 float last_ratio = 0.f;
67 for(
auto& slice : data) {
69 const float ratio = counter / max;
73 g_ui_context->
obj_shader->set_uniform(
"diffuse_color", glm::vec4(slice.color.r, slice.color.g, slice.color.b, 1.f));
74 draw_rect(0, pos_rect, tex_rect, viewport);
virtual void on_render(Context &ctx, Eng3D::Rect viewport) override
void set_data(std::vector< ChartData > data)
BarChart(int x, int y, unsigned w, unsigned h, std::vector< ChartData > data=std::vector< ChartData >(), Widget *_parent=nullptr)
Generalized chart data, used mostly by chart widgets, however it's not specific to any widget.
The UI context that handles all the ui widgets.
std::unique_ptr< Eng3D::OpenGL::Program > obj_shader
WidgetType
The type of the widget, some widgets share types between them to keep simplicity.