aboutsummaryrefslogtreecommitdiff
path: root/include/cru/win/graph/direct/platform_id.hpp
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2019-06-27 15:29:13 +0800
committercrupest <crupest@outlook.com>2019-06-27 15:29:13 +0800
commit8c5b05bcfce96495b4ffc4209ab8feda12597729 (patch)
treea0a8bc99d8ffb42dc231696a4e4dfd1e7607eea0 /include/cru/win/graph/direct/platform_id.hpp
parentbaa7cf141b8121473edceae16c1a20a6d47bd202 (diff)
downloadcru-8c5b05bcfce96495b4ffc4209ab8feda12597729.tar.gz
cru-8c5b05bcfce96495b4ffc4209ab8feda12597729.tar.bz2
cru-8c5b05bcfce96495b4ffc4209ab8feda12597729.zip
...
Diffstat (limited to 'include/cru/win/graph/direct/platform_id.hpp')
-rw-r--r--include/cru/win/graph/direct/platform_id.hpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/include/cru/win/graph/direct/platform_id.hpp b/include/cru/win/graph/direct/platform_id.hpp
new file mode 100644
index 00000000..ff02eb27
--- /dev/null
+++ b/include/cru/win/graph/direct/platform_id.hpp
@@ -0,0 +1,19 @@
+#pragma once
+#include <cru/platform/native_resource.hpp>
+
+#include <stdexcept>
+#include <string_view>
+
+namespace cru::platform::graph::win::direct {
+constexpr std::wstring_view platform_id = L"Windows Direct";
+
+bool IsDirectResource(NativeResource* resource) {
+ return resource->GetPlatformId() == platform_id;
+}
+
+} // namespace cru::platform::graph::win::direct
+
+#define CRU_PLATFORMID_IMPLEMENT_DIRECT \
+ std::wstring_view GetPlatformId() const override { \
+ return ::cru::platform::graph::win::direct::platform_id; \
+ }