Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/runtime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,7 @@ struct Swapchain {
static Instance g_instance{};
static Session g_session{};
static std::unordered_map<XrSwapchain, Swapchain> g_swapchains;
uintptr_t g_nextSwapchainHandle = 1;

// Head tracking state for mouse look and WASD movement
static XrVector3f g_headPos = {0.0f, 1.7f, 0.0f}; // Start at standing eye height
Expand Down Expand Up @@ -1302,7 +1303,7 @@ static XrResult XRAPI_PTR xrCreateSwapchain_runtime(XrSession, const XrSwapchain
Log("[SimXR] ============================================");
if (!ci || !sc) return XR_ERROR_VALIDATION_FAILURE;
rt::Swapchain chain{};
chain.handle = (XrSwapchain)(uintptr_t)(rt::g_swapchains.size() + 2);
chain.handle = (XrSwapchain)(rt::g_nextSwapchainHandle++);
chain.format = (DXGI_FORMAT)ci->format; // Store the original requested format
chain.width = ci->width;
chain.height = ci->height;
Expand Down