#pragma once
#ifndef GLLIB_HEADER_ERROR
#define GLLIB_HEADER_ERROR
#include "../stdafx.h"

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

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

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

#endif