AUI Framework  master
Cross-platform module-based framework for developing C++20 desktop applications
ARenderContext Struct Reference

Render context passed to AView::render. More...

Detailed Description

Render context passed to AView::render.

View containers are responsible to modify (by withShiftedPosition) and passthrough clip optimization context in order to determine which views do not affect actual renderbuffer image and thus should not be rendered either. It's applicable for AScrollArea in the first place, or any other container with AOverflow::HIDDEN and a possibility to either direct or indirect children to run out (render outside) of that container.

View containers are also responsible to skip rendering of views that are outside of the clipping.

ARenderContext is useful only for container views.

ARenderContext passed to the view (possibly AViewContainer) describes an axis aligned bounding box relative to it's coordinate space (position).

Root (window) and AOverflow::HIDDEN containers should create ARenderContext with position = {0, 0} and size = it's size. Other containers should not affect ARenderContext and pass it to it's children as is, in exception to position, which should be subtracted by view's position.

See UIRenderOptimizationTest for tests.

Examples
/github/workspace/aui.views/src/AUI/View/AView.h.

Public Types

using Rectangles = AStaticVector< ARect< int >, 8 >
 

Public Member Functions

void clip (ARect< int > clipping)
 
ARenderContext withShiftedPosition (glm::ivec2 by) const noexcept
 

Signals and public fields

Rectangles clippingRects
 Axis aligned bounding boxes where the rendering is performed in, used for optimization.
 
IRendererrender
 

#include <AUI/Render/ARenderContext.h>


The documentation for this struct was generated from the following files:
Collaboration diagram for ARenderContext: