Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile OpenXR into MacOS build #79614

Merged
merged 1 commit into from
Jul 24, 2023
Merged
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
7 changes: 6 additions & 1 deletion modules/openxr/SCsub
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ elif env["platform"] == "linuxbsd":
env_openxr.AppendUnique(CPPDEFINES=["HAVE_SECURE_GETENV"])
elif env["platform"] == "windows":
env_openxr.AppendUnique(CPPDEFINES=["XR_OS_WINDOWS", "NOMINMAX", "XR_USE_PLATFORM_WIN32"])
elif env["platform"] == "macos":
env_openxr.AppendUnique(CPPDEFINES=["XR_OS_APPLE"])

# There does not seem to be a XR_USE_PLATFORM_XYZ for Apple


# may need to check and set:
# - XR_USE_TIMESPEC
Expand Down Expand Up @@ -95,7 +100,7 @@ if env["platform"] == "android":
env_openxr.add_source_files(module_obj, "extensions/openxr_android_extension.cpp")
if env["vulkan"]:
env_openxr.add_source_files(module_obj, "extensions/openxr_vulkan_extension.cpp")
if env["opengl3"]:
if env["opengl3"] and env["platform"] != "macos":
env_openxr.add_source_files(module_obj, "extensions/openxr_opengl_extension.cpp")

env_openxr.add_source_files(module_obj, "extensions/openxr_palm_pose_extension.cpp")
Expand Down
2 changes: 1 addition & 1 deletion modules/openxr/config.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
def can_build(env, platform):
if platform in ("linuxbsd", "windows", "android"):
if platform in ("linuxbsd", "windows", "android", "macos"):
return env["openxr"] and not env["disable_3d"]
else:
# not supported on these platforms
Expand Down
6 changes: 3 additions & 3 deletions modules/openxr/openxr_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
#ifdef VULKAN_ENABLED
#define XR_USE_GRAPHICS_API_VULKAN
#endif
#ifdef GLES3_ENABLED
#if defined(GLES3_ENABLED) && !defined(MACOS_ENABLED)
#ifdef ANDROID_ENABLED
#define XR_USE_GRAPHICS_API_OPENGL_ES
#include <EGL/egl.h>
Expand All @@ -72,7 +72,7 @@
#include "extensions/openxr_vulkan_extension.h"
#endif

#ifdef GLES3_ENABLED
#if defined(GLES3_ENABLED) && !defined(MACOS_ENABLED)
#include "extensions/openxr_opengl_extension.h"
#endif

Expand Down Expand Up @@ -1306,7 +1306,7 @@ bool OpenXRAPI::initialize(const String &p_rendering_driver) {
ERR_FAIL_V(false);
#endif
} else if (p_rendering_driver == "opengl3") {
#ifdef GLES3_ENABLED
#if defined(GLES3_ENABLED) && !defined(MACOS_ENABLED)
graphics_extension = memnew(OpenXROpenGLExtension);
register_extension_wrapper(graphics_extension);
#else
Expand Down