64 lines
1.1 KiB
C++
64 lines
1.1 KiB
C++
#pragma once
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <SDL2/SDL.h>
|
|
#include <SDL2/SDL_vulkan.h>
|
|
|
|
#include <vulkan/vulkan.h>
|
|
|
|
#include <vector>
|
|
#include <set>
|
|
#include <string>
|
|
|
|
#include <iostream>
|
|
#include <stdexcept>
|
|
#include <vector>
|
|
#include <cstring>
|
|
#include <cstdlib>
|
|
#include <cstdint>
|
|
#include <limits>
|
|
#include <optional>
|
|
#include <set>
|
|
|
|
#include "window.h"
|
|
#include "surface.h"
|
|
#include "instance.h"
|
|
#include "physicaldevice.h"
|
|
#include "logicaldevice.h"
|
|
|
|
namespace Engine {
|
|
|
|
const int MAX_FRAMES_IN_FLIGHT = 2;
|
|
|
|
class Engine {
|
|
public:
|
|
Engine();
|
|
~Engine();
|
|
|
|
void run();
|
|
void addDeviceExtension(const std::string& extensionName);
|
|
void enableDebug();
|
|
|
|
private:
|
|
void initVulkan();
|
|
void mainLoop();
|
|
void cleanup();
|
|
void pickPhysicalDevice();
|
|
void handleWindowEvent(const SDL_WindowEvent& e);
|
|
|
|
private:
|
|
bool initialized;
|
|
Window* window;
|
|
Instance* instance;
|
|
Surface* surface;
|
|
PhysicalDevice* physicalDevice;
|
|
LogicalDevice* logicalDevice;
|
|
std::set<std::string> deviceExtensionNames;
|
|
std::vector<const char*> deviceExtensions;
|
|
|
|
};
|
|
|
|
}
|
|
|