3#define UNUSED_PARM(x) \
8#ifdef XR_USE_PLATFORM_WIN32
11 virtual ~Win32Platform()
override { }
12 std::vector<std::string> GetInstanceExtensions()
const override {
return {}; }
13 XrBaseInStructure* GetInstanceCreateExtension()
const override {
return XR_NULL_HANDLE; }
15std::shared_ptr<IPlatform> CreatePlatform_Win32()
17 return std::make_shared<Win32Platform>();
21#ifdef XR_USE_PLATFORM_ANDROID
23struct AndroidPlatform :
public IPlatform {
24 AndroidPlatform(
const std::shared_ptr<PlatformData>& data)
26 instanceCreateInfoAndroid = { XR_TYPE_INSTANCE_CREATE_INFO_ANDROID_KHR };
27 instanceCreateInfoAndroid.applicationVM = data->applicationVM;
28 instanceCreateInfoAndroid.applicationActivity = data->applicationActivity;
31 std::vector<std::string> GetInstanceExtensions()
const override {
return { XR_KHR_ANDROID_CREATE_INSTANCE_EXTENSION_NAME }; }
32 XrBaseInStructure* GetInstanceCreateExtension()
const override {
return (XrBaseInStructure*)&instanceCreateInfoAndroid; }
34 XrInstanceCreateInfoAndroidKHR instanceCreateInfoAndroid;
37std::shared_ptr<IPlatform> CreatePlatform_Android(
const std::shared_ptr<PlatformData>& data)
39 return std::make_shared<AndroidPlatform>(data);
43std::shared_ptr<IPlatform> CreatePlatform(
const std::shared_ptr<PlatformData>& data)
45#if !defined(XR_USE_PLATFORM_ANDROID)
49#if defined(XR_USE_PLATFORM_WIN32)
50 return CreatePlatform_Win32();
51#elif defined(XR_USE_PLATFORM_ANDROID)
52 return CreatePlatform_Android(data);
62#error Unsupported platform or no XR platform defined!