BackRoomsMaker/src/main.c

65 lines
1.6 KiB
C

#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <math.h>
#include <stdbool.h>
#include <ncurses.h>
#include <unistd.h>
#include <termios.h>
#include <limits.h>
#include <time.h>
#include <SDL2/SDL.h>
#include <SDL2/SDL_image.h>
#include "hash.h"
#include "structure.h"
#include "base.h"
#include "display.h"
#include "generation.h"
#include "move.h"
int main(int argc, char** argv) {
srand(time(NULL));
//-------------------------------------------------------------------------------//
if (SDL_Init(SDL_INIT_EVERYTHING) != 0) {
printf("error initializing SDL: %s\n", SDL_GetError());
}
SDL_Window* win = SDL_CreateWindow("Game",
SDL_WINDOWPOS_CENTERED,
SDL_WINDOWPOS_CENTERED,
1200, 800, 0);
Uint32 render_flags = SDL_RENDERER_ACCELERATED;
SDL_Renderer* rend = SDL_CreateRenderer(win, -1, render_flags);
SDL_SetRenderDrawBlendMode(rend, SDL_BLENDMODE_BLEND);
//-------------------------------------------------------------------------------//
if(SDL_Init(SDL_INIT_AUDIO)) {
fprintf(stderr, "cannot initialize audio");
exit(1);
}
/* -------------------------------------------------------- */
//one_debug();
parse_configs("templates.txt", 32);
initialize(rend);
//print_template(1);
//rotateTemplateClockWise(1);
//print_template(1);
moveFunctionMaster(rend);
destroy();
/* -------------------------------------------------------- */
SDL_DestroyRenderer(rend);
SDL_DestroyWindow(win);
SDL_Quit();
return 0;
}