From 70d3935bf951c3e081faca02dd56d4f53d0c0a4f Mon Sep 17 00:00:00 2001 From: Bastiaan Olij Date: Wed, 14 Sep 2022 11:20:54 +1000 Subject: Update OpenXR to 1.0.25 --- thirdparty/openxr/src/common/unique_asset.h | 33 +++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 thirdparty/openxr/src/common/unique_asset.h (limited to 'thirdparty/openxr/src/common/unique_asset.h') diff --git a/thirdparty/openxr/src/common/unique_asset.h b/thirdparty/openxr/src/common/unique_asset.h new file mode 100644 index 0000000000..4929039a03 --- /dev/null +++ b/thirdparty/openxr/src/common/unique_asset.h @@ -0,0 +1,33 @@ +// Copyright (c) 2017-2022, The Khronos Group Inc. +// +// SPDX-License-Identifier: Apache-2.0 OR MIT +#pragma once + +#ifdef XR_USE_PLATFORM_ANDROID + +#include +#include + +namespace deleters { +struct AAssetDeleter { + void operator()(AAsset* asset) const noexcept { + if (asset != nullptr) { + AAsset_close(asset); + } + } +}; + +struct AAssetDirDeleter { + void operator()(AAssetDir* dir) const noexcept { + if (dir != nullptr) { + AAssetDir_close(dir); + } + } +}; + +} // namespace deleters + +using UniqueAsset = std::unique_ptr; +using UniqueAssetDir = std::unique_ptr; + +#endif -- cgit v1.2.3