3#include <cgv/gui/theme_info.h>
4#include <cgv/render/managed_frame_buffer.h>
5#include <cgv_g2d/canvas.h>
6#include <cgv_g2d/shape2d_styles.h>
7#include <cgv_overlay/overlay.h>
16 bool has_damage_ =
true;
17 bool recreate_layout_requested_ =
true;
19 cgv::g2d::shape2d_style blit_style_;
24 cgv::g2d::canvas overlay_canvas, content_canvas;
25 bool draw_in_finish_frame =
false;
28 void post_recreate_layout();
32 bool is_damaged()
const;
40 virtual void init_styles() {}
42 void register_shader(
const std::string&
name,
const std::string& filename);
52 virtual void on_set(
void* member_ptr)
override;
62 void post_damage(
bool redraw =
true);
86#include <cgv/config/lib_end.h>
std::string name
store the name as a string
reference counted pointer, which can work together with types that are derived from ref_counted,...
bool init(cgv::render::context &ctx) override
this method is called after creation or recreation of the context, return whether all necessary funct...
ivec2 get_local_mouse_pos(ivec2 mouse_pos) const override
return the mouse position local to the container of this overlay taking the canvas origin into accoun...
virtual void handle_member_change(cgv::data::informed_ptr ptr) override
implement to handle member changes
bool is_hit_local(const ivec2 &local_mouse_pos) const
See is_hit.
canvas_overlay()
creates an overlay in the bottom left corner with zero size using a canvas for 2d drawing
bool is_hit(const ivec2 &mouse_pos) const override
Test if the mouse pointer is hovering over this overlay and returns true if this is the case.
virtual void on_set(void *member_ptr) override
default implementation of that calls handle_member_change and afterwards upates the member in the gui...
virtual void draw_content(cgv::render::context &ctx)=0
draw_content is implemented by decendent classes
void set_draw_in_finish_frame(bool enable=true)
set the drawing of the content to be in finish_frame (enable = true) or after_finish (enable = false)
void clear(cgv::render::context &ctx) override
clear all objects living in the context like textures or display lists
base class for all drawables, which is independent of the used rendering API.
provides a class that manages a frame buffer along with its attachments
this header is dependency free
cgv::math::fvec< int32_t, 2 > ivec2
declare type of 2d 32 bit integer vectors