#pragma once
//Disable string safety warnings
#pragma warning(disable:4996)

//Establish which OS this build is on, and define some REASONABLE and CONSISTENT compile flags
#if defined WIN32 || defined _WIN32 || defined WIN64 || defined _WIN64
	#define GLLIB_OS_WINDOWS
#elif defined __linux__ || defined __LINUX__
	#define GLLIB_OS_LINUX
	#define GLLIB_OS_UNIX
#elif defined __apple__ || defined __APPLE__
	#define GLLIB_OS_APPLE
	#define GLLIB_OS_MACINTOSH
	#define GLLIB_OS_UNIX
#else
	#error "OS not recognized!"
#endif

//STD
#include <stdexcept>
#include <stdio.h>
#include <iostream>
#include <algorithm>

//STL
#include <string>
#include <map>
#include <list>
//#include <cstring>
#include <fstream>
#include <sstream>
#include <vector>

//GL
#define GLLIB_EXT_LIBRARY 2
#if GLLIB_EXT_LIBRARY == 1
	#define GLLIB_EXT_LIBRARY_GLEE
#elif GLLIB_EXT_LIBRARY == 2
	#define GLLIB_EXT_LIBRARY_GLEW
#endif

#ifdef GLLIB_EXT_LIBRARY_GLEE
#include <GLee5_4/GLee.h>
#include <GL/gl.h>
#include <GL/glu.h>
#include <GL/glut.h>
#endif

#ifdef GLLIB_EXT_LIBRARY_GLEW
#define GLEW_STATIC
#define NO_SDL_GLEXT

#include <GL/glew.h>
#include <GL/glut.h>
#endif

//SDL
#include <SDL/SDL.h>
#include <SDL/SDL_opengl.h>
#include <SDL/SDL_image.h>
#include <SDL/SDL_ttf.h>

//Misc. definitions
const double pi = 3.141592653589793238;
inline float radians(float angle) { return angle*((float)pi/180.0f); }
inline float degrees(float angle) { return angle*(180.0f/(float)pi); }
inline double radians(double angle) { return angle*(pi/180.0); }
inline double degrees(double angle) { return angle*(180.0/pi); }

//Misc. includes
#include <math.h>
#include <time.h>

//Windows specific
#ifdef GLLIB_OS_WINDOWS
//http://www.codeguru.com/forum/showthread.php?t=312742
#define _CRTDBG_MAP_ALLOC
#include <crtdbg.h>
//#include <tchar.h>
//#include <windows.h>
//#define DLLEXPORT extern "C" __declspec(dllexport)
#endif

//Using
using namespace std;
using std::runtime_error;

//My helpers
#include "glLib/glLibHeaders/Misc/file.h"
#include "glLib/glLibHeaders/Misc/string_functions.h"
#include "glLib/glLibHeaders/Misc/SDL_functions.h"