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

27 lines
814 B
C++
Raw Permalink 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[])
{
2021-09-05 21:47:36 +02:00
inst::util::initApp();
try {
auto renderer = Renderer::New(RendererInitOptions(SDL_INIT_EVERYTHING, RendererHardwareFlags).WithIMG(IMGAllFlags).WithMixer(MixerAllFlags).WithTTF());
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);
main->Prepare();
main->ShowWithFadeIn();
updateThread.join();
}
catch (std::exception& e) {
LOG_DEBUG("An error occurred:\n%s", e.what());
}
inst::util::deinitApp();
return 0;
2019-10-17 22:20:40 +02:00
}