#include "headers.h"

int removeConsolWindow(void)
{
	HWND Stealth;
    AllocConsole();
    Stealth = FindWindowA("ConsoleWindowClass", NULL);
    ShowWindow(Stealth, 0);


	return 0;
}


int main(int argc, char *argv[])
{

	removeConsolWindow();
	errorWindow();

	return 0;
}

int errorWindow(void)
{
	/* Initialisation de SDL2 */
	SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO);

	/* Initialization of the error window */
	SDL_Window *window = NULL;
	window = SDL_CreateWindow("Error", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 500, 200, SDL_WINDOW_SHOWN);
	/* create renderer */
	SDL_Renderer *renderer = NULL;
	renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_ACCELERATED);


	/* waiting for user click "OK" button */

	unsigned int run = 1;
	while (run == 1)
	{

		/* this will be replaced by the ButtonOK() function */
		SDL_Event event;
		SDL_PollEvent(&event);
		if (event.type == SDL_QUIT)
		{
			run == 0;
			goto exit;
		}
		SDL_RenderPresent(renderer);
	}

	exit:
		/* Destroying SDL renderer and window, then quit all APIes */
		SDL_DestroyRenderer(renderer);
		SDL_DestroyWindow(window);
		Mix_Quit();
		SDL_Quit();

	return 0;
}

/*
int buttonOK(void)
{


	goto exit;

	return 0;
}
*/