tsp/main.cpp

37 lines
708 B
C++

#include <iostream>
#include <algorithm>
#include "renderwindow.h"
#include <QApplication>
#include <SDL2/SDL.h>
#include <qtimer.h>
int main(int argc, char *argv[])
{
std::setlocale(LC_NUMERIC, "C");
QApplication application(argc, argv);
SDL_InitSubSystem(SDL_INIT_VIDEO);
if((SDL_Init(SDL_INIT_VIDEO) == -1)) {
std::cerr << "Error initializing SDL: " << SDL_GetError() << std::endl;
return EXIT_FAILURE;
}
auto window = std::make_shared<RenderWindow>();
window->show();
int res = QApplication::exec();
if (res != 0) {
std::cerr << "QApplication::exec() returned " << res << std::endl;
}
SDL_Quit();
return EXIT_SUCCESS;
}