Phosphor
Qt6 / Wayland library suite for window-management tools
Loading...
Searching...
No Matches
PhosphorPointerShaders::PointerUniformsTail Struct Reference

C++ mirror of the POINTER contract's UBO tail. More...

#include <PhosphorPointer/PointerShaderUniforms.h>

Public Attributes

float uPointerVelocity [4]
 .xy device px/s, .z speed (length), .w unused.
float uPointerPress [4]
 .xy canvas px of the last press, .z seconds since (1e6 when none), .w button (1 left, 2 right, 3 middle, 0 none).
float uPointerRelease [4]
 Same shape for the last release.
float uPointerState [4]
 .x pressed-button bitmask (1 left, 2 right, 4 middle), .y seconds since the last motion, .z logical-to-device scale, .w trail count (0..32).
float uCursorRect [4]
 Cursor sprite rect in canvas px (x, y, w, h), hotspot applied.
float uPointerFlags [4]
 .x = 1 when uCursorSprite is bound, .yzw reserved 0.
float uPointerTrail [32][4]
 Newest first: .xy canvas px, .z age seconds, .w speed at the sample.

Detailed Description

C++ mirror of the POINTER contract's UBO tail.

The preview runtime's UBO is PhosphorShaders::BaseUniforms (672 bytes, binding 0) followed byte-for-byte by this struct, matching the #else (non-PLASMAZONES_KWIN) branch of data/pointer/shared/pointer_uniforms.glsl. The compositor pushes the same fields as loose uniforms and never touches this layout.

Every field is a vec4 (or a vec4 array), so std140 introduces no padding and the offsets below are simply cumulative. The static_asserts pin them: reorder or resize a field here and the corresponding assert fails at compile time, at which point the GLSL block's documented offsets MUST be updated to match.

Member Data Documentation

◆ uCursorRect

float PhosphorPointerShaders::PointerUniformsTail::uCursorRect[4]

Cursor sprite rect in canvas px (x, y, w, h), hotspot applied.

◆ uPointerFlags

float PhosphorPointerShaders::PointerUniformsTail::uPointerFlags[4]

.x = 1 when uCursorSprite is bound, .yzw reserved 0.

◆ uPointerPress

float PhosphorPointerShaders::PointerUniformsTail::uPointerPress[4]

.xy canvas px of the last press, .z seconds since (1e6 when none), .w button (1 left, 2 right, 3 middle, 0 none).

◆ uPointerRelease

float PhosphorPointerShaders::PointerUniformsTail::uPointerRelease[4]

Same shape for the last release.

◆ uPointerState

float PhosphorPointerShaders::PointerUniformsTail::uPointerState[4]

.x pressed-button bitmask (1 left, 2 right, 4 middle), .y seconds since the last motion, .z logical-to-device scale, .w trail count (0..32).

◆ uPointerTrail

float PhosphorPointerShaders::PointerUniformsTail::uPointerTrail[32][4]

Newest first: .xy canvas px, .z age seconds, .w speed at the sample.

◆ uPointerVelocity

float PhosphorPointerShaders::PointerUniformsTail::uPointerVelocity[4]

.xy device px/s, .z speed (length), .w unused.


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