2.6 KiB
tools/mock-nui-host/ — mock NUI host (plan todo 16)
Status: [~] blocked — Windows + MSVC + Kinect for Windows SDK 1.8 required to build.
This is code-only on this Linux/WSL2 box; it is not wired into the Linux CMake build
(the repository root CMakeLists.txt never references it) because it needs windows.h and
the Kinect SDK 1.8 import library, neither of which exists here.
What it is
A scripted NUI consumer that links the public Kinect SDK 1.8 headers and drives the full
NUI call sequence against whatever Kinect10.dll is loaded — the clean-room shim from
fallback/windows-nui/ (todo 14) or the real runtime — so the shim can be exercised with
no sensor and no game. It is the Windows counterpart of the Python record/replay harness.
It drives and validates, per .omo/design/nui-contracts.md §3:
NuiInitialize(USES_DEPTH_AND_PLAYER_INDEX | USES_COLOR | USES_SKELETON)→NuiShutdownNuiSkeletonTrackingEnable+ a manual-reset skeleton eventNuiImageStreamOpenfor depth+player-index and color (640×480,dwFrameLimit=2) + events- the event loop:
WaitForMultipleObjectson the three frame-ready events (bounded wait, no fixed sleep), thenNuiSkeletonGetNextFrame,NuiImageStreamGetNextFrame→INuiFrameTexture::LockRect/UnlockRect→NuiImageStreamReleaseFrame NuiTransformSmoothon each skeleton frame- asserts: skeleton/depth/color frames arrive, frame numbers and timestamps are monotonic (§3.6), and the locked texture pitch matches the requested resolution (§3.5)
It exits 0 (prints RESULT: PASS) only when every stream delivered frames and the
invariants held; otherwise non-zero with the failing call/HRESULT on stderr.
Clean-room note
Every NUI name, flag, enum and struct here comes from the public Kinect SDK 1.8 headers
(NuiApi.h / NuiImageCamera.h / NuiSkeleton.h). No GPLv3 source (KinectFaker etc.) was
consulted — the same clean-room firewall that governs the todo-14 shim.
Build (on Windows only)
:: with the Kinect for Windows SDK 1.8 installed (sets KINECTSDK10_DIR)
cmake -S tools/mock-nui-host -B build/mock-nui-host -A Win32 :: or -A x64
cmake --build build/mock-nui-host --config Release
Place the shim's Kinect10.dll beside the built mock_nui_host.exe (or rely on the real
runtime) and run it.
Why [~] blocked here
This repo is developed on Linux/WSL2, which has no Windows Kinect SDK, no MSVC and cannot link
Kinect10.lib. The source + build script are complete and committed; the build/run step is
deferred to the user's Windows box (same gate as todos 12/13/14).