-
Notifications
You must be signed in to change notification settings - Fork 35
/
Copy pathextension.cc
31 lines (24 loc) · 1.02 KB
/
extension.cc
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
#include <vkpp/extension.hh>
#include <cstring>
namespace vkpp {
Extension::Extension(const std::string& name,
const Version& spec_version)
: name { name },
spec_version { spec_version } { }
Extension::Extension(const char* name) : Extension { name, { 0, 0, 0 } } { }
Extension::Extension(const VkExtensionProperties& extension)
: name { extension.extensionName },
spec_version { extension.specVersion } { }
Extension::operator VkExtensionProperties() const {
VkExtensionProperties extension_properties;
std::strcpy(extension_properties.extensionName, name.c_str());
extension_properties.specVersion = spec_version;
return extension_properties;
}
bool Extension::operator==(const Extension& other) const {
return name == other.name;
}
bool Extension::operator!=(const Extension& other) const {
return !(*this == other);
}
}