Archived
1
Fork 0
This repository has been archived on 2025-04-12. You can view files and clone it, but cannot push or open issues or pull requests.
graph/tools/leveleditor/src/main.cpp

64 lines
1.5 KiB
C++
Raw Normal View History

2018-12-21 06:32:37 -05:00
#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();
}