64 lines
1.5 KiB
C++
64 lines
1.5 KiB
C++
|
#include <QApplication>
|
||
|
#include <QVulkanInstance>
|
||
|
|
||
|
#include "mainwindow.h"
|
||
|
#include "platform.h"
|
||
|
#include "context.h"
|
||
|
#include "renderer.h"
|
||
|
#include "worldmanager.h"
|
||
|
#include "assetmanager.h"
|
||
|
#include "ecs.h"
|
||
|
|
||
|
static std::vector<std::string> extensionList;
|
||
|
|
||
|
std::vector<const char*> platform::getRequiredExtensions() {
|
||
|
QVulkanInstance instance;
|
||
|
instance.create();
|
||
|
|
||
|
for(const auto& extension : instance.extensions())
|
||
|
extensionList.push_back(extension.data());
|
||
|
|
||
|
instance.destroy();
|
||
|
|
||
|
std::vector<const char*> extensions;
|
||
|
for(const auto& extension : extensionList)
|
||
|
extensions.push_back(extension.c_str());
|
||
|
|
||
|
return extensions;
|
||
|
}
|
||
|
|
||
|
uint32_t platform::getTime() {
|
||
|
return 0;
|
||
|
}
|
||
|
|
||
|
int main(int argc, char* argv[]) {
|
||
|
QApplication app(argc, argv);
|
||
|
|
||
|
GraphicsConfig config;
|
||
|
config.shadowResolution = 256;
|
||
|
config.dofDownscale = 2;
|
||
|
config.filterPCF = true;
|
||
|
config.enableImgui = false;
|
||
|
|
||
|
Context context;
|
||
|
context.renderer = new Renderer(config);
|
||
|
|
||
|
assetManager.setRenderer(context.renderer);
|
||
|
|
||
|
worldManager.loadWorld("test.world");
|
||
|
worldManager.switchWorld("test.world");
|
||
|
|
||
|
EntityID entity = ECS::createEntity(worldManager.getCurrentWorld());
|
||
|
|
||
|
auto cameraTransform = ECS::addComponent<TransformComponent>(entity);
|
||
|
cameraTransform->position = glm::vec3(5, 5, 5);
|
||
|
|
||
|
auto cameraComponent = ECS::addComponent<CameraComponent>(entity);
|
||
|
cameraComponent->fov = 70.0f;
|
||
|
|
||
|
MainWindow window(context);
|
||
|
window.show();
|
||
|
|
||
|
return app.exec();
|
||
|
}
|