EditorRenderer class
Base classes
-
template<typename Derived>class RendererCore<EditorRenderer>
Public types
- struct GpuInfo
Constructors, destructors, conversion operators
- EditorRenderer() defaulted
- ~EditorRenderer() defaulted
Public functions
- void SetEngine(TrinyxEngine* engine)
- Set the engine pointer for editor use (spawn handshake, scene load, etc.).
- void NoteInput(const PlatformEvent& event)
- Note what the editor's camera and file drops need from an event. Sentinel.
- auto EditorOwnsKeyboard() const -> bool
- void SetEditorOwnsKeyboard(bool owns)
- auto EditorCapturesMouse() const -> bool
- void SetEditorCapturesMouse(bool captures)
- auto GetMouseRelX() const -> float
- Relative mouse motion and wheel since the last frame. Render thread only.
- auto GetMouseRelY() const -> float
- auto GetMouseWheel() const -> float
- void ResizeEditorViewport(uint32_t width, uint32_t height)
- Called by EditorContext when the "Viewport" panel resizes.
- void SetEditorViewportActive(bool active)
- auto GetEditorViewport() -> WorldViewport&
- The editor's main viewport — owns the edit camera. Render thread only.
- void RequestScenePick(int32_t x, int32_t y, int32_t width, int32_t height, uint32_t tag)
- auto TakeScenePick(std::vector<uint32_t>& entities, uint32_t& tag) -> bool
- The entities (cache indices, each once) under the last request read back; false if none.
- auto GetGpuInfo() const -> GpuInfo
- void SetGridShown(bool bShown)
- The ground grid in the edit viewport.
- void AddViewport(WorldViewport* vp)
- void RemoveViewport(WorldViewport* vp)
- void AllocateViewportResources(WorldViewport* vp, uint32_t width, uint32_t height)
- void FreeViewportResources(WorldViewport* vp)
- void ResizeViewport(WorldViewport* vp, uint32_t width, uint32_t height)
- Resize a PIE viewport's GPU resources if its panel size changed.
Function documentation
bool EditorRenderer:: EditorOwnsKeyboard() const
True when the editor owns keyboard input (default). False when the viewport is active (right-click held) or Play mode is running.
bool EditorRenderer:: EditorCapturesMouse() const
True while an editor tool (viewport fly) needs relative mouse mode without routing input to the engine. Sentinel applies it alongside EditorOwnsKeyboard.
void EditorRenderer:: SetEditorViewportActive(bool active)
Enable or disable rendering the editor world. Call with false during PIE to avoid running the full compute pipeline for a world that isn't displayed.
void EditorRenderer:: RequestScenePick(int32_t x,
int32_t y,
int32_t width,
int32_t height,
uint32_t tag)
Read back which entities cover a rectangle of the edit viewport, in its pixels. One request a frame: a newer one replaces one not yet recorded. The answer comes a few frames later, through TakeScenePick, with the same tag.