Program Listing for File window_surface.hpp

Return to documentation for file (inexor/vulkan-renderer/wrapper/window_surface.hpp)

#pragma once

#include <GLFW/glfw3.h>
#include <spdlog/spdlog.h>
#include <vulkan/vulkan.h>

#include <cassert>

namespace inexor::vulkan_renderer::wrapper {

class WindowSurface {
    VkInstance m_instance{VK_NULL_HANDLE};
    VkSurfaceKHR m_surface{VK_NULL_HANDLE};

public:
    WindowSurface(VkInstance instance, GLFWwindow *window);

    WindowSurface(const WindowSurface &) = delete;
    WindowSurface(WindowSurface &&) noexcept;

    ~WindowSurface();

    WindowSurface &operator=(const WindowSurface &) = delete;
    WindowSurface &operator=(WindowSurface &&) = default;

    [[nodiscard]] VkSurfaceKHR get() const {
        return m_surface;
    }
};

} // namespace inexor::vulkan_renderer::wrapper