diff options
author | Julian Eisel <julian@blender.org> | 2020-03-17 22:10:57 +0300 |
---|---|---|
committer | Julian Eisel <julian@blender.org> | 2020-03-17 23:39:59 +0300 |
commit | 406bfd43040a5526702b51f88f1491cb61aecedb (patch) | |
tree | 980c77919f9930d51c5f4f411d2e658f66a263e5 /intern/ghost/CMakeLists.txt | |
parent | c9a8de1d704b807460a7a6838db28f7ae2472200 (diff) |
Ghost: Ghost-XR API to abstract away and access OpenXR functionality
Extends Ghost to include an abstraction for OpenXR, which I refer to as
Ghost-XR. Such an API is the base for the following commit, which introduces VR
support to Blender.
Main features:
* Simple and high-level interface for Blender specific code to call.
* Extensible for muliple graphics backends, currently OpenGL and a DirectX
compatibility layer are supported.
* Carefully designed error handling strategy allowing Blender to handle errors
gracefully and with useful error messages.
* OpenXR extension and API-layer management.
* OpenXR session management.
* Basic OpenXR event management.
* Debug utilities for Ghost-XR and OpenXR
For more information on this API, check
https://wiki.blender.org/wiki/Source/Interface/XR.
Reviewed by: Brecht Van Lommel
Differential Revision: https://developer.blender.org/D6188
Diffstat (limited to 'intern/ghost/CMakeLists.txt')
-rw-r--r-- | intern/ghost/CMakeLists.txt | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/intern/ghost/CMakeLists.txt b/intern/ghost/CMakeLists.txt index c4f1efe1580..07d98475c00 100644 --- a/intern/ghost/CMakeLists.txt +++ b/intern/ghost/CMakeLists.txt @@ -357,6 +357,50 @@ elseif(WIN32) endif() +if(WITH_XR_OPENXR) + list(APPEND SRC + intern/GHOST_Xr.cpp + intern/GHOST_XrContext.cpp + intern/GHOST_XrEvent.cpp + intern/GHOST_XrGraphicsBinding.cpp + intern/GHOST_XrSession.cpp + intern/GHOST_XrSwapchain.cpp + + GHOST_IXrContext.h + intern/GHOST_IXrGraphicsBinding.h + intern/GHOST_Xr_intern.h + intern/GHOST_Xr_openxr_includes.h + intern/GHOST_XrContext.h + intern/GHOST_XrSession.h + intern/GHOST_XrSwapchain.h + ) + list(APPEND INC_SYS + ${XR_OPENXR_SDK_INCLUDE_DIR} + ) + + set(XR_PLATFORM_DEFINES -DXR_USE_GRAPHICS_API_OPENGL) + + # Add compiler defines as required by the OpenXR specification. + if(WIN32) + list(APPEND XR_PLATFORM_DEFINES + -DXR_USE_PLATFORM_WIN32 + -DXR_USE_GRAPHICS_API_D3D11 + ) + list(APPEND LIB + shlwapi + ) + elseif(UNIX AND NOT APPLE) + list(APPEND XR_PLATFORM_DEFINES + -DXR_OS_LINUX + -DXR_USE_PLATFORM_XLIB + ) + endif() + + add_definitions(-DWITH_XR_OPENXR ${XR_PLATFORM_DEFINES}) + + unset(XR_PLATFORM_DEFINES) +endif() + add_definitions(${GL_DEFINITIONS}) blender_add_lib(bf_intern_ghost "${SRC}" "${INC}" "${INC_SYS}" "${LIB}") |