stories/engine/surface.h

37 lines
871 B
C++

#pragma once
#include <vulkan/vulkan.h>
#include "utils.h"
namespace Engine {
class Window;
class Instance;
class Engine;
class LogicalDevice;
class Surface {
friend class Engine;
friend class LogicalDevice;
public:
Surface(const Instance* instance, const Window* window);
~Surface();
VkExtent2D waitForResize() const;
VkExtent2D chooseSwapExtent(const VkSurfaceCapabilitiesKHR& capabilities) const;
VkExtent2D getSize() const;
VkSurfaceFormatKHR chooseSwapSurfaceFormat(const SwapChainSupportDetails& swapChainSupport) const;
bool isDeviceSutable(VkPhysicalDevice device) const;
SwapChainSupportDetails querySwapChainSupport(VkPhysicalDevice device) const;
QueueFamilyIndices findQueueFamilies(VkPhysicalDevice device) const;
private:
VkSurfaceKHR vk;
const Instance* instance;
const Window* window;
};
}