/*
 * Small SDL example to demonstrate dynamically loading 
 * OpenGL lib and functions
 *
 * (FYI it was supposed to look like snow in the wind or something...)
 *
 * Compile with :
 * gcc testdyngl.c `sdl-config --libs --cflags` -o testdyngl -DHAVE_OPENGL
 *
 * You can specify a different OpenGL lib on the command line, i.e. :
 * ./testdyngl  /usr/X11R6/lib/libGL.so.1.2
 * or
 * ./testdyngl  /usr/lib/libGL.so.1.0.4496
 *
 */
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <iostream>

#include "SDL.h"
#include "Person.h"
#include "SDL_image.h"
#include "SDL_mixer.h"
#include "Level.h"

#include "List.h"
#include "Parser.h"
#include "CollisionHandler.h"
#include "CommandManager.h"
#include "Command.h"

#include "Screen.h"
#include "Game.h"
#include "Menu.h"

using namespace std;

int main(int argc,char *argv[])
{		
	// Init SDL video
	Screen* screen = Screen::instance();
   	glfuncs* f = glfuncs::instance();

	//Initialize SDL_mixer
    if( Mix_OpenAudio( 22050, MIX_DEFAULT_FORMAT, 2, 512 ) == -1 )
    {
        return false;    
    }

	Mix_AllocateChannels( 16 );



	bool leave = false;
	/*Game game = Game();

	for(;;)
	{
		if( !game.mainLoop() )
			break;
		else
		{
			game.resetLevel();
		}
	}*/

	List* menuInfo = Parser::parse("menus/main.txt");
	TitleScreenMenu  menu = TitleScreenMenu(menuInfo);
	delete menuInfo;
	menu.mainLoop();
	
	SDL_Quit();
	return 0;
}
