Skip to content

Commit

Permalink
[Examples/XRDemo] Added an XR example
Browse files Browse the repository at this point in the history
  • Loading branch information
Razakhel committed Nov 12, 2024
1 parent 6c4a477 commit 77423c6
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
5 changes: 5 additions & 0 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@ if (RAZ_USE_WINDOW OR RAZ_USE_EMSCRIPTEN)
add_executable(RaZ_TessellationDemo tessellationDemo.cpp)
target_link_libraries(RaZ_TessellationDemo RaZ_Examples)
endif ()

if (NOT RAZ_PLATFORM_MAC AND NOT RAZ_USE_EMSCRIPTEN) # XR currently isn't available with macOS or Emscripten
add_executable(RaZ_XRDemo xrDemo.cpp)
target_link_libraries(RaZ_XRDemo RaZ_Examples)
endif ()
endif ()

if (RAZ_USE_EMSCRIPTEN)
Expand Down
15 changes: 15 additions & 0 deletions examples/xrDemo.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#include "RaZ/RaZ.hpp"

using namespace std::literals;

int main() {
try {
Raz::Logger::setLoggingLevel(Raz::LoggingLevel::ALL);

Raz::XrContext xrContext("RaZ - XR demo");
} catch (const std::exception& exception) {
Raz::Logger::error("Exception occurred: "s + exception.what());
}

return EXIT_SUCCESS;
}

0 comments on commit 77423c6

Please sign in to comment.