Skip to content
Open
Show file tree
Hide file tree
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
27 changes: 11 additions & 16 deletions Chapter1/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,20 @@ include(FetchContent)

# openxr_loader - From github.com/KhronosGroup
set(BUILD_API_LAYERS
ON
CACHE INTERNAL "Use OpenXR layers"
ON
CACHE INTERNAL "Use OpenXR layers"
)
set(BUILD_TESTS
OFF
CACHE INTERNAL "Build tests"
OFF
CACHE INTERNAL "Build tests"
)
FetchContent_Declare(
OpenXR
EXCLUDE_FROM_ALL
DOWNLOAD_EXTRACT_TIMESTAMP
EXCLUDE_FROM_ALL DOWNLOAD_EXTRACT_TIMESTAMP
URL_HASH MD5=f52248ef83da9134bec2b2d8e0970677
URL https://github.com/KhronosGroup/OpenXR-SDK-Source/archive/refs/tags/release-1.1.49.tar.gz
SOURCE_DIR
openxr
SOURCE_DIR
openxr
)

FetchContent_MakeAvailable(OpenXR)
Expand Down Expand Up @@ -69,10 +68,8 @@ if(ANDROID) # Android
add_library(${PROJECT_NAME} SHARED ${SOURCES} ${HEADERS})
add_dependencies(${PROJECT_NAME} XrApiLayer_core_validation)
target_include_directories(
${PROJECT_NAME}
PRIVATE
# In this repo
../Common/
${PROJECT_NAME} PRIVATE # In this repo
../Common/
)

# export ANativeActivity_onCreate for java to call.
Expand Down Expand Up @@ -128,10 +125,8 @@ else() # Windows / Linux
endif()

target_include_directories(
${PROJECT_NAME}
PRIVATE
# In this repo
../Common/
${PROJECT_NAME} PRIVATE # In this repo
../Common/
)
target_link_libraries(${PROJECT_NAME} openxr_loader)
add_dependencies(${PROJECT_NAME} XrApiLayer_core_validation)
Expand Down
2 changes: 1 addition & 1 deletion Chapter1/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class OpenXRTutorial {
int events = 0;
// The timeout depends on whether the application is active.
const int timeoutMilliseconds = (!androidAppState.resumed && !m_sessionRunning && androidApp->destroyRequested == 0) ? -1 : 0;
if (ALooper_pollOnce(timeoutMilliseconds, nullptr, &events, (void**)&source) >= 0) {
if (ALooper_pollOnce(timeoutMilliseconds, nullptr, &events, (void **)&source) >= 0) {
if (source != nullptr) {
source->process(androidApp, source);
}
Expand Down
15 changes: 7 additions & 8 deletions Chapter2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,20 @@ include(FetchContent)

# openxr_loader - From github.com/KhronosGroup
set(BUILD_API_LAYERS
ON
CACHE INTERNAL "Use OpenXR layers"
ON
CACHE INTERNAL "Use OpenXR layers"
)
set(BUILD_TESTS
OFF
CACHE INTERNAL "Build tests"
OFF
CACHE INTERNAL "Build tests"
)
FetchContent_Declare(
OpenXR
EXCLUDE_FROM_ALL
DOWNLOAD_EXTRACT_TIMESTAMP
EXCLUDE_FROM_ALL DOWNLOAD_EXTRACT_TIMESTAMP
URL_HASH MD5=f52248ef83da9134bec2b2d8e0970677
URL https://github.com/KhronosGroup/OpenXR-SDK-Source/archive/refs/tags/release-1.1.49.tar.gz
SOURCE_DIR
openxr
SOURCE_DIR
openxr
)

FetchContent_MakeAvailable(OpenXR)
Expand Down
10 changes: 5 additions & 5 deletions Chapter2/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,9 @@ class OpenXRTutorial {
OPENXR_CHECK(xrGetInstanceProperties(m_xrInstance, &instanceProperties), "Failed to get InstanceProperties.");

XR_TUT_LOG("OpenXR Runtime: " << instanceProperties.runtimeName << " - "
<< XR_VERSION_MAJOR(instanceProperties.runtimeVersion) << "."
<< XR_VERSION_MINOR(instanceProperties.runtimeVersion) << "."
<< XR_VERSION_PATCH(instanceProperties.runtimeVersion));
<< XR_VERSION_MAJOR(instanceProperties.runtimeVersion) << "."
<< XR_VERSION_MINOR(instanceProperties.runtimeVersion) << "."
<< XR_VERSION_PATCH(instanceProperties.runtimeVersion));
// XR_DOCS_TAG_END_GetInstanceProperties
}

Expand Down Expand Up @@ -288,7 +288,7 @@ class OpenXRTutorial {
XrEventDataReferenceSpaceChangePending *referenceSpaceChangePending = reinterpret_cast<XrEventDataReferenceSpaceChangePending *>(&eventData);
XR_TUT_LOG("OPENXR: Reference Space Change pending for Session: " << referenceSpaceChangePending->session);
if (referenceSpaceChangePending->session != m_session) {
XR_TUT_LOG("XrEventDataReferenceSpaceChangePending for unknown Session");
XR_TUT_LOG("XrEventDataReferenceSpaceChangePending for unknown Session");
break;
}
break;
Expand Down Expand Up @@ -401,7 +401,7 @@ class OpenXRTutorial {
int events = 0;
// The timeout depends on whether the application is active.
const int timeoutMilliseconds = (!androidAppState.resumed && !m_sessionRunning && androidApp->destroyRequested == 0) ? -1 : 0;
if (ALooper_pollOnce(timeoutMilliseconds, nullptr, &events, (void**)&source) >= 0) {
if (ALooper_pollOnce(timeoutMilliseconds, nullptr, &events, (void **)&source) >= 0) {
if (source != nullptr) {
source->process(androidApp, source);
}
Expand Down
15 changes: 7 additions & 8 deletions Chapter3/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,20 @@ include(FetchContent)

# openxr_loader - From github.com/KhronosGroup
set(BUILD_API_LAYERS
ON
CACHE INTERNAL "Use OpenXR layers"
ON
CACHE INTERNAL "Use OpenXR layers"
)
set(BUILD_TESTS
OFF
CACHE INTERNAL "Build tests"
OFF
CACHE INTERNAL "Build tests"
)
FetchContent_Declare(
OpenXR
EXCLUDE_FROM_ALL
DOWNLOAD_EXTRACT_TIMESTAMP
EXCLUDE_FROM_ALL DOWNLOAD_EXTRACT_TIMESTAMP
URL_HASH MD5=f52248ef83da9134bec2b2d8e0970677
URL https://github.com/KhronosGroup/OpenXR-SDK-Source/archive/refs/tags/release-1.1.49.tar.gz
SOURCE_DIR
openxr
SOURCE_DIR
openxr
)

FetchContent_MakeAvailable(OpenXR)
Expand Down
12 changes: 6 additions & 6 deletions Chapter3/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,9 @@ class OpenXRTutorial {
OPENXR_CHECK(xrGetInstanceProperties(m_xrInstance, &instanceProperties), "Failed to get InstanceProperties.");

XR_TUT_LOG("OpenXR Runtime: " << instanceProperties.runtimeName << " - "
<< XR_VERSION_MAJOR(instanceProperties.runtimeVersion) << "."
<< XR_VERSION_MINOR(instanceProperties.runtimeVersion) << "."
<< XR_VERSION_PATCH(instanceProperties.runtimeVersion));
<< XR_VERSION_MAJOR(instanceProperties.runtimeVersion) << "."
<< XR_VERSION_MINOR(instanceProperties.runtimeVersion) << "."
<< XR_VERSION_PATCH(instanceProperties.runtimeVersion));
// XR_DOCS_TAG_END_GetInstanceProperties
}

Expand Down Expand Up @@ -525,7 +525,7 @@ class OpenXRTutorial {
XrEventDataReferenceSpaceChangePending *referenceSpaceChangePending = reinterpret_cast<XrEventDataReferenceSpaceChangePending *>(&eventData);
XR_TUT_LOG("OPENXR: Reference Space Change pending for Session: " << referenceSpaceChangePending->session);
if (referenceSpaceChangePending->session != m_session) {
XR_TUT_LOG("XrEventDataReferenceSpaceChangePending for unknown Session");
XR_TUT_LOG("XrEventDataReferenceSpaceChangePending for unknown Session");
break;
}
break;
Expand Down Expand Up @@ -604,7 +604,7 @@ class OpenXRTutorial {
// XR_DOCS_TAG_END_EnumerateSwapchainFormats

// XR_DOCS_TAG_BEGIN_ResizeSwapchainInfos
//Resize the SwapchainInfo to match the number of view in the View Configuration.
// Resize the SwapchainInfo to match the number of view in the View Configuration.
m_colorSwapchainInfos.resize(m_viewConfigurationViews.size());
m_depthSwapchainInfos.resize(m_viewConfigurationViews.size());
// XR_DOCS_TAG_END_ResizeSwapchainInfos
Expand Down Expand Up @@ -961,7 +961,7 @@ class OpenXRTutorial {
int events = 0;
// The timeout depends on whether the application is active.
const int timeoutMilliseconds = (!androidAppState.resumed && !m_sessionRunning && androidApp->destroyRequested == 0) ? -1 : 0;
if (ALooper_pollOnce(timeoutMilliseconds, nullptr, &events, (void**)&source) >= 0) {
if (ALooper_pollOnce(timeoutMilliseconds, nullptr, &events, (void **)&source) >= 0) {
if (source != nullptr) {
source->process(androidApp, source);
}
Expand Down
15 changes: 7 additions & 8 deletions Chapter4/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,20 @@ include(FetchContent)

# openxr_loader - From github.com/KhronosGroup
set(BUILD_API_LAYERS
ON
CACHE INTERNAL "Use OpenXR layers"
ON
CACHE INTERNAL "Use OpenXR layers"
)
set(BUILD_TESTS
OFF
CACHE INTERNAL "Build tests"
OFF
CACHE INTERNAL "Build tests"
)
FetchContent_Declare(
OpenXR
EXCLUDE_FROM_ALL
DOWNLOAD_EXTRACT_TIMESTAMP
EXCLUDE_FROM_ALL DOWNLOAD_EXTRACT_TIMESTAMP
URL_HASH MD5=f52248ef83da9134bec2b2d8e0970677
URL https://github.com/KhronosGroup/OpenXR-SDK-Source/archive/refs/tags/release-1.1.49.tar.gz
SOURCE_DIR
openxr
SOURCE_DIR
openxr
)

FetchContent_MakeAvailable(OpenXR)
Expand Down
18 changes: 9 additions & 9 deletions Chapter4/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,9 @@ class OpenXRTutorial {
OPENXR_CHECK(xrGetInstanceProperties(m_xrInstance, &instanceProperties), "Failed to get InstanceProperties.");

XR_TUT_LOG("OpenXR Runtime: " << instanceProperties.runtimeName << " - "
<< XR_VERSION_MAJOR(instanceProperties.runtimeVersion) << "."
<< XR_VERSION_MINOR(instanceProperties.runtimeVersion) << "."
<< XR_VERSION_PATCH(instanceProperties.runtimeVersion));
<< XR_VERSION_MAJOR(instanceProperties.runtimeVersion) << "."
<< XR_VERSION_MINOR(instanceProperties.runtimeVersion) << "."
<< XR_VERSION_PATCH(instanceProperties.runtimeVersion));
// XR_DOCS_TAG_END_GetInstanceProperties
}

Expand Down Expand Up @@ -673,7 +673,7 @@ class OpenXRTutorial {
XrVector3f color = {pseudorandom_distribution(pseudo_random_generator), pseudorandom_distribution(pseudo_random_generator), pseudorandom_distribution(pseudo_random_generator)};
m_blocks.push_back({{q, {x, y, z}}, {0.095f, 0.095f, 0.095f}, color});
if (m_blocks.size() > m_maxBlockCount) {
m_blocks.pop_front();
m_blocks.pop_front();
}
}
}
Expand Down Expand Up @@ -735,7 +735,7 @@ class OpenXRTutorial {
XrEventDataReferenceSpaceChangePending *referenceSpaceChangePending = reinterpret_cast<XrEventDataReferenceSpaceChangePending *>(&eventData);
XR_TUT_LOG("OPENXR: Reference Space Change pending for Session: " << referenceSpaceChangePending->session);
if (referenceSpaceChangePending->session != m_session) {
XR_TUT_LOG("XrEventDataReferenceSpaceChangePending for unknown Session");
XR_TUT_LOG("XrEventDataReferenceSpaceChangePending for unknown Session");
break;
}
break;
Expand Down Expand Up @@ -901,8 +901,8 @@ class OpenXRTutorial {
XrQuaternionf q = {0.0f, 0.0f, 0.0f, 1.0f};
XrVector3f color = {pseudorandom_distribution(pseudo_random_generator), pseudorandom_distribution(pseudo_random_generator), pseudorandom_distribution(pseudo_random_generator)};
m_blocks.push_back({{q, FixPosition(m_handPose[i].position)}, {0.095f, 0.095f, 0.095f}, color});
while ( m_blocks.size() > m_maxBlockCount) {
m_blocks.pop_front();
while (m_blocks.size() > m_maxBlockCount) {
m_blocks.pop_front();
}
}
}
Expand Down Expand Up @@ -951,7 +951,7 @@ class OpenXRTutorial {
// XR_DOCS_TAG_END_EnumerateSwapchainFormats

// XR_DOCS_TAG_BEGIN_ResizeSwapchainInfos
//Resize the SwapchainInfo to match the number of view in the View Configuration.
// Resize the SwapchainInfo to match the number of view in the View Configuration.
m_colorSwapchainInfos.resize(m_viewConfigurationViews.size());
m_depthSwapchainInfos.resize(m_viewConfigurationViews.size());
// XR_DOCS_TAG_END_ResizeSwapchainInfos
Expand Down Expand Up @@ -1332,7 +1332,7 @@ class OpenXRTutorial {
int events = 0;
// The timeout depends on whether the application is active.
const int timeoutMilliseconds = (!androidAppState.resumed && !m_sessionRunning && androidApp->destroyRequested == 0) ? -1 : 0;
if (ALooper_pollOnce(timeoutMilliseconds, nullptr, &events, (void**)&source) >= 0) {
if (ALooper_pollOnce(timeoutMilliseconds, nullptr, &events, (void **)&source) >= 0) {
if (source != nullptr) {
source->process(androidApp, source);
}
Expand Down
15 changes: 7 additions & 8 deletions Chapter5/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,20 @@ include(FetchContent)

# openxr_loader - From github.com/KhronosGroup
set(BUILD_API_LAYERS
ON
CACHE INTERNAL "Use OpenXR layers"
ON
CACHE INTERNAL "Use OpenXR layers"
)
set(BUILD_TESTS
OFF
CACHE INTERNAL "Build tests"
OFF
CACHE INTERNAL "Build tests"
)
FetchContent_Declare(
OpenXR
EXCLUDE_FROM_ALL
DOWNLOAD_EXTRACT_TIMESTAMP
EXCLUDE_FROM_ALL DOWNLOAD_EXTRACT_TIMESTAMP
URL_HASH MD5=f52248ef83da9134bec2b2d8e0970677
URL https://github.com/KhronosGroup/OpenXR-SDK-Source/archive/refs/tags/release-1.1.49.tar.gz
SOURCE_DIR
openxr
SOURCE_DIR
openxr
)

FetchContent_MakeAvailable(OpenXR)
Expand Down
12 changes: 6 additions & 6 deletions Chapter5/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -272,9 +272,9 @@ class OpenXRTutorial {
OPENXR_CHECK(xrGetInstanceProperties(m_xrInstance, &instanceProperties), "Failed to get InstanceProperties.");

XR_TUT_LOG("OpenXR Runtime: " << instanceProperties.runtimeName << " - "
<< XR_VERSION_MAJOR(instanceProperties.runtimeVersion) << "."
<< XR_VERSION_MINOR(instanceProperties.runtimeVersion) << "."
<< XR_VERSION_PATCH(instanceProperties.runtimeVersion));
<< XR_VERSION_MAJOR(instanceProperties.runtimeVersion) << "."
<< XR_VERSION_MINOR(instanceProperties.runtimeVersion) << "."
<< XR_VERSION_PATCH(instanceProperties.runtimeVersion));
// XR_DOCS_TAG_END_GetInstanceProperties
}

Expand Down Expand Up @@ -784,7 +784,7 @@ class OpenXRTutorial {
XrEventDataReferenceSpaceChangePending *referenceSpaceChangePending = reinterpret_cast<XrEventDataReferenceSpaceChangePending *>(&eventData);
XR_TUT_LOG("OPENXR: Reference Space Change pending for Session: " << referenceSpaceChangePending->session);
if (referenceSpaceChangePending->session != m_session) {
XR_TUT_LOG("XrEventDataReferenceSpaceChangePending for unknown Session");
XR_TUT_LOG("XrEventDataReferenceSpaceChangePending for unknown Session");
break;
}
break;
Expand Down Expand Up @@ -1004,7 +1004,7 @@ class OpenXRTutorial {
// XR_DOCS_TAG_END_EnumerateSwapchainFormats

// XR_DOCS_TAG_BEGIN_ResizeSwapchainInfos
//Resize the SwapchainInfo to match the number of view in the View Configuration.
// Resize the SwapchainInfo to match the number of view in the View Configuration.
m_colorSwapchainInfos.resize(m_viewConfigurationViews.size());
m_depthSwapchainInfos.resize(m_viewConfigurationViews.size());
// XR_DOCS_TAG_END_ResizeSwapchainInfos
Expand Down Expand Up @@ -1420,7 +1420,7 @@ class OpenXRTutorial {
int events = 0;
// The timeout depends on whether the application is active.
const int timeoutMilliseconds = (!androidAppState.resumed && !m_sessionRunning && androidApp->destroyRequested == 0) ? -1 : 0;
if (ALooper_pollOnce(timeoutMilliseconds, nullptr, &events, (void**)&source) >= 0) {
if (ALooper_pollOnce(timeoutMilliseconds, nullptr, &events, (void **)&source) >= 0) {
if (source != nullptr) {
source->process(androidApp, source);
}
Expand Down
15 changes: 7 additions & 8 deletions Chapter6_1_Multiview/Chapter6/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,20 @@ include(FetchContent)

# openxr_loader - From github.com/KhronosGroup
set(BUILD_API_LAYERS
ON
CACHE INTERNAL "Use OpenXR layers"
ON
CACHE INTERNAL "Use OpenXR layers"
)
set(BUILD_TESTS
OFF
CACHE INTERNAL "Build tests"
OFF
CACHE INTERNAL "Build tests"
)
FetchContent_Declare(
OpenXR
EXCLUDE_FROM_ALL
DOWNLOAD_EXTRACT_TIMESTAMP
EXCLUDE_FROM_ALL DOWNLOAD_EXTRACT_TIMESTAMP
URL_HASH MD5=f52248ef83da9134bec2b2d8e0970677
URL https://github.com/KhronosGroup/OpenXR-SDK-Source/archive/refs/tags/release-1.1.49.tar.gz
SOURCE_DIR
openxr
SOURCE_DIR
openxr
)

FetchContent_MakeAvailable(OpenXR)
Expand Down
Loading
Loading