Blender V5.0
blender::draw::overlay::Text Class Reference

#include <overlay_text.hh>

Inherits blender::draw::overlay::Overlay.

Public Member Functions

 Text (SelectionType selection_type)
void begin_sync (Resources &res, const State &state) final
void edit_object_sync (Manager &manager, const ObjectRef &ob_ref, Resources &res, const State &) final
void end_sync (Resources &res, const State &state) final
void draw (Framebuffer &framebuffer, Manager &manager, View &view) final

Detailed Description

Text objects related overlays. Currently only display cursor and selection of text edit mode.

Definition at line 24 of file overlay_text.hh.

Constructor & Destructor Documentation

◆ Text()

blender::draw::overlay::Text::Text ( SelectionType selection_type)
inline

Definition at line 42 of file overlay_text.hh.

Member Function Documentation

◆ begin_sync()

void blender::draw::overlay::Text::begin_sync ( Resources & ,
const State &  )
inlinefinalvirtual

Synchronization creates and fill render passes based on context state and scene state.

It runs for every scene update, so keep computation overhead low. If it is triggered, everything in the scene is considered updated. Note that this only concerns the render passes, the mesh batch caches are updated on a per object-data basis.

IMPORTANT: Synchronization must be view agnostic. That is, not rely on view position, projection matrix or frame-buffer size to do conditional pass creation. This is because, by design, syncing can happen once and rendered multiple time (multi view rendering, stereo rendering, orbiting view ...). Conditional pass creation, must be done in the drawing callbacks, but they should remain the exception. Also there will be no access to object data at this point. Creates passes used for object sync and enabling / disabling internal overlay types (e.g. vertices, edges, faces in edit mode). Runs once at the start of the sync cycle. Should also contain passes setup for overlays that are not per object overlays (e.g. Grid).

This method must be implemented.

Implements blender::draw::overlay::Overlay.

Definition at line 44 of file overlay_text.hh.

References DRW_CLIPPING_UBO_SLOT, DRW_STATE_BLEND_ALPHA, DRW_STATE_DEPTH_GREATER_EQUAL, DRW_STATE_WRITE_COLOR, blender::draw::overlay::Overlay::enabled_, OVERLAY_GLOBALS_SLOT, srgb_to_linearrgb_v4(), state, TH_WIDGET_TEXT_CURSOR, TH_WIDGET_TEXT_HIGHLIGHT, TH_WIDGET_TEXT_SELECTION, and UI_GetThemeColor4fv().

◆ draw()

void blender::draw::overlay::Text::draw ( Framebuffer & framebuffer,
Manager & manager,
View & view )
inlinefinalvirtual

◆ edit_object_sync()

void blender::draw::overlay::Text::edit_object_sync ( Manager & ,
const ObjectRef & ,
Resources & ,
const State &  )
inlinefinalvirtual

Fills passes or buffers for each object in edit mode. Runs for each individual object state for a specific mode. IMPORTANT: Can run only once for instances using the same state (ObjectRef might contains instancing data).

Reimplemented from blender::draw::overlay::Overlay.

Definition at line 102 of file overlay_text.hh.

References DRW_object_get_data_for_drawing(), and blender::draw::overlay::Overlay::enabled_.

Referenced by blender::draw::overlay::Instance::object_sync().

◆ end_sync()

void blender::draw::overlay::Text::end_sync ( Resources & ,
const State &  )
inlinefinalvirtual

Finalize passes or buffers used for object sync. Runs once at the start of the sync cycle.

Reimplemented from blender::draw::overlay::Overlay.

Definition at line 117 of file overlay_text.hh.

References DRW_STATE_DEPTH_LESS_EQUAL, DRW_STATE_WRITE_COLOR, DRW_STATE_WRITE_DEPTH, blender::draw::overlay::Overlay::enabled_, and state.


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