22 lines
501 B
C++
22 lines
501 B
C++
#include "Surface.hpp"
|
|
|
|
#include <stdexcept>
|
|
#include <string>
|
|
|
|
#include "Instance.hpp"
|
|
#include "DeviceFunctions/DeviceFunctions.hpp"
|
|
|
|
namespace VkObjects
|
|
{
|
|
Surface::Surface(const Instance& instance, GLFWwindow* window):instance_(instance)
|
|
{
|
|
VK_CHECK(glfwCreateWindowSurface(instance_.get_native(), window, nullptr, &surface_))
|
|
}
|
|
|
|
Surface::~Surface()
|
|
{
|
|
if(surface_ != nullptr)
|
|
vkDestroySurfaceKHR(instance_.get_native(), surface_, nullptr);
|
|
}
|
|
}
|