Vulkan/Surface: Add missing implementation

Former-commit-id: ca6008f2c717aee8cea80805f9f5f0c6ed950c32
This commit is contained in:
Lynix 2016-04-29 22:46:43 +02:00
parent 3d09177795
commit 5bd08501e9
1 changed files with 7 additions and 2 deletions

View File

@ -13,7 +13,7 @@ namespace Nz
{ {
inline Surface::Surface(Instance& instance) : inline Surface::Surface(Instance& instance) :
m_instance(instance), m_instance(instance),
m_surface(0) m_surface(VK_NULL_HANDLE)
{ {
} }
@ -119,10 +119,15 @@ namespace Nz
inline void Surface::Destroy() inline void Surface::Destroy()
{ {
if (m_surface) if (m_surface != VK_NULL_HANDLE)
m_instance.vkDestroySurfaceKHR(m_instance, m_surface, (m_allocator.pfnAllocation) ? &m_allocator : nullptr); m_instance.vkDestroySurfaceKHR(m_instance, m_surface, (m_allocator.pfnAllocation) ? &m_allocator : nullptr);
} }
inline VkResult Surface::GetLastErrorCode() const
{
return m_lastErrorCode;
}
inline bool Surface::IsSupported() const inline bool Surface::IsSupported() const
{ {
if (!m_instance.IsExtensionLoaded("VK_KHR_surface")) if (!m_instance.IsExtensionLoaded("VK_KHR_surface"))