-
Notifications
You must be signed in to change notification settings - Fork 257
/
platformplugin_android.cpp
34 lines (26 loc) · 1.32 KB
/
platformplugin_android.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
// Copyright (c) 2017-2024, The Khronos Group Inc.
//
// SPDX-License-Identifier: Apache-2.0
#include "pch.h"
#include "common.h"
#include "platformdata.h"
#include "platformplugin.h"
#ifdef XR_USE_PLATFORM_ANDROID
namespace {
struct AndroidPlatformPlugin : public IPlatformPlugin {
AndroidPlatformPlugin(const std::shared_ptr<Options>& /*unused*/, const std::shared_ptr<PlatformData>& data) {
instanceCreateInfoAndroid = {XR_TYPE_INSTANCE_CREATE_INFO_ANDROID_KHR};
instanceCreateInfoAndroid.applicationVM = data->applicationVM;
instanceCreateInfoAndroid.applicationActivity = data->applicationActivity;
}
std::vector<std::string> GetInstanceExtensions() const override { return {XR_KHR_ANDROID_CREATE_INSTANCE_EXTENSION_NAME}; }
XrBaseInStructure* GetInstanceCreateExtension() const override { return (XrBaseInStructure*)&instanceCreateInfoAndroid; }
void UpdateOptions(const std::shared_ptr<struct Options>& /*unused*/) override {}
XrInstanceCreateInfoAndroidKHR instanceCreateInfoAndroid;
};
} // namespace
std::shared_ptr<IPlatformPlugin> CreatePlatformPlugin_Android(const std::shared_ptr<Options>& options,
const std::shared_ptr<PlatformData>& data) {
return std::make_shared<AndroidPlatformPlugin>(options, data);
}
#endif