Skip to content

Commit

Permalink
Merge pull request #127 from rbessems/resolve_issue_125
Browse files Browse the repository at this point in the history
Resolve issue 125
  • Loading branch information
rbessems authored Feb 28, 2024
2 parents 7329577 + d1ab255 commit 493e7ca
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 2 deletions.
1 change: 0 additions & 1 deletion .github/workflows/build-host-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ on:

jobs:
build:
if: false
name: Windows Build
runs-on: ${{matrix.os}}
strategy:
Expand Down
1 change: 1 addition & 0 deletions Chapter1/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ else() # Windows / Linux
# OpenGL
include(../cmake/gfxwrapper.cmake)
if(TARGET openxr-gfxwrapper)
target_include_directories(${PROJECT_NAME} PUBLIC ${openxr_SOURCE_DIR}/src/common)
target_link_libraries(${PROJECT_NAME} openxr-gfxwrapper)
target_compile_definitions(${PROJECT_NAME} PUBLIC XR_TUTORIAL_USE_OPENGL)
endif()
Expand Down
1 change: 1 addition & 0 deletions Chapter2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ if (ANDROID) # Android
# XR_DOCS_TAG_BEGIN_Gfxwrapper
include(../cmake/gfxwrapper.cmake)
if(TARGET openxr-gfxwrapper)
target_include_directories(${PROJECT_NAME} PUBLIC ${openxr_SOURCE_DIR}/src/common)
target_link_libraries(${PROJECT_NAME} openxr-gfxwrapper)
target_compile_definitions(${PROJECT_NAME} PUBLIC XR_TUTORIAL_USE_OPENGL_ES)
endif()
Expand Down
1 change: 1 addition & 0 deletions Chapter3/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ if (ANDROID) # Android
# XR_DOCS_TAG_BEGIN_Gfxwrapper
include(../cmake/gfxwrapper.cmake)
if(TARGET openxr-gfxwrapper)
target_include_directories(${PROJECT_NAME} PUBLIC ${openxr_SOURCE_DIR}/src/common)
target_link_libraries(${PROJECT_NAME} openxr-gfxwrapper)
target_compile_definitions(${PROJECT_NAME} PUBLIC XR_TUTORIAL_USE_OPENGL_ES)
endif()
Expand Down
1 change: 1 addition & 0 deletions Chapter4/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ else() # Windows / Linux
# OpenGL
include(../cmake/gfxwrapper.cmake)
if(TARGET openxr-gfxwrapper)
target_include_directories(${PROJECT_NAME} PUBLIC ${openxr_SOURCE_DIR}/src/common)
target_link_libraries(${PROJECT_NAME} openxr-gfxwrapper)
target_compile_definitions(${PROJECT_NAME} PUBLIC XR_TUTORIAL_USE_OPENGL)
endif()
Expand Down
1 change: 1 addition & 0 deletions Chapter5/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ if (ANDROID) # Android
# XR_DOCS_TAG_BEGIN_Gfxwrapper
include(../cmake/gfxwrapper.cmake)
if(TARGET openxr-gfxwrapper)
target_include_directories(${PROJECT_NAME} PUBLIC ${openxr_SOURCE_DIR}/src/common)
target_link_libraries(${PROJECT_NAME} openxr-gfxwrapper)
target_compile_definitions(${PROJECT_NAME} PUBLIC XR_TUTORIAL_USE_OPENGL_ES)
endif()
Expand Down
1 change: 1 addition & 0 deletions Chapter6_1_Multiview/Chapter6/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ if (ANDROID) # Android
# XR_DOCS_TAG_BEGIN_Gfxwrapper
include(../cmake/gfxwrapper.cmake)
if(TARGET openxr-gfxwrapper)
target_include_directories(${PROJECT_NAME} PUBLIC ${openxr_SOURCE_DIR}/src/common)
target_link_libraries(${PROJECT_NAME} openxr-gfxwrapper)
target_compile_definitions(${PROJECT_NAME} PUBLIC XR_TUTORIAL_USE_OPENGL_ES)
endif()
Expand Down
2 changes: 1 addition & 1 deletion GraphicsAPI_Test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ if (Vulkan_FOUND)
endif()

# Fix redirection to a different project's build folder
target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_BINARY_DIR}/../Chapter2/openxr/src/common)
target_include_directories(${PROJECT_NAME} PUBLIC ${openxr_SOURCE_DIR}/src/common)
target_link_libraries(${PROJECT_NAME} openxr-gfxwrapper)
target_compile_definitions(${PROJECT_NAME} PUBLIC XR_TUTORIAL_USE_OPENGL)

Expand Down
6 changes: 6 additions & 0 deletions GraphicsAPI_Test/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,9 @@ int main() {
} else if (apiType == D3D12) {
graphicsAPI = new GraphicsAPI_D3D12();
} else if (apiType == VULKAN) {
#ifdef XR_TUTORIAL_USE_VULKAN
graphicsAPI = new GraphicsAPI_Vulkan();
#endif
} else {
return -1;
}
Expand All @@ -255,7 +257,11 @@ int main() {

// Swapchain
const uint32_t swapchainCount = 3;
#ifdef XR_TUTORIAL_USE_VULKAN
swapchainFormat = apiType == VULKAN ? VK_FORMAT_B8G8R8A8_UNORM : DXGI_FORMAT_B8G8R8A8_UNORM;
#else
swapchainFormat = DXGI_FORMAT_B8G8R8A8_UNORM;
#endif
void *swapchain = graphicsAPI->CreateDesktopSwapchain({width, height, swapchainCount, window, swapchainFormat, false});
void *swapchainImages[swapchainCount] = {nullptr, nullptr, nullptr};
void *swapchainImageViews[swapchainCount] = {nullptr, nullptr, nullptr};
Expand Down

0 comments on commit 493e7ca

Please sign in to comment.