diff --git a/instance.cpp b/instance.cpp index 99f790f..1978ad3 100644 --- a/instance.cpp +++ b/instance.cpp @@ -21,24 +21,35 @@ using cruft::vk::instance; /////////////////////////////////////////////////////////////////////////////// -instance::create_info::create_info () -{ - sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO; - pNext = nullptr; - flags = 0; +static const VkInstanceCreateInfo DEFAULT_INFO = { + .sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO, + .pNext = nullptr, + .flags = 0, - pApplicationInfo = nullptr; + .pApplicationInfo = nullptr, - enabledLayerCount = 0; - ppEnabledLayerNames = nullptr; + .enabledLayerCount = 0, + .ppEnabledLayerNames = nullptr, - enabledExtensionCount = 0; - ppEnabledExtensionNames = nullptr; -} + .enabledExtensionCount = 0, + .ppEnabledExtensionNames = nullptr +}; //----------------------------------------------------------------------------- -instance::instance (const VkInstanceCreateInfo &info): +instance::create_info::create_info (): + create_info (DEFAULT_INFO) +{ ; } + + +//----------------------------------------------------------------------------- +instance::create_info::create_info (const VkInstanceCreateInfo &base): + VkInstanceCreateInfo (base) +{ ; } + + +/////////////////////////////////////////////////////////////////////////////// +instance::instance (const create_info &info): instantiated (&info, nullptr) { ; } diff --git a/instance.hpp b/instance.hpp index 272007f..4cd1f8b 100644 --- a/instance.hpp +++ b/instance.hpp @@ -30,9 +30,10 @@ namespace cruft::vk { struct instance : public instantiated { struct create_info : public VkInstanceCreateInfo { create_info (); + create_info (const VkInstanceCreateInfo&); }; - instance (const VkInstanceCreateInfo &info); + instance (const create_info &info); std::set extensions (void) const; };