#pragma once #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "window.h" #include "surface.h" #include "physicaldevice.h" #include "logicaldevice.h" namespace Engine { const int MAX_FRAMES_IN_FLIGHT = 2; class Instance; class Engine { friend class Instance; public: Engine(); ~Engine(); void run(); bool enableValidationLayers() const; void addLayer(const std::string& layerName); void addInstanceExtension(const std::string& extensionName); void addDeviceExtension(const std::string& extensionName); void enableDebug(); std::vector getRequiredVulkanExtensions() const; private: bool initialized; Window* window; Instance* instance; Surface* surface; PhysicalDevice* physicalDevice; LogicalDevice* logicalDevice; std::set layerNames; std::set instanceExtensionNames; std::set deviceExtensionNames; std::vector layers; std::vector instanceExtensions; std::vector deviceExtensions; void initVulkan(); void mainLoop(); void cleanup(); void pickPhysicalDevice(); }; }