mirror of
https://dev.lirent.ru/Vatrog/vm-vgpu-streamer.git
synced 2026-07-09 21:36:37 +03:00
feat: report on-screen cursor position in producer contract
Append cursor_seq/cursor_visible/cursor_pos to the producer block (host-RO ABI; offsets 168/172/176, existing layout unchanged). Position is reported every pump tick, independent of draw_cursor, so a consumer can overlay its own cursor even when the producer does not composite it. x and y pack into one 8-aligned 64-bit field (single atomic store, no tear); cursor_seq bumps last to gate a consistent read. Adds the vgpu_publish_cursor() engine setter and a lightweight cursor_sample_pos() (position/visibility only, no shape extract) called from the pump.
This commit is contained in:
@@ -105,6 +105,15 @@ int cursor_sample(vgpu_ctx* ctx) {
|
||||
return changed;
|
||||
}
|
||||
|
||||
void cursor_sample_pos(vgpu_ctx* ctx) {
|
||||
vgpu_cursor_t* cur = &ctx->cursor;
|
||||
CURSORINFO ci; ci.cbSize = sizeof ci;
|
||||
if (!GetCursorInfo(&ci)) { cur->visible = 0; return; }
|
||||
cur->visible = (ci.flags & CURSOR_SHOWING) != 0;
|
||||
cur->x = ci.ptScreenPos.x;
|
||||
cur->y = ci.ptScreenPos.y;
|
||||
}
|
||||
|
||||
void cursor_draw(vgpu_ctx* ctx, uint8_t* dst, uint32_t W, uint32_t H) {
|
||||
vgpu_cursor_t* cur = &ctx->cursor;
|
||||
if (!cur->visible || cur->gw == 0) return;
|
||||
|
||||
Reference in New Issue
Block a user