HLE: a mouse device, so the camera follows the mouse #9

Manually merged
github merged 1 commit from github-bot/gh-9 into main 2026-11-26 18:59:24 +00:00 AGit
Owner

@⁠superboynick on GitHub · 2026-11-26 18:37 UTC · original
superboynick:feat/mouse-device → main · +172 −22 · 2 files · 1 commits · merged 2026-11-26 18:50 UTC

GameInput in this layer offers four XInput pads, a stand-in pad driven by the keyboard, and the keyboard - but no mouse. The title polls GameInput for mouse movement, reads nothing, and the camera never turns while the keyboard works. Measured on an RTX 5070 Ti Laptop (12 GB, 32-lane waves), Windows 11.

What this adds. A mouse device that reports position deltas taken from the host cursor inside our own window, plus the three buttons. It exists only while our window is in the foreground (GetForegroundWindow is our process) and goes away with a disconnect callback when focus leaves, so moving the pointer elsewhere does not spin the camera. Wheel rotation is not reported: GetAsyncKeyState cannot see it, and that is written in the commit.

Switch. VICTORY_GAMEPAD_MOUSE=0 leaves the device out entirely, which is what the layer did before; default is on.

Evidence. In a run with the window in front the device appears (input device device=6 kind=32 connected=true) and does not appear while another window has focus; a 240-second run with it showed no change in frame rate (the poll is every 8 ms) and no errors.

Tests. cargo test -p victory-hle: 153 passed, 2 ignored. Four new unit tests cover the first frame (zero delta), clamping outside the client area, negative deltas, and the focus-loss reset. Both cargo build --release -p victory and cargo build --profile diag -p victory --features diagnostics build.

Written with an AI assistant.

**@⁠superboynick** on GitHub · 2026-11-26 18:37 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/9) `superboynick:feat/mouse-device` → `main` · +172 −22 · 2 files · 1 commits · merged 2026-11-26 18:50 UTC GameInput in this layer offers four XInput pads, a stand-in pad driven by the keyboard, and the keyboard - but no mouse. The title polls GameInput for mouse movement, reads nothing, and the camera never turns while the keyboard works. Measured on an RTX 5070 Ti Laptop (12 GB, 32-lane waves), Windows 11. **What this adds.** A mouse device that reports position deltas taken from the host cursor inside our own window, plus the three buttons. It exists only while our window is in the foreground (GetForegroundWindow is our process) and goes away with a disconnect callback when focus leaves, so moving the pointer elsewhere does not spin the camera. Wheel rotation is not reported: GetAsyncKeyState cannot see it, and that is written in the commit. **Switch.** VICTORY_GAMEPAD_MOUSE=0 leaves the device out entirely, which is what the layer did before; default is on. **Evidence.** In a run with the window in front the device appears (input device device=6 kind=32 connected=true) and does not appear while another window has focus; a 240-second run with it showed no change in frame rate (the poll is every 8 ms) and no errors. **Tests.** cargo test -p victory-hle: 153 passed, 2 ignored. Four new unit tests cover the first frame (zero delta), clamping outside the client area, negative deltas, and the focus-loss reset. Both cargo build --release -p victory and cargo build --profile diag -p victory --features diagnostics build. Written with an AI assistant.
GameInput in this layer offered four XInput pads, a stand-in pad driven by the
keyboard, and the keyboard, but no mouse. The title polls GameInput for mouse
movement, reads nothing, and never turns the camera while the keyboard works.

The new device reports position deltas taken from the host cursor inside our own
window and the three buttons. It exists only while our window is in the
foreground and goes away with a disconnect callback when focus leaves, so
moving the pointer elsewhere does not spin the camera. Wheel rotation is not
reported: the host call used here cannot see it.

`VICTORY_GAMEPAD_MOUSE=0` leaves the device out entirely, which is what the
layer did before. Verified in a run: with the window in front the device appears
(kind 0x20) and it does not appear while another window has focus.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 18:37:25 +00:00
Author
Owner

@⁠superboynick on GitHub · 2026-11-26 18:46 UTC · original

Separate observation from the same runs: texture re-uploads and skin corruption

Issues are disabled on this repository, so I am putting this here rather than in a new issue; move or
discard it as you see fit. Everything below is from this branch at 0ef2b99 (plus this PR's mouse
device), diagnostics build, the play-nvidia speed set plus VICTORY_RENDER_SCALE=0.4,
VICTORY_TEXTURE_ROOM_PERCENT=70, VICTORY_WINDOWS_BAR_MB=1024, on an RTX 5070 Ti Laptop (12 GB,
32-lane waves), 31.4 GB RAM, Windows 11, Series 1.0.2.1.

The picture is correct (no fog, no black spots) and the world runs at about 9.2-9.8 fps for 30-45
minutes without a crash. What remains is occasional texture/skin corruption: a character's skin
sometimes shows as rainbow-coloured or pixelated bands for a moment.

One 160-second window, counted by message (VICTORY_LOG=warn), with the one switch changed:

VICTORY_TEXTURE_NO_WAIT fps in the world (draws > 3000) a texture picked by index changed after its upload with nothing to tell of it placed unordered texture view not mirrored
1 (the speed set) 7.6 88 10
0 6.2 39 13

Waiting for the remapping cuts that message by 56% and costs about 18% of the frame rate, which
matches the README's own explanation for "rainbow, pixelated skin" - and also shows that waiting is
not the whole story, since 39 lines remain.

Two smaller things from the same logs, in case they are useful: placed unordered texture view not mirrored (null: writes through it are lost) for a dozen placed 2D textures, with times reaching
2048, so at least that many bindings land on a null slot; and 29 lines of a pipeline creation method that is not implemented: the title goes without this pipeline shape.

Full log excerpt with byte-exact lines and file:line for each message is available on request; it
is long, so I left it out of this comment.

Written with an AI assistant.

**@⁠superboynick** on GitHub · 2026-11-26 18:46 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/9#issuecomment-7200843932) ### Separate observation from the same runs: texture re-uploads and skin corruption Issues are disabled on this repository, so I am putting this here rather than in a new issue; move or discard it as you see fit. Everything below is from this branch at `0ef2b99` (plus this PR's mouse device), diagnostics build, the `play-nvidia` speed set plus `VICTORY_RENDER_SCALE=0.4`, `VICTORY_TEXTURE_ROOM_PERCENT=70`, `VICTORY_WINDOWS_BAR_MB=1024`, on an RTX 5070 Ti Laptop (12 GB, 32-lane waves), 31.4 GB RAM, Windows 11, Series 1.0.2.1. The picture is correct (no fog, no black spots) and the world runs at about 9.2-9.8 fps for 30-45 minutes without a crash. What remains is occasional texture/skin corruption: a character's skin sometimes shows as rainbow-coloured or pixelated bands for a moment. One 160-second window, counted by message (`VICTORY_LOG=warn`), with the one switch changed: | `VICTORY_TEXTURE_NO_WAIT` | fps in the world (draws > 3000) | `a texture picked by index changed after its upload with nothing to tell of it` | `placed unordered texture view not mirrored` | |---|---:|---:|---:| | `1` (the speed set) | 7.6 | **88** | 10 | | `0` | 6.2 | **39** | 13 | Waiting for the remapping cuts that message by 56% and costs about 18% of the frame rate, which matches the README's own explanation for "rainbow, pixelated skin" - and also shows that waiting is not the whole story, since 39 lines remain. Two smaller things from the same logs, in case they are useful: `placed unordered texture view not mirrored (null: writes through it are lost)` for a dozen placed 2D textures, with `times` reaching 2048, so at least that many bindings land on a null slot; and 29 lines of `a pipeline creation method that is not implemented: the title goes without this pipeline shape`. Full log excerpt with byte-exact lines and `file:line` for each message is available on request; it is long, so I left it out of this comment. Written with an AI assistant.
github manually merged commit 6a31e431e7 into main 2026-11-26 18:59:24 +00:00
Author
Owner

@⁠ardgndg on GitHub · 2026-11-27 20:28 UTC · original

doesn't work when I enable mouse capture through f1

**@⁠ardgndg** on GitHub · 2026-11-27 20:28 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/9#issuecomment-7227539365) doesn't work when I enable mouse capture through f1
This discussion has been locked. Commenting is limited to contributors.
No description provided.