Skip to content

Commit 0291b93

Browse files
committed
Migrate from OpenXR C++ bindings to C API and fix CMake build configuration
Replace openxr.hpp C++ wrapper with native openxr.h C API throughout xr_context. Add OpenXR::OpenXR alias for openxr_loader target compatibility. Fix memory_pool.cpp source path and Assets copy destination. Load Vulkan extension function pointers explicitly via xrGetInstanceProcAddr. Implement proper LUID extraction from OpenXR-selected physical device using VkPhysicalDeviceIDProperties. Replace XrGuidMSFT with XrUuidMSFT for spatial mesh structure. Update all OpenXR handle types from C++ wrappers to native C types (XrInstance, XrSession, XrSpace, XrAction, XrSwapchain). Convert all OpenXR API calls from method-style to function-style. Initialize views vector with proper XR_TYPE_VIEW structure type.
1 parent 90c7206 commit 0291b93

9 files changed

Lines changed: 1341 additions & 581 deletions

File tree

attachments/openxr_engine/CMakeLists.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ find_package(VulkanHpp REQUIRED)
2727

2828
# OpenXR is REQUIRED for this engine variant
2929
find_package(OpenXR REQUIRED)
30+
if (NOT TARGET OpenXR::OpenXR AND TARGET OpenXR::openxr_loader)
31+
add_library(OpenXR::OpenXR ALIAS OpenXR::openxr_loader)
32+
endif()
3033

3134
if(ENABLE_CPP20_MODULE)
3235
# Set up Vulkan C++ module
@@ -135,7 +138,7 @@ set(SOURCES_COMMON
135138
${SIMPLE_ENGINE_DIR}/renderer_compute.cpp
136139
${SIMPLE_ENGINE_DIR}/renderer_utils.cpp
137140
${SIMPLE_ENGINE_DIR}/renderer_ray_query.cpp
138-
${SIMPLE_ENGINE_DIR}/memory_pool.cpp
141+
memory_pool.cpp
139142
${SIMPLE_ENGINE_DIR}/resource_manager.cpp
140143
${SIMPLE_ENGINE_DIR}/entity.cpp
141144
${SIMPLE_ENGINE_DIR}/component.cpp
@@ -227,7 +230,7 @@ endif()
227230
if(EXISTS ${SIMPLE_ENGINE_DIR}/Assets)
228231
if (NOT ANDROID)
229232
add_custom_command(TARGET OpenXREngine POST_BUILD
230-
COMMAND ${CMAKE_COMMAND} -E copy_directory ${SIMPLE_ENGINE_DIR}/Assets ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Assets
233+
COMMAND ${CMAKE_COMMAND} -E copy_directory ${SIMPLE_ENGINE_DIR}/Assets ${CMAKE_CURRENT_BINARY_DIR}/Assets
231234
COMMENT "Copying Assets from Simple Engine to output directory"
232235
)
233236
endif()

0 commit comments

Comments
 (0)