15#include <AUI/Common/AStaticVector.h>
16#include <AUI/Geometry2D/ARect.h>
17#include <AUI/Render/ARenderContext.h>
48 using Underlying = std::variant<Empty, Rectangles, Full>;
50 template<aui::convertible_to<Underlying> F>
51 InvalidArea(F&& u)
noexcept: mUnderlying(std::forward<F>(u)) {}
56 bool empty() const noexcept {
57 return std::holds_alternative<Empty>(mUnderlying);
61 bool full() const noexcept {
62 return std::holds_alternative<Full>(mUnderlying);
71 return std::get_if<Rectangles>(&mUnderlying);
74 const Rectangles* rectangles() const noexcept {
75 return std::get_if<Rectangles>(&mUnderlying);
79 Underlying mUnderlying;
120 static void disableForView(
AView& view);
123 static bool isEnabledForView(
AView& view);
Vector-like container up to maxSize elements inplace.
Definition: AStaticVector.h:33
Base class of all UI objects.
Definition: AView.h:77
Rendering view to texture storage interface.
Definition: IRenderViewToTexture.h:26
virtual void end(IRenderer &renderer)=0
Finishes drawing operation started with begin method.
virtual bool begin(IRenderer &renderer, glm::ivec2 surfaceSize, IRenderViewToTexture::InvalidArea &invalidArea)=0
Instructs the renderer to begin drawing to the surface (framebuffer) stored in IRenderViewToTexture.
virtual void draw(IRenderer &renderer)=0
Draws contents of the surface.
Base class for rendering.
Definition: IRenderer.h:149
Axis aligned 2D rectangle.
Definition: ARect.h:24
No redraw.
Definition: IRenderViewToTexture.h:36
Full redraw.
Definition: IRenderViewToTexture.h:41
Defines areas to invalidate (redraw).
Definition: IRenderViewToTexture.h:32
AStaticVector< ARect< int >, ARenderContext::Rectangles::capacity() - 1 > Rectangles
Specific areas redraw.
Definition: IRenderViewToTexture.h:46
void addRectangle(ARect< int > rhs)
Adds rectangle as an invalid area. If needed, switches to full redraw.
Definition: IRenderViewToTexture.cpp:41