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

//Error mode
#if 1
#define GLLIB_DEBUG_MODE 1
//1 =             All errors, all warnings, reported
//2 =             All errors,  no warnings, reported
//3 = Not-implemented errors, all warnings, reported
//4 = Not-implemented errors,  no warnings, reported
#if      GLLIB_DEBUG_MODE == 1
	#define GLLIB_ERROR_MODE_REPORT_ERRORS
	#define GLLIB_ERROR_MODE_REPORT_WARNINGS
#elif GLLIB_DEBUG_MODE == 2
	#define GLLIB_ERROR_MODE_REPORT_ERRORS
#elif GLLIB_DEBUG_MODE == 3
	#define GLLIB_ERROR_MODE_REPORT_WARNINGS
#else //if GLLIB_DEBUG_MODE == 4
	#define GLLIB_ERROR_MODE_REPORT_NONE
#endif
#endif

//Misc. Helpers/#defines
#if 1
//#define CALL_MEMBER_FUNCTION(object = 0x00000000;ptrToMember) ((object).*(ptrToMember))

#if SDL_BYTEORDER == SDL_LIL_ENDIAN
	#define SDL_MASK_RED   0x000000FF
	#define SDL_MASK_GREEN 0x0000FF00
	#define SDL_MASK_BLUE  0x00FF0000
	#define SDL_MASK_ALPHA 0xFF000000
#else
	#define SDL_MASK_RED   0xFF000000
	#define SDL_MASK_GREEN 0x00FF0000
	#define SDL_MASK_BLUE  0x0000FF00
	#define SDL_MASK_ALPHA 0x000000FF
#endif

//#define GLLIBMATHVEC_DISALLOW_GENERICS
#endif

//Flag Type
class glLibInternal_flag {
	protected:
		unsigned int _flag;
	public:
		glLibInternal_flag(unsigned int flag) { _flag = flag; }
		operator bool(void) const { return (_flag!=0); }
};
//glLib/glLibExt Flag Types
#if 1
class glLibFlag : public glLibInternal_flag {
	public:
		glLibFlag(void) : glLibInternal_flag(0) { }
		glLibFlag(unsigned int flag) : glLibInternal_flag(flag) { }
		friend glLibFlag operator|(const glLibFlag& val1, const glLibFlag& val2) { return val1._flag|val2._flag; }
		friend glLibFlag operator&(const glLibFlag& val1, const glLibFlag& val2) { return val1._flag&val2._flag; }
		bool operator==(const glLibFlag& val) const { return (_flag==val._flag); }
		bool operator!=(const glLibFlag& val) const { return (_flag!=val._flag); }
};
class glLibFlagRandom : public glLibInternal_flag {
	public:
		glLibFlagRandom(void) : glLibInternal_flag(0) { }
		glLibFlagRandom(unsigned int flag) : glLibInternal_flag(flag) { }
		friend glLibFlagRandom operator|(const glLibFlagRandom& val1, const glLibFlagRandom& val2) { return val1._flag|val2._flag; }
		friend glLibFlagRandom operator&(const glLibFlagRandom& val1, const glLibFlagRandom& val2) { return val1._flag&val2._flag; }
		bool operator==(const glLibFlagRandom& val) const { return (_flag==val._flag); }
		bool operator!=(const glLibFlagRandom& val) const { return (_flag!=val._flag); }
};
class glLibFlagMatrix : public glLibInternal_flag {
	public:
		glLibFlagMatrix(void) : glLibInternal_flag(0) { }
		glLibFlagMatrix(unsigned int flag) : glLibInternal_flag(flag) { }
		friend glLibFlagMatrix operator|(const glLibFlagMatrix& val1, const glLibFlagMatrix& val2) { return val1._flag|val2._flag; }
		friend glLibFlagMatrix operator&(const glLibFlagMatrix& val1, const glLibFlagMatrix& val2) { return val1._flag&val2._flag; }
		bool operator==(const glLibFlagMatrix& val) const { return (_flag==val._flag); }
		bool operator!=(const glLibFlagMatrix& val) const { return (_flag!=val._flag); }
};
class glLibFlagFilter : public glLibInternal_flag {
	public:
		glLibFlagFilter(void) : glLibInternal_flag(0) { }
		glLibFlagFilter(unsigned int flag) : glLibInternal_flag(flag) { }
		friend glLibFlagFilter operator|(const glLibFlagFilter& val1, const glLibFlagFilter& val2) { return val1._flag|val2._flag; }
		friend glLibFlagFilter operator&(const glLibFlagFilter& val1, const glLibFlagFilter& val2) { return val1._flag&val2._flag; }
		bool operator==(const glLibFlagFilter& val) const { return (_flag==val._flag); }
		bool operator!=(const glLibFlagFilter& val) const { return (_flag!=val._flag); }
};
class glLibFlagType : public glLibInternal_flag {
	public:
		glLibFlagType(void) : glLibInternal_flag(0) { }
		glLibFlagType(unsigned int flag) : glLibInternal_flag(flag) { }
		friend glLibFlagType operator|(const glLibFlagType& val1, const glLibFlagType& val2) { return val1._flag|val2._flag; }
		friend glLibFlagType operator&(const glLibFlagType& val1, const glLibFlagType& val2) { return val1._flag&val2._flag; }
		bool operator==(const glLibFlagType& val) const { return (_flag==val._flag); }
		bool operator!=(const glLibFlagType& val) const { return (_flag!=val._flag); }
};
class glLibFlagLight : public glLibInternal_flag {
	public:
		glLibFlagLight() : glLibInternal_flag(0) { }
		glLibFlagLight(unsigned int flag) : glLibInternal_flag(flag) { }
		friend glLibFlagLight operator|(const glLibFlagLight& val1, const glLibFlagLight& val2) { return val1._flag|val2._flag; }
		friend glLibFlagLight operator&(const glLibFlagLight& val1, const glLibFlagLight& val2) { return val1._flag&val2._flag; }
		bool operator==(const glLibFlagLight& val) const { return (_flag==val._flag); }
		bool operator!=(const glLibFlagLight& val) const { return (_flag!=val._flag); }
};
class glLibFlagLighting : public glLibInternal_flag {
	public:
		glLibFlagLighting(void) : glLibInternal_flag(0) { }
		glLibFlagLighting(unsigned int flag) : glLibInternal_flag(flag) { }
		friend glLibFlagLighting operator|(const glLibFlagLighting& val1, const glLibFlagLighting& val2) { return val1._flag|val2._flag; }
		friend glLibFlagLighting operator&(const glLibFlagLighting& val1, const glLibFlagLighting& val2) { return val1._flag&val2._flag; }
		bool operator==(const glLibFlagLighting& val) const { return (_flag==val._flag); }
		bool operator!=(const glLibFlagLighting& val) const { return (_flag!=val._flag); }
};
class glLibFlagTextureEdge : public glLibInternal_flag {
	public:
		glLibFlagTextureEdge(void) : glLibInternal_flag(0) { }
		glLibFlagTextureEdge(unsigned int flag) : glLibInternal_flag(flag) { }
		friend glLibFlagTextureEdge operator|(const glLibFlagTextureEdge& val1, const glLibFlagTextureEdge& val2) { return val1._flag|val2._flag; }
		friend glLibFlagTextureEdge operator&(const glLibFlagTextureEdge& val1, const glLibFlagTextureEdge& val2) { return val1._flag&val2._flag; }
		bool operator==(const glLibFlagTextureEdge& val) const { return (_flag==val._flag); }
		bool operator!=(const glLibFlagTextureEdge& val) const { return (_flag!=val._flag); }
};
class glLibFlagTextureType : public glLibInternal_flag {
	public:
		glLibFlagTextureType(void) : glLibInternal_flag(0) { }
		glLibFlagTextureType(unsigned int flag) : glLibInternal_flag(flag) { }
		friend glLibFlagTextureType operator|(const glLibFlagTextureType& val1, const glLibFlagTextureType& val2) { return val1._flag|val2._flag; }
		friend glLibFlagTextureType operator&(const glLibFlagTextureType& val1, const glLibFlagTextureType& val2) { return val1._flag&val2._flag; }
		bool operator==(const glLibFlagTextureType& val) const { return (_flag==val._flag); }
		bool operator!=(const glLibFlagTextureType& val) const { return (_flag!=val._flag); }
};
class glLibFlagTextureFormat : public glLibInternal_flag {
	public:
		glLibFlagTextureFormat(void) : glLibInternal_flag(0) { }
		glLibFlagTextureFormat(unsigned int flag) : glLibInternal_flag(flag) { }
		friend glLibFlagTextureFormat operator|(const glLibFlagTextureFormat& val1, const glLibFlagTextureFormat& val2) { return val1._flag|val2._flag; }
		friend glLibFlagTextureFormat operator&(const glLibFlagTextureFormat& val1, const glLibFlagTextureFormat& val2) { return val1._flag&val2._flag; }
		bool operator==(const glLibFlagTextureFormat& val) const { return (_flag==val._flag); }
		bool operator!=(const glLibFlagTextureFormat& val) const { return (_flag!=val._flag); }
};
class glLibFlagColor : public glLibInternal_flag {
	public:
		glLibFlagColor(void) : glLibInternal_flag(0) { }
		glLibFlagColor(unsigned int flag) : glLibInternal_flag(flag) { }
		friend glLibFlagColor operator|(const glLibFlagColor& val1, const glLibFlagColor& val2) { return val1._flag|val2._flag; }
		friend glLibFlagColor operator&(const glLibFlagColor& val1, const glLibFlagColor& val2) { return val1._flag&val2._flag; }
		bool operator==(const glLibFlagColor& val) const { return (_flag==val._flag); }
		bool operator!=(const glLibFlagColor& val) const { return (_flag!=val._flag); }
};
class glLibFlagMaterial : public glLibInternal_flag {
	public:
		glLibFlagMaterial(void) : glLibInternal_flag(0) { }
		glLibFlagMaterial(unsigned int flag) : glLibInternal_flag(flag) { }
		friend glLibFlagMaterial operator|(const glLibFlagMaterial& val1, const glLibFlagMaterial& val2) { return val1._flag|val2._flag; }
		friend glLibFlagMaterial operator&(const glLibFlagMaterial& val1, const glLibFlagMaterial& val2) { return val1._flag&val2._flag; }
		bool operator==(const glLibFlagMaterial& val) const { return (_flag==val._flag); }
		bool operator!=(const glLibFlagMaterial& val) const { return (_flag!=val._flag); }
};
class glLibFlagShader : public glLibInternal_flag {
	public:
		glLibFlagShader(void) : glLibInternal_flag(0) { }
		glLibFlagShader(unsigned int flag) : glLibInternal_flag(flag) { }
		friend glLibFlagShader operator|(const glLibFlagShader& val1, const glLibFlagShader& val2) { return val1._flag|val2._flag; }
		friend glLibFlagShader operator&(const glLibFlagShader& val1, const glLibFlagShader& val2) { return val1._flag&val2._flag; }
		bool operator==(const glLibFlagShader& val) const { return (_flag==val._flag); }
		bool operator!=(const glLibFlagShader& val) const { return (_flag!=val._flag); }
};
class glLibExtFlagPhysics : public glLibInternal_flag {
	public:
		glLibExtFlagPhysics(void) : glLibInternal_flag(0) { }
		glLibExtFlagPhysics(unsigned int flag) : glLibInternal_flag(flag) { }
		friend glLibExtFlagPhysics operator|(const glLibExtFlagPhysics& val1, const glLibExtFlagPhysics& val2) { return val1._flag|val2._flag; }
		friend glLibExtFlagPhysics operator&(const glLibExtFlagPhysics& val1, const glLibExtFlagPhysics& val2) { return val1._flag&val2._flag; }
		bool operator==(const glLibExtFlagPhysics& val) const { return (_flag==val._flag); }
		bool operator!=(const glLibExtFlagPhysics& val) const { return (_flag!=val._flag); }
};
class glLibExtFlagCharacter : public glLibInternal_flag {
	public:
		glLibExtFlagCharacter(void) : glLibInternal_flag(0) { }
		glLibExtFlagCharacter(unsigned int flag) : glLibInternal_flag(flag) { }
		friend glLibExtFlagCharacter operator|(const glLibExtFlagCharacter& val1, const glLibExtFlagCharacter& val2) { return val1._flag|val2._flag; }
		friend glLibExtFlagCharacter operator&(const glLibExtFlagCharacter& val1, const glLibExtFlagCharacter& val2) { return val1._flag&val2._flag; }
		bool operator==(const glLibExtFlagCharacter& val) const { return (_flag==val._flag); }
		bool operator!=(const glLibExtFlagCharacter& val) const { return (_flag!=val._flag); }
};
class glLibExtFlagClothes : public glLibInternal_flag {
	public:
		glLibExtFlagClothes(void) : glLibInternal_flag(0) { }
		glLibExtFlagClothes(unsigned int flag) : glLibInternal_flag(flag) { }
		friend glLibExtFlagClothes operator|(const glLibExtFlagClothes& val1, const glLibExtFlagClothes& val2) { return val1._flag|val2._flag; }
		friend glLibExtFlagClothes operator&(const glLibExtFlagClothes& val1, const glLibExtFlagClothes& val2) { return val1._flag&val2._flag; }
		bool operator==(const glLibExtFlagClothes& val) const { return (_flag==val._flag); }
		bool operator!=(const glLibExtFlagClothes& val) const { return (_flag!=val._flag); }
};
class glLibExtFlagAlg : public glLibInternal_flag {
	public:
		glLibExtFlagAlg(void) : glLibInternal_flag(0) { }
		glLibExtFlagAlg(unsigned int flag) : glLibInternal_flag(flag) { }
		friend glLibExtFlagClothes operator|(const glLibExtFlagAlg& val1, const glLibExtFlagAlg& val2) { return val1._flag|val2._flag; }
		friend glLibExtFlagClothes operator&(const glLibExtFlagAlg& val1, const glLibExtFlagAlg& val2) { return val1._flag&val2._flag; }
		bool operator==(const glLibExtFlagAlg& val) const { return (_flag==val._flag); }
		bool operator!=(const glLibExtFlagAlg& val) const { return (_flag!=val._flag); }
};
#endif

//glLib Flags
//	Misc.
#if 1
const glLibFlag     GLLIB_FALSE = 0x00000000;
const glLibFlag      GLLIB_TRUE = 0x00000001;
const glLibFlag      GLLIB_NONE = 0x00000002;

const glLibFlag        GLLIB_3D = 0x00000004;
const glLibFlag        GLLIB_2D = 0x00000008;

// const glLibFlag GLLIB_FBCOPY							glLibLocal(6)
// const glLibFlag GLLIB_USING_SHADER						false
const glLibFlag       GLLIB_MAX = 0x00000010;
const glLibFlag      GLLIB_AUTO = 0x00000020;
const glLibFlag       GLLIB_ALL = 0x00000040;

const glLibFlag       GLLIB_OLD = 0x00000080;

const glLibFlag      GLLIB_LEFT = 0x00000100;
const glLibFlag     GLLIB_RIGHT = 0x00000200;
const glLibFlag    GLLIB_BOTTOM = 0x00000400;
const glLibFlag       GLLIB_TOP = 0x00000800;
const glLibFlag     GLLIB_FRONT = 0x00001000;
const glLibFlag      GLLIB_BACK = 0x00002000;
const glLibFlag    GLLIB_CENTER = 0x00004000;

const glLibFlag    GLLIB_AXIS_X = 0x00008000;
const glLibFlag    GLLIB_AXIS_Y = 0x00010000;
const glLibFlag    GLLIB_AXIS_Z = 0x00020000;

const glLibFlag       GLLIB_CPU = 0x00040000;
const glLibFlag       GLLIB_GPU = 0x00080000;

const glLibFlag       GLLIB_VERTEX = 0x00100000;
const glLibFlag       GLLIB_NORMAL = 0x00200000;
const glLibFlag     GLLIB_TEXCOORD = 0x00400000;
const glLibFlag      GLLIB_TANGENT = 0x00800000;

const glLibFlag GLLIB_UNDEFINED = 0x00100000;
const glLibFlag GLLIB_ALL_FLAGS = 0xFFFFFFFF;
#endif
//	Random
#if 1
const glLibFlagRandom  GLLIB_RANDOM_UNIFORM = 0x00000001;
const glLibFlagRandom GLLIB_RANDOM_GAUSSIAN = 0x00000002;
const glLibFlagRandom   GLLIB_RANDOM_NORMAL = 0x00000004;
#endif
//	Matrix
#if 1
const glLibFlagMatrix   GLLIB_MATRIX_IDENTITY = 0x00000001;

const glLibFlagMatrix      GLLIB_MATRIX_MODEL = 0x00000002;
const glLibFlagMatrix       GLLIB_MATRIX_VIEW = 0x00000004;
const glLibFlagMatrix GLLIB_MATRIX_PROJECTION = 0x00000008;

const glLibFlagMatrix      GLLIB_MATRIX_ZEROS = 0x00000010;
const glLibFlagMatrix     GLLIB_MATRIX_ZEROES = 0x00000010;
const glLibFlagMatrix       GLLIB_MATRIX_ONES = 0x00000020;
const glLibFlagMatrix      GLLIB_MATRIX_EMPTY = 0x00000040;

const glLibFlagMatrix        GLLIB_MATRIX_ROW = 0x00000080;
const glLibFlagMatrix     GLLIB_MATRIX_COLUMN = 0x00000100;
#endif
//	Filters
#if 1
const glLibFlagFilter                  GLLIB_FILTER_NEAREST = 0x00000001;
const glLibFlagFilter                 GLLIB_FILTER_BILINEAR = 0x00000002;
const glLibFlagFilter   GLLIB_FILTER_NEAREST_MIPMAP_NEAREST = 0x00000004;
const glLibFlagFilter  GLLIB_FILTER_BILINEAR_MIPMAP_NEAREST = 0x00000008;
const glLibFlagFilter  GLLIB_FILTER_NEAREST_MIPMAP_BILINEAR = 0x00000010;
const glLibFlagFilter GLLIB_FILTER_BILINEAR_MIPMAP_BILINEAR = 0x00000020;
const glLibFlagFilter                 GLLIB_FILTER_GAUSSIAN = 0x00000040;
// const glLibFlagFilter GLLIB_FILTER_BLOOM
// const glLibFlagFilter GLLIB_FILTER_BOX						{{1.0 = 0x00000000;1.0 = 0x00000000;1.0} = 0x00000000;{1.0 = 0x00000000;1.0 = 0x00000000;1.0} = 0x00000000;{1.0 = 0x00000000;1.0 = 0x00000000;1.0}}
const glLibFlagFilter                      GLLIB_FILTER_BOX = 0x00000080;
// const glLibFlagFilter GLLIB_FILTER_LAPLACIAN					{{ 0.0 = 0x00000000;-1.0 = 0x00000000; 0.0} = 0x00000000;{-1.0 = 0x00000000; 4.0 = 0x00000000;-1.0} = 0x00000000;{ 0.0 = 0x00000000;-1.0 = 0x00000000; 0.0}}
const glLibFlagFilter                GLLIB_FILTER_LAPLACIAN = 0x00000100;
// const glLibFlagFilter GLLIB_FILTER_SHARPEN					{{ 0 = 0x00000000;-1 = 0x00000000; 0} = 0x00000000;{-1 = 0x00000000; 5 = 0x00000000;-1} = 0x00000000;{ 0 = 0x00000000;-1 = 0x00000000; 0}}
const glLibFlagFilter                  GLLIB_FILTER_SHARPEN = 0x00000200;
// const glLibFlagFilter GLLIB_FILTER_DOUBLE_LINE_SHARPEN		{{ 0.0 = 0x00000000;-1.0 = 0x00000000;-1.0 = 0x00000000;-1.0 = 0x00000000; 0.0} = 0x00000000;{-1.0 = 0x00000000; 2.0 = 0x00000000;-4.0 = 0x00000000; 2.0 = 0x00000000;-1.0} = 0x00000000;{-1.0 = 0x00000000;-4.0 = 0x00000000;13.0 = 0x00000000;-4.0 = 0x00000000;-1.0} = 0x00000000;{-1.0 = 0x00000000; 2.0 = 0x00000000;-4.0 = 0x00000000; 2.0 = 0x00000000;-1.0} = 0x00000000;{ 0.0 = 0x00000000;-1.0 = 0x00000000;-1.0 = 0x00000000;-1.0 = 0x00000000; 0.0}}
const glLibFlagFilter                  GLLIB_FILTER_SOBEL_X = 0x00000400;
const glLibFlagFilter                  GLLIB_FILTER_SOBEL_Y = 0x00000800;
const glLibFlagFilter                  GLLIB_FILTER_USE_FBO = 0x00001000;
const glLibFlagFilter                GLLIB_FILTER_USE_ACCUM = 0x00002000;
const glLibFlagFilter                 GLLIB_FILTER_USE_CONV = 0x00004000;
const glLibFlagFilter                 GLLIB_FILTER_USE_COPY = 0x00008000;
#endif
//	Types
#if 1
const glLibFlagType       GLLIB_OUTLINE = 0x00000001;

const glLibFlagType          GLLIB_FILL = 0x00000002;

const glLibFlagType         GLLIB_POINT = 0x00000004;

const glLibFlagType          GLLIB_LINE = 0x00000008;

const glLibFlagType      GLLIB_TRIANGLE = 0x00000010;

const glLibFlagType          GLLIB_QUAD = 0x00000020;
const glLibFlagType GLLIB_QUADRILATERAL = 0x00000020;

const glLibFlagType       GLLIB_POLYGON = 0x00000040;
#endif
//	Lighting
#if 1
const glLibFlagLight GLLIB_LIGHT0 = 0x00000001;
const glLibFlagLight GLLIB_LIGHT1 = 0x00000002;
const glLibFlagLight GLLIB_LIGHT2 = 0x00000004;
const glLibFlagLight GLLIB_LIGHT3 = 0x00000008;
const glLibFlagLight GLLIB_LIGHT4 = 0x00000010;
const glLibFlagLight GLLIB_LIGHT5 = 0x00000020;
const glLibFlagLight GLLIB_LIGHT6 = 0x00000040;
const glLibFlagLight GLLIB_LIGHT7 = 0x00000080;
#endif
#if 1
const glLibFlagLighting    GLLIB_VERTEX_NORMALS = 0x00000001;
const glLibFlagLighting      GLLIB_FACE_NORMALS = 0x00000002;
const glLibFlagLighting       GLLIB_LIGHT_POINT = 0x00000004;
const glLibFlagLighting GLLIB_LIGHT_DIRECTIONAL = 0x00000008;
//const glLibFlagLighting GLLIB_SINGLE_SIDE
//const glLibFlagLighting GLLIB_DOUBLE_SIDE
#endif
//	Texturing (also see filters section)
#if 1
const glLibFlagTextureEdge           GLLIB_CLAMP = 0x00000001;
const glLibFlagTextureEdge          GLLIB_REPEAT = 0x00000002;
const glLibFlagTextureEdge GLLIB_REPEAT_MIRRORED = 0x00000004;
#endif
#if 1
const glLibFlagTextureType   GLLIB_TEXTURE_1D = 0x00000001;
const glLibFlagTextureType   GLLIB_TEXTURE_2D = 0x00000002;
const glLibFlagTextureType   GLLIB_TEXTURE_3D = 0x00000004;
const glLibFlagTextureType GLLIB_TEXTURE_CUBE = 0x00000008;
// const glLibFlagTextureType GLLIB_TEXTURE_CUBE_FACES				{GL_TEXTURE_CUBE_MAP_POSITIVE_X = 0x00000000;GL_TEXTURE_CUBE_MAP_NEGATIVE_X = 0x00000000;GL_TEXTURE_CUBE_MAP_POSITIVE_Y = 0x00000000;GL_TEXTURE_CUBE_MAP_NEGATIVE_Y = 0x00000000;GL_TEXTURE_CUBE_MAP_POSITIVE_Z = 0x00000000;GL_TEXTURE_CUBE_MAP_NEGATIVE_Z}
#endif
#if 1
const glLibFlagTextureFormat   GLLIB_RGB = 0x00000001;
const glLibFlagTextureFormat  GLLIB_RGBA = 0x00000002;
const glLibFlagTextureFormat GLLIB_DEPTH = 0x00000004;
const glLibFlagTextureFormat GLLIB_FLOAT = 0x00000008;
#endif
//	Colors
#if 1
const glLibFlagColor     GLLIB_RED = 0x00000001;
const glLibFlagColor  GLLIB_ORANGE = 0x00000002;
const glLibFlagColor  GLLIB_YELLOW = 0x00000004;
const glLibFlagColor   GLLIB_GREEN = 0x00000008;
const glLibFlagColor    GLLIB_BLUE = 0x00000010;

const glLibFlagColor  GLLIB_PURPLE = 0x00000020;
const glLibFlagColor  GLLIB_VIOLET = 0x00000020;

const glLibFlagColor GLLIB_MAGENTA = 0x00000040;
const glLibFlagColor   GLLIB_WHITE = 0x00000080;
const glLibFlagColor   GLLIB_BLACK = 0x00000100;

const glLibFlagColor    GLLIB_GREY = 0x00000200;
const glLibFlagColor    GLLIB_GRAY = 0x00000200;

const glLibFlagColor    GLLIB_PINK = 0x00000400;
const glLibFlagColor    GLLIB_CYAN = 0x00000800;
#endif
//	Materials
#if 1
//		Metals
const glLibFlagMaterial    GLLIB_MATERIAL_METAL_BRASS = 0x00000001;
const glLibFlagMaterial   GLLIB_MATERIAL_METAL_BRONZE = 0x00000002;
const glLibFlagMaterial   GLLIB_MATERIAL_METAL_CHROME = 0x00000004;
const glLibFlagMaterial   GLLIB_MATERIAL_METAL_COPPER = 0x00000008;
const glLibFlagMaterial     GLLIB_MATERIAL_METAL_GOLD = 0x00000010;
const glLibFlagMaterial   GLLIB_MATERIAL_METAL_SILVER = 0x00000020;
//		Plastics
const glLibFlagMaterial    GLLIB_MATERIAL_PLASTIC_RED = 0x00000040;
const glLibFlagMaterial GLLIB_MATERIAL_PLASTIC_YELLOW = 0x00000080;
const glLibFlagMaterial  GLLIB_MATERIAL_PLASTIC_GREEN = 0x00000100;
const glLibFlagMaterial   GLLIB_MATERIAL_PLASTIC_CYAN = 0x00000200;
const glLibFlagMaterial  GLLIB_MATERIAL_PLASTIC_BLACK = 0x00000400;
const glLibFlagMaterial  GLLIB_MATERIAL_PLASTIC_WHITE = 0x00000800;
//		Rubbers
const glLibFlagMaterial     GLLIB_MATERIAL_RUBBER_RED = 0x00001000;
const glLibFlagMaterial  GLLIB_MATERIAL_RUBBER_YELLOW = 0x00002000;
const glLibFlagMaterial   GLLIB_MATERIAL_RUBBER_GREEN = 0x00004000;
const glLibFlagMaterial    GLLIB_MATERIAL_RUBBER_CYAN = 0x00008000;
const glLibFlagMaterial   GLLIB_MATERIAL_RUBBER_BLACK = 0x00010000;
const glLibFlagMaterial   GLLIB_MATERIAL_RUBBER_WHITE = 0x00020000;
//		Stones (precious, semi-precious, and non-precious)
const glLibFlagMaterial        GLLIB_MATERIAL_EMERALD = 0x00040000;
const glLibFlagMaterial          GLLIB_MATERIAL_GLASS = 0x00080000;
const glLibFlagMaterial           GLLIB_MATERIAL_JADE = 0x00100000;
const glLibFlagMaterial       GLLIB_MATERIAL_OBSIDIAN = 0x00200000;
const glLibFlagMaterial          GLLIB_MATERIAL_PEARL = 0x00400000;
const glLibFlagMaterial           GLLIB_MATERIAL_RUBY = 0x00800000;
const glLibFlagMaterial      GLLIB_MATERIAL_TURQUOISE = 0x01000000;
//		Misc.
const glLibFlagMaterial           GLLIB_MATERIAL_FULL = 0x02000000;
const glLibFlagMaterial        GLLIB_MATERIAL_DEFAULT = 0x04000000;
#endif
//	Shaders
#if 1
const glLibFlagShader GLLIB_SHADER_PROGRAM_VERT = 0x00000001;
const glLibFlagShader GLLIB_SHADER_PROGRAM_GEOM = 0x00000002;
const glLibFlagShader GLLIB_SHADER_PROGRAM_FRAG = 0x00000004;
// const glLibFlag GLLIB_PHONG								glLibLocal(701)
// const glLibFlag GLLIB_BLINN								glLibLocal(702)
// const glLibFlag GLLIB_TEXTURE							glLibLocal(703)
// const glLibFlag GLLIB_VIEW_DEPTHBUFFER					glLibLocal(704)
// const glLibFlag GLLIB_VIEW_NORMALS						glLibLocal(705)
// const glLibFlag GLLIB_BLANK								glLibLocal(706)
// const glLibFlag GLLIB_DEPTH_PEEL						glLibLocal(707)
// const glLibFlag GLLIB_DEPTH_PEEL_TYPES					glLibLocal(708)
// const glLibFlag GLLIB_DEPTH_PEEL_TRANSPARENT			glLibLocal(709)
// const glLibFlag GLLIB_DEPTH_PEEL_SINGLE_PASS			glLibLocal(710)
// const glLibFlag GLLIB_POSITION_NORMAL_MAP				glLibLocal(711)
// const glLibFlag GLLIB_CAUSTIC_MAP						glLibLocal(712)
// const glLibFlag GLLIB_PARTICLE_DRAW						glLibLocal(713)
// const glLibFlag GLLIB_PARTICLE_UPDATE					glLibLocal(714)
// const glLibFlag GLLIB_CLOTH_DISTANCE					glLibLocal(715)
// const glLibFlag GLLIB_CLOTH_UPDATE						glLibLocal(716)
// const glLibFlag GLLIB_CLOTH_COLLIDE						glLibLocal(717)
// const glLibFlag GLLIB_CLOTH_NORMAL						glLibLocal(718)
// const glLibFlag GLLIB_CLOTH_DRAW						glLibLocal(719)
// const glLibFlag GLLIB_HAIR_GROW							glLibLocal(720)
// const glLibFlag GLLIB_HAIR_UPDATE						glLibLocal(721)
// const glLibFlag GLLIB_HAIR_DRAW							glLibLocal(722)
// const glLibFlag GLLIB_FLUID2D_DIFFUSE					glLibLocal(723)
// const glLibFlag GLLIB_FLUID2D_ADVECT					glLibLocal(724)
// const glLibFlag GLLIB_FLUID3D_UPDATE					glLibLocal(725)
// const glLibFlag GLLIB_FLUID3D_DRAW						glLibLocal(726)
// const glLibFlag GLLIB_SOFTPHYS_UPDATE					glLibLocal(727)
// const glLibFlag GLLIB_SOFTPHYS_COLLIDE					glLibLocal(728)
// const glLibFlag GLLIB_SOFTPHYS_ADDFORCE					glLibLocal(729)
// const glLibFlag GLLIB_VOLUME_RAY						glLibLocal(730)

//    Obstacles (801-900)
#endif

//glLibExt Flags
//	Physics and Collision Detection
#if 1
const glLibExtFlagPhysics GLLIBEXT_RELATIVE = 0x00000001;
const glLibExtFlagPhysics GLLIBEXT_WORLD = 0x00000002;
//const glLibExtFlagPhysics GLLIBEXT_OBSTACLE_POLYGONAL = 0x00000001;
//const glLibExtFlagPhysics    GLLIBEXT_OBSTACLE_SPHERE = 0x00000002;
//const glLibExtFlagPhysics       GLLIBEXT_OBSTACLE_BOX = 0x00000004;
#endif
//	Characters
#if 0
const glLibExtFlagCharacter                    GLLIBEXT_MALE = 0x00000001;
const glLibExtFlagCharacter                  GLLIBEXT_FEMALE = 0x00000002;
const glLibExtFlagCharacter       GLLIBEXT_CHARACTER_LEFTHIP = 0x00000004;
const glLibExtFlagCharacter      GLLIBEXT_CHARACTER_RIGHTHIP = 0x00000008;
const glLibExtFlagCharacter      GLLIBEXT_CHARACTER_LEFTKNEE = 0x00000010;
const glLibExtFlagCharacter     GLLIBEXT_CHARACTER_RIGHTKNEE = 0x00000020;
const glLibExtFlagCharacter     GLLIBEXT_CHARACTER_LEFTANKLE = 0x00000040;
const glLibExtFlagCharacter    GLLIBEXT_CHARACTER_RIGHTANKLE = 0x00000080;
const glLibExtFlagCharacter        GLLIBEXT_CHARACTER_PELVIS = 0x00000100;
const glLibExtFlagCharacter          GLLIBEXT_CHARACTER_BACK = 0x00000200;
const glLibExtFlagCharacter  GLLIBEXT_CHARACTER_LEFTSHOULDER = 0x00000400;
const glLibExtFlagCharacter GLLIBEXT_CHARACTER_RIGHTSHOULDER = 0x00000800;
const glLibExtFlagCharacter     GLLIBEXT_CHARACTER_LEFTELBOW = 0x00001000;
const glLibExtFlagCharacter    GLLIBEXT_CHARACTER_RIGHTELBOW = 0x00002000;
#endif
//	Clothes
#if 0
const glLibExtFlagClothes       GLLIBEXT_CLOTHES_SHORTS = 0x00000001;
const glLibExtFlagClothes    GLLIBEXT_CLOTHES_LONGPANTS = 0x00000002;
const glLibExtFlagClothes        GLLIBEXT_CLOTHES_SKIRT = 0x00000004;
const glLibExtFlagClothes        GLLIBEXT_CLOTHES_DRESS = 0x00000008;
const glLibExtFlagClothes        GLLIBEXT_CLOTHES_SHIRT = 0x00000010;
const glLibExtFlagClothes GLLIBEXT_CLOTHES_STRAPLESSTOP = 0x00000020;
const glLibExtFlagClothes  GLLIBEXT_CLOTHES_BUTTONSHIRT = 0x00000040;
const glLibExtFlagClothes         GLLIBEXT_CLOTHES_COAT = 0x00000080;
const glLibExtFlagClothes   GLLIBEXT_CLOTHES_SUITJACKET = 0x00000100;
const glLibExtFlagClothes   GLLIBEXT_CLOTHES_TRENCHCOAT = 0x00000200;
const glLibExtFlagClothes         GLLIBEXT_CLOTHES_CAPE = 0x00000400;
const glLibExtFlagClothes        GLLIBEXT_CLOTHES_CLOAK = 0x00000800;
const glLibExtFlagClothes      GLLIBEXT_CLOTHES_NECKTIE = 0x00001000;
const glLibExtFlagClothes       GLLIBEXT_CLOTHES_BOWTIE = 0x00002000;
const glLibExtFlagClothes        GLLIBEXT_CLOTHES_SCARF = 0x00004000;
#endif
//	Algorithm Flags
//		Graphs
#if 1
const glLibExtFlagAlg GLLIBEXT_GRAPH_SOLVER_DIJKSTRA = 0x00000001;
#endif