forked from GodotVR/godot_openxr_vendors
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for the Meta scene capture API
Merge pull request #1266 from dsnopek/automatic-engine-class-registration Automatically register only engine classes whose header has been included
- Loading branch information
Showing
53 changed files
with
16,897 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "thirdparty/godot-cpp"] | ||
path = thirdparty/godot-cpp | ||
url = https://github.com/godotengine/godot-cpp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,161 @@ | ||
cmake_minimum_required(VERSION 3.22.1) | ||
|
||
## Default configs | ||
# Default android abi is arm64-v8a | ||
if (NOT ANDROID_ABI) | ||
set(ANDROID_ABI "arm64-v8a") | ||
endif (NOT ANDROID_ABI) | ||
|
||
if (ANDROID_ABI STREQUAL "armeabi-v7a") | ||
set(GODOT_CPP_LIB_ABI "arm32") | ||
elseif (ANDROID_ABI STREQUAL "x86") | ||
set(GODOT_CPP_LIB_ABI "x86_32") | ||
elseif (ANDROID_ABI STREQUAL "x86_64") | ||
set(GODOT_CPP_LIB_ABI "x86_64") | ||
else () | ||
set(GODOT_CPP_LIB_ABI "arm64") | ||
endif () | ||
|
||
# Default android platform is android-21 | ||
if (NOT ANDROID_PLATFORM) | ||
set(ANDROID_PLATFORM "android-21") | ||
endif (NOT ANDROID_PLATFORM) | ||
|
||
# Default build type is Debug | ||
if (NOT CMAKE_BUILD_TYPE) | ||
set(CMAKE_BUILD_TYPE Debug) | ||
endif (NOT CMAKE_BUILD_TYPE) | ||
|
||
if (CMAKE_BUILD_TYPE MATCHES Debug) | ||
add_definitions(-D_DEBUG) | ||
set(GODOT_CPP_LIB_BUILD_TYPE debug) | ||
set(OPENXR_MOBILE_LIB_BUILD_TYPE Debug) | ||
else () | ||
add_definitions(-DNDEBUG) | ||
set(GODOT_CPP_LIB_BUILD_TYPE release) | ||
set(OPENXR_MOBILE_LIB_BUILD_TYPE Release) | ||
endif (CMAKE_BUILD_TYPE MATCHES Debug) | ||
|
||
if (NOT (ANDROID_STL STREQUAL "c++_shared")) | ||
set(ANDROID_STL "c++_shared") | ||
endif (NOT (ANDROID_STL STREQUAL "c++_shared")) | ||
|
||
# Check if ANDROID_NDK is set. | ||
if (NOT ANDROID_NDK) | ||
# Set to ANDROID_NDK_HOME environment variable if it's set. | ||
if (DEFINED ENV{ANDROID_NDK_HOME}) | ||
set(ANDROID_NDK $ENV{ANDROID_NDK_HOME}) | ||
else (DEFINED ENV{ANDROID_NDK_HOME}) | ||
message(WARNING "ANDROID_NDK_HOME is not set") | ||
endif (DEFINED ENV{ANDROID_NDK_HOME}) | ||
endif (NOT ANDROID_NDK) | ||
|
||
# Check if CMAKE_TOOLCHAIN_FILE is set. | ||
if (NOT CMAKE_TOOLCHAIN_FILE) | ||
set(CMAKE_TOOLCHAIN_FILE "${ANDROID_NDK}/build/cmake/android.toolchain.cmake") | ||
endif (NOT CMAKE_TOOLCHAIN_FILE) | ||
|
||
if (NOT DEFINED BITS) | ||
set(BITS 32) | ||
if (CMAKE_SIZEOF_VOID_P EQUAL 8) | ||
set(BITS 64) | ||
endif (CMAKE_SIZEOF_VOID_P EQUAL 8) | ||
endif (NOT DEFINED BITS) | ||
|
||
set(CMAKE_CXX_STANDARD 17) | ||
set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
set(CMAKE_CXX_EXTENSIONS OFF) | ||
|
||
|
||
project(godotopenxrmeta LANGUAGES CXX) | ||
|
||
add_definitions(-DANDROID) | ||
|
||
set(GODOT_COMPILE_FLAGS) | ||
set(GODOT_LINKER_FLAGS) | ||
|
||
set(GODOT_LINKER_FLAGS "-Wl") | ||
|
||
set(GODOT_COMPILE_FLAGS "-fPIC -g -Wwrite-strings") | ||
set(GODOT_COMPILE_FLAGS "${GODOT_COMPILE_FLAGS} -Wchar-subscripts -Wcomment -Wdisabled-optimization") | ||
set(GODOT_COMPILE_FLAGS "${GODOT_COMPILE_FLAGS} -Wformat -Wformat=2 -Wformat-security -Wformat-y2k") | ||
set(GODOT_COMPILE_FLAGS "${GODOT_COMPILE_FLAGS} -Wimport -Winit-self -Winline -Winvalid-pch") | ||
set(GODOT_COMPILE_FLAGS "${GODOT_COMPILE_FLAGS} -Wlong-long -Wmissing-braces -Wmissing-format-attribute") | ||
set(GODOT_COMPILE_FLAGS "${GODOT_COMPILE_FLAGS} -Wmissing-include-dirs -Wmissing-noreturn -Wpacked -Wpointer-arith") | ||
set(GODOT_COMPILE_FLAGS "${GODOT_COMPILE_FLAGS} -Wredundant-decls -Wreturn-type -Wsequence-point") | ||
set(GODOT_COMPILE_FLAGS "${GODOT_COMPILE_FLAGS} -Wswitch -Wswitch-enum -Wtrigraphs") | ||
set(GODOT_COMPILE_FLAGS "${GODOT_COMPILE_FLAGS} -Wuninitialized -Wunknown-pragmas -Wunreachable-code -Wunused-label") | ||
set(GODOT_COMPILE_FLAGS "${GODOT_COMPILE_FLAGS} -Wunused-value -Wvariadic-macros -Wvolatile-register-var -Wno-error=attributes") | ||
|
||
if (NOT CMAKE_SYSTEM_NAME STREQUAL "Android") | ||
set(GODOT_COMPILE_FLAGS "${GODOT_COMPILE_FLAGS} -Wno-ignored-attributes") | ||
endif () | ||
|
||
if (CMAKE_BUILD_TYPE MATCHES Debug) | ||
set(GODOT_COMPILE_FLAGS "${GODOT_COMPILE_FLAGS} -fno-omit-frame-pointer -O0") | ||
else () | ||
set(GODOT_COMPILE_FLAGS "${GODOT_COMPILE_FLAGS} -O3") | ||
endif (CMAKE_BUILD_TYPE MATCHES Debug) | ||
|
||
|
||
## godot-cpp library | ||
set(GODOT_CPP_DIR "${CMAKE_SOURCE_DIR}/../thirdparty/godot-cpp") | ||
set(GODOT-CPP "godot-cpp") | ||
|
||
# Use the godot-cpp prebuilt static binary | ||
set(GODOT_CPP_STATIC_LIB "${GODOT_CPP_DIR}/bin/libgodot-cpp.android.template_${GODOT_CPP_LIB_BUILD_TYPE}.${GODOT_CPP_LIB_ABI}.a") | ||
|
||
list(APPEND GODOT_CPP_INCLUDE_DIRECTORIES "${GODOT_CPP_DIR}/include") | ||
list(APPEND GODOT_CPP_INCLUDE_DIRECTORIES "${GODOT_CPP_DIR}/gen/include") | ||
list(APPEND GODOT_CPP_INCLUDE_DIRECTORIES "${GODOT_CPP_DIR}/gdextension") | ||
|
||
add_library(${GODOT-CPP} | ||
STATIC | ||
IMPORTED GLOBAL | ||
INTERFACE_INCLUDE_DIRECTORIES "${GODOT_CPP_INCLUDE_DIRECTORIES}" | ||
) | ||
set_target_properties(${GODOT-CPP} PROPERTIES IMPORTED_LOCATION ${GODOT_CPP_STATIC_LIB}) | ||
|
||
|
||
## OpenXR Mobile loader library | ||
# Sets the path to the OpenXR mobile library directory. | ||
set(OPENXR_MOBILE_ROOT_DIR "${CMAKE_SOURCE_DIR}/libs/ovr_openxr_mobile_sdk/OpenXR") | ||
set(OPENXR_MOBILE_HEADERS_DIR "${OPENXR_MOBILE_ROOT_DIR}/Include" CACHE STRING "") | ||
|
||
set(OPENXR_HEADERS_DIR "${CMAKE_SOURCE_DIR}/../thirdparty/openxr/include") | ||
|
||
set(OPENXR_MOBILE_LIB_PATH "${OPENXR_MOBILE_ROOT_DIR}/Libs/Android/${ANDROID_ABI}/${OPENXR_MOBILE_LIB_BUILD_TYPE}/libopenxr_loader.so") | ||
add_library(openxr_loader | ||
SHARED | ||
IMPORTED GLOBAL | ||
) | ||
set_target_properties(openxr_loader PROPERTIES IMPORTED_LOCATION ${OPENXR_MOBILE_LIB_PATH}) | ||
|
||
|
||
## Setup the project sources | ||
file(GLOB_RECURSE ANDROID_SOURCES ${CMAKE_SOURCE_DIR}/src/main/cpp/*.c**) | ||
file(GLOB_RECURSE ANDROID_HEADERS ${CMAKE_SOURCE_DIR}/src/main/cpp/*.h**) | ||
|
||
add_library(${CMAKE_PROJECT_NAME} | ||
SHARED | ||
${ANDROID_SOURCES} | ||
${ANDROID_HEADERS} | ||
) | ||
|
||
target_include_directories(${CMAKE_PROJECT_NAME} | ||
SYSTEM PUBLIC | ||
${GODOT_CPP_INCLUDE_DIRECTORIES} | ||
${OPENXR_HEADERS_DIR} | ||
${OPENXR_MOBILE_HEADERS_DIR} | ||
) | ||
|
||
target_link_libraries(${CMAKE_PROJECT_NAME} | ||
android | ||
log | ||
${GODOT-CPP} | ||
openxr_loader | ||
) | ||
|
||
# Add the compile flags | ||
set_property(TARGET ${CMAKE_PROJECT_NAME} APPEND_STRING PROPERTY COMPILE_FLAGS ${GODOT_COMPILE_FLAGS}) | ||
set_property(TARGET ${CMAKE_PROJECT_NAME} APPEND_STRING PROPERTY LINK_FLAGS ${GODOT_LINKER_FLAGS}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
103 changes: 103 additions & 0 deletions
103
godotopenxrmeta/libs/ovr_openxr_mobile_sdk/OpenXR/Include/openxr/extx1_event_channel.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
#ifndef EXTX1_EVENT_CHANNEL_H_ | ||
#define EXTX1_EVENT_CHANNEL_H_ 1 | ||
|
||
/********************** | ||
This file is @generated from the OpenXR XML API registry. | ||
Language : C99 | ||
Copyright : (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary. | ||
***********************/ | ||
|
||
#include <openxr/openxr.h> | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
|
||
#ifndef XR_EXTX1_event_channel | ||
|
||
#define XR_EXTX1_event_channel 1 | ||
XR_DEFINE_HANDLE(XrEventChannelEXTX1) | ||
#define XR_EXTX1_event_channel_SPEC_VERSION 3 | ||
#define XR_EXTX1_EVENT_CHANNEL_EXTENSION_NAME "XR_EXTX1_event_channel" | ||
static const XrStructureType XR_TYPE_EVENT_CHANNEL_CREATE_INFO_EXTX1 = (XrStructureType) 1000170001; | ||
static const XrStructureType XR_TYPE_EVENT_CHANNEL_TARGET_EXTX1 = (XrStructureType) 1000170002; | ||
static const XrStructureType XR_TYPE_SELECT_EVENT_CHANNEL_INFO_EXTX1 = (XrStructureType) 1000170003; | ||
// XrEventChannelEXTX1 | ||
static const XrObjectType XR_OBJECT_TYPE_EVENT_CHANNEL_EXTX1 = (XrObjectType) 1000170000; | ||
|
||
typedef enum XrSelectEventChannelFlagsEXTX1 { | ||
XR_SELECT_EVENT_CHANNEL_FLAGS_EXTX1_MAX_ENUM = 0x7FFFFFFF | ||
} XrSelectEventChannelFlagsEXTX1; | ||
typedef struct XrEventChannelCreateInfoEXTX1 { | ||
XrStructureType type; | ||
const void* XR_MAY_ALIAS next; | ||
} XrEventChannelCreateInfoEXTX1; | ||
|
||
typedef struct XrEventChannelTargetEXTX1 { | ||
XrStructureType type; | ||
const void* XR_MAY_ALIAS next; | ||
XrEventChannelEXTX1 channel; | ||
} XrEventChannelTargetEXTX1; | ||
|
||
typedef struct XrSelectEventChannelInfoEXTX1 { | ||
XrStructureType type; | ||
const void* XR_MAY_ALIAS next; | ||
XrSelectEventChannelFlagsEXTX1 flags; | ||
XrDuration timeout; | ||
uint32_t eventChannelCount; | ||
const XrEventChannelEXTX1* eventChannels; | ||
} XrSelectEventChannelInfoEXTX1; | ||
|
||
typedef XrResult (XRAPI_PTR *PFN_xrCreateEventChannelEXTX1)(XrInstance instance, const XrEventChannelCreateInfoEXTX1* createInfo, XrEventChannelEXTX1* channel); | ||
typedef XrResult (XRAPI_PTR *PFN_xrDestroyEventChannelEXTX1)(XrEventChannelEXTX1 channel); | ||
typedef XrResult (XRAPI_PTR *PFN_xrPollEventChannelEXTX1)(XrEventChannelEXTX1 channel, XrEventDataBuffer* eventData); | ||
typedef XrResult (XRAPI_PTR *PFN_xrSelectEventChannelEXTX1)(XrInstance instance, XrSelectEventChannelInfoEXTX1* info, uint32_t* channelWithEvent); | ||
typedef XrResult (XRAPI_PTR *PFN_xrSetDefaultEventChannelEXTX1)(XrInstance instance, XrEventChannelEXTX1 channel); | ||
|
||
#ifndef XR_NO_PROTOTYPES | ||
#ifdef XR_EXTENSION_PROTOTYPES | ||
XRAPI_ATTR XrResult XRAPI_CALL xrCreateEventChannelEXTX1( | ||
XrInstance instance, | ||
const XrEventChannelCreateInfoEXTX1* createInfo, | ||
XrEventChannelEXTX1* channel); | ||
|
||
XRAPI_ATTR XrResult XRAPI_CALL xrDestroyEventChannelEXTX1( | ||
XrEventChannelEXTX1 channel); | ||
|
||
XRAPI_ATTR XrResult XRAPI_CALL xrPollEventChannelEXTX1( | ||
XrEventChannelEXTX1 channel, | ||
XrEventDataBuffer* eventData); | ||
|
||
XRAPI_ATTR XrResult XRAPI_CALL xrSelectEventChannelEXTX1( | ||
XrInstance instance, | ||
XrSelectEventChannelInfoEXTX1* info, | ||
uint32_t* channelWithEvent); | ||
|
||
XRAPI_ATTR XrResult XRAPI_CALL xrSetDefaultEventChannelEXTX1( | ||
XrInstance instance, | ||
XrEventChannelEXTX1 channel); | ||
#endif /* XR_EXTENSION_PROTOTYPES */ | ||
#endif /* !XR_NO_PROTOTYPES */ | ||
#endif /* XR_EXTX1_event_channel */ | ||
|
||
#ifdef XR_EXTX1_EVENT_CHANNEL_TAG_ALIAS | ||
typedef XrEventChannelCreateInfoEXTX1 XrEventChannelCreateInfoEXT; | ||
typedef XrEventChannelEXTX1 XrEventChannelEXT; | ||
typedef XrEventChannelTargetEXTX1 XrEventChannelTargetEXT; | ||
typedef XrSelectEventChannelFlagsEXTX1 XrSelectEventChannelFlagsEXT; | ||
typedef XrSelectEventChannelInfoEXTX1 XrSelectEventChannelInfoEXT; | ||
#define XR_EXT_event_channel_SPEC_VERSION XR_EXTX1_event_channel_SPEC_VERSION | ||
#define XR_EXT_EVENT_CHANNEL_EXTENSION_NAME XR_EXTX1_EVENT_CHANNEL_EXTENSION_NAME | ||
#define XR_TYPE_EVENT_CHANNEL_CREATE_INFO_EXT XR_TYPE_EVENT_CHANNEL_CREATE_INFO_EXTX1 | ||
#define XR_TYPE_EVENT_CHANNEL_TARGET_EXT XR_TYPE_EVENT_CHANNEL_TARGET_EXTX1 | ||
#define XR_TYPE_SELECT_EVENT_CHANNEL_INFO_EXT XR_TYPE_SELECT_EVENT_CHANNEL_INFO_EXTX1 | ||
#define XR_OBJECT_TYPE_EVENT_CHANNEL_EXT XR_OBJECT_TYPE_EVENT_CHANNEL_EXTX1 | ||
#endif /* XR_EXTX1_EVENT_CHANNEL_TAG_ALIAS */ | ||
|
||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif |
Oops, something went wrong.