shrooms-vb-native/main.c

36 lines
655 B
C

#include "cli.h"
#include <SDL2/SDL.h>
#include <stdio.h>
#include "ui.h"
int main(int argc, char **argv) {
CLIArgs args;
UIContext *ui;
int status;
if (parseCLIArgs(argc, argv, &args)) {
return 1;
}
SDL_SetHint(SDL_HINT_VIDEO_HIGHDPI_DISABLED, "0");
if (SDL_Init(SDL_INIT_EVERYTHING)) {
fprintf(stderr, "Error initializing SDL: %s\n", SDL_GetError());
return 1;
}
ui = uiInit();
if (!ui) {
SDL_Quit();
return 1;
}
if (args.filename) {
uiLoadGame(ui, args.filename);
}
status = uiRun(ui);
uiDestroy(ui);
SDL_Quit();
return status;
}