38 lines
796 B
C++
38 lines
796 B
C++
#pragma once
|
|
|
|
#include <SDL2/SDL.h>
|
|
#include <SDL2/SDL_vulkan.h>
|
|
|
|
#include <vulkan/vulkan.h>
|
|
|
|
#include <stdexcept>
|
|
#include <vector>
|
|
#include <algorithm>
|
|
|
|
namespace Engine {
|
|
|
|
class Engine;
|
|
|
|
class Window {
|
|
friend class Engine;
|
|
public:
|
|
Window(uint32_t width = 800, uint32_t height = 600);
|
|
~Window();
|
|
|
|
std::vector<const char *> getRequiredVulkanExtensions() const;
|
|
VkExtent2D waitForResize() const;
|
|
VkExtent2D getSize() const;
|
|
VkExtent2D getDrawableSize() const;
|
|
VkExtent2D chooseSwapExtent(const VkSurfaceCapabilitiesKHR& capabilities) const;
|
|
void createSurface(VkInstance instance, VkSurfaceKHR* out) const;
|
|
|
|
private:
|
|
static SDL_Window* createWindow(uint32_t width = 800, uint32_t height = 600);
|
|
|
|
private:
|
|
SDL_Window* sdl;
|
|
VkExtent2D extent;
|
|
};
|
|
|
|
}
|