forked from KhronosGroup/OpenXR-SDK-Source
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplatformplugin_factory.cpp
36 lines (29 loc) · 1.33 KB
/
platformplugin_factory.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// Copyright (c) 2017-2023, The Khronos Group Inc.
//
// SPDX-License-Identifier: Apache-2.0
#include "pch.h"
#include "platformplugin.h"
#define UNUSED_PARM(x) \
{ (void)(x); }
// Implementation in platformplugin_win32.cpp
std::shared_ptr<IPlatformPlugin> CreatePlatformPlugin_Win32(const std::shared_ptr<Options>& options);
// Implementation in platformplugin_posix.cpp
std::shared_ptr<IPlatformPlugin> CreatePlatformPlugin_Posix(const std::shared_ptr<Options>& options);
// Implementation in platformplugin_android.cpp
std::shared_ptr<IPlatformPlugin> CreatePlatformPlugin_Android(const std::shared_ptr<Options>& /*unused*/,
const std::shared_ptr<PlatformData>& /*unused*/);
std::shared_ptr<IPlatformPlugin> CreatePlatformPlugin(const std::shared_ptr<Options>& options,
const std::shared_ptr<PlatformData>& data) {
#if !defined(XR_USE_PLATFORM_ANDROID)
UNUSED_PARM(data);
#endif
#if defined(XR_USE_PLATFORM_WIN32)
return CreatePlatformPlugin_Win32(options);
#elif defined(XR_USE_PLATFORM_ANDROID)
return CreatePlatformPlugin_Android(options, data);
#elif defined(XR_OS_APPLE) || defined(XR_OS_LINUX)
return CreatePlatformPlugin_Posix(options);
#else
#error Unsupported platform or no XR platform defined!
#endif
}