ezEngine Release 26.9
Loading...
Searching...
No Matches
ezMouseCursorRenderer Class Reference

#include <MouseCursorRenderer.h>

Public Member Functions

void SetSwapChain (ezGALSwapChainHandle hSwapChain)
 

Detailed Description

Renders the custom mouse cursor that was set through ezInputManager::SetMouseCursor().

The cursor identifier (ezMouseCursorDesc::m_sCursor) may be the GUID or path of either

  • a 2D texture asset - it is then rendered with the built-in Shaders/MouseCursor/MouseCursor.ezShader, or
  • a material asset - which allows for arbitrary custom cursor effects.

The cursor is drawn as a single quad that is generated from SV_VertexID, so it needs neither a vertex nor an index buffer. A custom cursor material has to follow these rules:

  • Its vertex shader has to #include <Shaders/MouseCursor/MouseCursorCommon.h> and return ezMouseCursorVertex(VertexID), or do the equivalent math itself, using ezMouseCursorConstants.
  • It must set up its own render state (no depth test, no culling, alpha blending).
  • It must not use constant buffer slot 3 in the EZ_GAL_BIND_GROUP_FRAME bind group, that one holds ezMouseCursorConstants.
  • It must not declare permutation variables and it must not read ezGlobalConstants, except for the time constants. Outside of a render pipeline neither is in a defined state.

Member Function Documentation

◆ SetSwapChain()

void ezMouseCursorRenderer::SetSwapChain ( ezGALSwapChainHandle  hSwapChain)
inline

Sets which swap-chain to render the cursor into. Without this, nothing is rendered.

ezGameState::SetupMainView() sets this up for the main window automatically.


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