#pragma once
#include "../stdafx.h"

namespace glLib {

class error : public runtime_error {
	public:
		error(                void) : runtime_error(   "Error: Undefined (generic) error!"  ) { printf("Error: Undefined (generic) error!\n\n"); }
		error(const  char* message) : runtime_error(  ("Error: "+string(message)).c_str()   ) { printf("Error: \"%s\"\n\n",            message); }
		error(const string message) : runtime_error(  ("Error: "+       message ).c_str()   ) { printf("Error: \"%s\"\n\n",    message.c_str()); }
};

class warning {
	public:
		warning(                void) { printf("Warning: Undefined (generic) warning!\n\n"); }
		warning(const  char* message) { printf("Warning: \"%s\"\n\n",             message ); }
		warning(const string message) { printf("Warning: \"%s\"\n\n",     message.c_str() ); }
};

typedef error GLLIB_ERROR_TYPE_ERROR;
typedef error GLLIB_ERROR_TYPE_WARNING;

//0 never prints
//1 prints if there's an error
//2 always prints
bool error_check(char print_mode, bool add_newline=false);

};