Estella 0.113.0
A fast 2D and 3D game engine powered by WebAssembly and ECS
Loading...
Searching...
No Matches
esengine::UIElementPlugin Class Reference

#include <UIElementPlugin.hpp>

Inheritance diagram for esengine::UIElementPlugin:

Public Member Functions

bool drawsScreenUI () const override
 Whether this plugin can draw an entity that lives in a UI tree.
void collect (RenderCollectContext &ctx) override
const char * collectScope () const override
 What this plugin's collect is called in a frame profile.
Public Member Functions inherited from esengine::BatchPlugin
void init (RenderFrameContext &ctx) override
void shutdown () override
Public Member Functions inherited from esengine::RenderTypePlugin
virtual ~RenderTypePlugin ()=default
virtual bool castsShadows () const
 Whether what this plugin draws belongs in a shadow map.
virtual bool castInputs (RenderFrameContext &, ecs::Registry &, u64 &)
 For a plugin that casts: one number for everything its depth collect reads apart from the shadow views and the frame's camera, so a frame whose number, views and camera match those of the frame that drew the shadow map need not collect it again.
virtual bool castHeldInputs (u64 &) const
virtual u32 castMoverCount () const
virtual bool drawsMotion () const
virtual void scheduleSkins (RenderFrameContext &ctx, ecs::Registry &registry, SkinCache &cache)
 Make ready the programs entities will be asked for, drawing none.
virtual RenderPrewarmResult prewarm (RenderFrameContext &ctx, ecs::Registry &registry, const Entity *entities, u32 count, bool shadowPasses)
virtual RenderPrewarmResult prewarmDocument (RenderFrameContext &ctx, const MeshDocumentRecord *rows, u32 count, bool shadowPasses)
 The same readiness, asked of a PREPARED cell's own description.
virtual bool clusterInspect (u32, u32 &, u32 &) const
 What the last frames drew of the Cluster LOD mesh of the entity entityId.

Static Public Attributes

static constexpr i32 UI_BASE_LAYER = 1000

Additional Inherited Members

Protected Member Functions inherited from esengine::BatchPlugin
void emitQuad (TransientBufferPool &buffers, DrawList &draw_list, const ClipState &clips, const glm::vec3 &position, const glm::vec2 &size, const glm::vec2 &pivotNorm, f32 angle, const glm::vec2 &uvOffset, const glm::vec2 &uvScale, const glm::vec4 &color, const BatchDrawKey &key)
 Emits a single rotated/unrotated textured quad.
void emitNineSlice (TransientBufferPool &buffers, DrawList &draw_list, const ClipState &clips, const glm::vec3 &position, const glm::vec2 &size, const glm::vec2 &pivotNorm, f32 angle, const glm::vec2 &texSize, const glm::vec4 &border, const glm::vec2 &uvOffset, const glm::vec2 &uvScale, const glm::vec4 &color, const BatchDrawKey &key)
 Emits a 3x3 nine-slice grid of quads sharing one BatchDrawKey.
void emitRadialFill (TransientBufferPool &buffers, DrawList &draw_list, const ClipState &clips, const glm::vec3 &center, const glm::vec2 &size, f32 angle, f32 startAngle, f32 sweep, const glm::vec2 &uvOffset, const glm::vec2 &uvScale, const glm::vec4 &color, const BatchDrawKey &key)
 Emits a centered angular wedge (Radial Filled): a triangle fan from the box center out to its perimeter, swept clockwise from startAngle over sweep radians.
Protected Attributes inherited from esengine::BatchPlugin
u32 batch_shader_id_ = 0

Detailed Description

Definition at line 11 of file UIElementPlugin.hpp.

Member Function Documentation

◆ collect()

void esengine::UIElementPlugin::collect ( RenderCollectContext & ctx)
overridevirtual

Implements esengine::RenderTypePlugin.

Definition at line 49 of file UIElementPlugin.cpp.

References esengine::RenderCollectContext::accepts(), esengine::AlphaClip, esengine::Batch, esengine::BatchPlugin::batch_shader_id_, esengine::BatchDrawKey::blend, esengine::RenderCollectContext::buffer_pool, esengine::RenderCollectContext::clip_state, esengine::ecs::Contain, esengine::ctx(), esengine::BatchDrawKey::cull, esengine::RenderCollectContext::culled, esengine::BatchDrawKey::depthBias, esengine::BatchDrawKey::depthTest, esengine::BatchDrawKey::depthWrite, esengine::RenderCollectContext::draw_list, esengine::BatchPlugin::emitNineSlice(), esengine::BatchPlugin::emitQuad(), esengine::BatchPlugin::emitRadialFill(), esengine::ecs::Transform::ensureDecomposed(), esengine::ecs::Fill, esengine::ecs::Filled, esengine::flatHalfExtents(), esengine::flatTurnZ(), esengine::RenderCollectContext::frame_context, esengine::Texture::getHeight(), esengine::Texture::getId(), esengine::Texture::getWidth(), esengine::ecs::hasFlatGeometryArea(), esengine::ecs::Horizontal, esengine::RenderCollectContext::isOverlay(), esengine::isRadialMethod(), esengine::BatchDrawKey::materialId, esengine::ecs::NineSlice, esengine::ecs::None, esengine::Normal, esengine::radialMaxSweep(), esengine::radialStartAngle(), esengine::rebased(), esengine::RenderCollectContext::registry, esengine::ecs::Right, esengine::BatchDrawKey::shaderId, esengine::RenderCollectContext::sortDepth(), esengine::ecs::Stencil, esengine::ecs::Tiled, esengine::ecs::Top, UI_BASE_LAYER, esengine::UIElement, esengine::ecs::Vertical, esengine::RenderCollectContext::visible(), and esengine::writesStencil().

◆ collectScope()

const char * esengine::UIElementPlugin::collectScope ( ) const
inlineoverridevirtual

What this plugin's collect is called in a frame profile.

A literal: the profiler keys scopes by content and keeps the pointer. A type that does not answer is reported as other rather than folded into a neighbour, whose cost it would become.

Reimplemented from esengine::RenderTypePlugin.

Definition at line 15 of file UIElementPlugin.hpp.

◆ drawsScreenUI()

bool esengine::UIElementPlugin::drawsScreenUI ( ) const
inlineoverridevirtual

Whether this plugin can draw an entity that lives in a UI tree.

The overlay collect runs only these. Saying yes is a promise to consult RenderCollectContext::accepts, without which the plugin draws the screen's entities in the world's pass too.

Reimplemented from esengine::RenderTypePlugin.

Definition at line 13 of file UIElementPlugin.hpp.

Member Data Documentation

◆ UI_BASE_LAYER

i32 esengine::UIElementPlugin::UI_BASE_LAYER = 1000
staticconstexpr

The documentation for this class was generated from the following files: