This repository has been archived on 2021-12-25. You can view files and clone it, but cannot push or open issues or pull requests.
Awoo-Installer/source/main.cpp

26 lines
879 B
C++
Raw Normal View History

#include <thread>
2019-10-17 22:20:40 +02:00
#include "switch.h"
2019-11-30 18:12:59 +01:00
#include "util/error.hpp"
2019-10-17 22:20:40 +02:00
#include "ui/MainApplication.hpp"
#include "util/util.hpp"
#include "util/config.hpp"
2019-10-17 22:20:40 +02:00
using namespace pu::ui::render;
int main(int argc, char* argv[])
{
inst::util::initApp();
2019-10-17 22:20:40 +02:00
try {
2021-09-05 12:59:57 +02:00
auto renderer = Renderer::New(RendererInitOptions(SDL_INIT_EVERYTHING, RendererHardwareFlags).WithIMG(IMGAllFlags).WithMixer(MixerAllFlags).WithTTF());
2019-10-17 22:20:40 +02:00
auto main = inst::ui::MainApplication::New(renderer);
std::thread updateThread;
if (inst::config::autoUpdate && inst::util::getIPAddress() != "1.0.0.127") updateThread = std::thread(inst::util::checkForAppUpdate);
2019-10-17 22:20:40 +02:00
main->Prepare();
2019-12-05 19:16:36 +01:00
main->ShowWithFadeIn();
updateThread.join();
2019-10-17 22:20:40 +02:00
} catch (std::exception& e) {
2019-11-30 18:12:59 +01:00
LOG_DEBUG("An error occurred:\n%s", e.what());
2019-10-17 22:20:40 +02:00
}
inst::util::deinitApp();
2019-10-17 22:20:40 +02:00
return 0;
}