ougge/src/main.cpp
2024-08-08 18:03:20 +03:00

40 lines
969 B
C++

#define SDL_MAIN_HANDLED
#include <iostream>
#include "GUI/MainWindow.hpp"
#include "Resources/Resources.hpp"
#include "Game/Scene.hpp"
#include "format.hpp"
#include "exceptions.hpp"
using namespace ougge;
void update(f64 deltaTime){
// std::cout<<"deltaTime: "<<deltaTime<<std::endl;
}
int main(int argc, const char** argv){
try {
Resources::init();
GUI::MainWindow w;
w.open("ougge", update);
w.startUpdateLoop();
}
catch(const std::exception& e){
std::cerr<<"Catched exception: "<<e.what()<<std::endl;
return -1;
}
catch(const char* cstr){
std::cerr<<"Catched error message (const char*): "<<cstr<<std::endl;
return -1;
}
catch(const std::string& str){
std::cerr<<"Catched error message (std::string): "<<str<<std::endl;
return -1;
}
catch(...){
std::cerr<<"Catched unknown error"<<std::endl;
return -1;
}
return 0;
}