very crude first triangle pre version
This commit is contained in:
parent
649fdb795f
commit
8d5f6e8a3e
22 changed files with 1789 additions and 5 deletions
70
engine/engine.h
Normal file
70
engine/engine.h
Normal file
|
@ -0,0 +1,70 @@
|
|||
#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 "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<const char *> getRequiredVulkanExtensions() const;
|
||||
|
||||
private:
|
||||
bool initialized;
|
||||
Window* window;
|
||||
Instance* instance;
|
||||
Surface* surface;
|
||||
PhysicalDevice* physicalDevice;
|
||||
LogicalDevice* logicalDevice;
|
||||
std::set<std::string> layerNames;
|
||||
std::set<std::string> instanceExtensionNames;
|
||||
std::set<std::string> deviceExtensionNames;
|
||||
std::vector<const char*> layers;
|
||||
std::vector<const char*> instanceExtensions;
|
||||
std::vector<const char*> deviceExtensions;
|
||||
|
||||
void initVulkan();
|
||||
void mainLoop();
|
||||
void cleanup();
|
||||
void pickPhysicalDevice();
|
||||
};
|
||||
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue