diff --git a/traits.hpp b/traits.hpp index 67975b8..4caf953 100644 --- a/traits.hpp +++ b/traits.hpp @@ -12,7 +12,7 @@ * limitations under the License. * * Copyright: - * 2016, Danny Robson + * 2016-2017, Danny Robson */ #ifndef CRUFT_VK_TRAITS_HPP @@ -21,7 +21,32 @@ #include "./fwd.hpp" #include "./vk.hpp" +#include + + namespace cruft::vk { + /// describes the corresponding value for sType in native structures + template + struct structure_type {}; + + + //------------------------------------------------------------------------- + #define DEFINE_STRUCTURE_TYPE(KLASS,VALUE) \ + template <> \ + struct structure_type : \ + public std::integral_constant \ + { } + + DEFINE_STRUCTURE_TYPE (VkInstanceCreateInfo, VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO); + + #undef DEFINE_STRUCTURE_TYPE + + + //------------------------------------------------------------------------- + template + constexpr auto structure_type_v = structure_type::value; + + /////////////////////////////////////////////////////////////////////////// template struct id_traits { };