Index: trunk/src/lib/freetype2.cc
===================================================================
--- trunk/src/lib/freetype2.cc	(revision 166)
+++ trunk/src/lib/freetype2.cc	(revision 167)
@@ -11,278 +11,17 @@
 #include "nv/library.hh"
 
-FT_Error (NV_FREETYPE_APIENTRY *FT_Init_FreeType) (  FT_Library  *alibrary  ) = nullptr;
-FT_Error (NV_FREETYPE_APIENTRY *FT_Done_FreeType) (  FT_Library  library  ) = nullptr;
-FT_Error (NV_FREETYPE_APIENTRY *FT_New_Face) (  FT_Library library, const char*  filepathname, FT_Long face_index, FT_Face *aface  ) = nullptr;
-FT_Error (NV_FREETYPE_APIENTRY *FT_New_Memory_Face) (  FT_Library library, const FT_Byte*  file_base, FT_Long file_size, FT_Long face_index, FT_Face *aface  ) = nullptr;
-FT_Error (NV_FREETYPE_APIENTRY *FT_Open_Face) (  FT_Library library, const FT_Open_Args*  args, FT_Long face_index, FT_Face *aface  ) = nullptr;
-FT_Error (NV_FREETYPE_APIENTRY *FT_Attach_File) (  FT_Face face, const char*  filepathname  ) = nullptr;
-FT_Error (NV_FREETYPE_APIENTRY *FT_Attach_Stream) (  FT_Face face, FT_Open_Args* parameters  ) = nullptr;
-FT_Error (NV_FREETYPE_APIENTRY *FT_Reference_Face) (  FT_Face  face  ) = nullptr;
-FT_Error (NV_FREETYPE_APIENTRY *FT_Done_Face) (  FT_Face  face  ) = nullptr;
-FT_Error (NV_FREETYPE_APIENTRY *FT_Select_Size) (  FT_Face face, FT_Int strike_index  ) = nullptr;
-FT_Error (NV_FREETYPE_APIENTRY *FT_Request_Size) (  FT_Face face, FT_Size_Request req  ) = nullptr;
-FT_Error (NV_FREETYPE_APIENTRY *FT_Set_Char_Size) (  FT_Face face, FT_F26Dot6 char_width, FT_F26Dot6 char_height, FT_UInt horz_resolution, FT_UInt vert_resolution  ) = nullptr;
-FT_Error (NV_FREETYPE_APIENTRY *FT_Set_Pixel_Sizes) (  FT_Face face, FT_UInt pixel_width, FT_UInt pixel_height  ) = nullptr;
-FT_Error (NV_FREETYPE_APIENTRY *FT_Load_Glyph) (  FT_Face face, FT_UInt glyph_index, FT_Int32 load_flags  ) = nullptr;
-FT_Error (NV_FREETYPE_APIENTRY *FT_Load_Char) (  FT_Face face, FT_ULong char_code, FT_Int32 load_flags  ) = nullptr;
-void (NV_FREETYPE_APIENTRY *FT_Set_Transform) (  FT_Face face, FT_Matrix* matrix, FT_Vector* delta  ) = nullptr;
-FT_Error (NV_FREETYPE_APIENTRY *FT_Render_Glyph) (  FT_GlyphSlot slot, FT_Render_Mode render_mode  ) = nullptr;
-FT_Error (NV_FREETYPE_APIENTRY *FT_Get_Kerning) (  FT_Face face, FT_UInt left_glyph, FT_UInt right_glyph, FT_UInt kern_mode, FT_Vector *akerning  ) = nullptr;
-FT_Error (NV_FREETYPE_APIENTRY *FT_Get_Track_Kerning) (  FT_Face face, FT_Fixed point_size, FT_Int degree, FT_Fixed* akerning  ) = nullptr;
-FT_Error (NV_FREETYPE_APIENTRY *FT_Get_Glyph_Name) (  FT_Face face, FT_UInt glyph_index, FT_Pointer buffer, FT_UInt buffer_max  ) = nullptr;
-const char* (NV_FREETYPE_APIENTRY *FT_Get_Postscript_Name) (  FT_Face face  ) = nullptr;
-FT_Error (NV_FREETYPE_APIENTRY *FT_Select_Charmap) (  FT_Face face, FT_Encoding  encoding  ) = nullptr;
-FT_Error (NV_FREETYPE_APIENTRY *FT_Set_Charmap) (  FT_Face face, FT_CharMap charmap  ) = nullptr;
-FT_Int (NV_FREETYPE_APIENTRY *FT_Get_Charmap_Index) (  FT_CharMap charmap  ) = nullptr;
-FT_UInt (NV_FREETYPE_APIENTRY *FT_Get_Char_Index) (  FT_Face face, FT_ULong charcode  ) = nullptr;
-FT_ULong (NV_FREETYPE_APIENTRY *FT_Get_First_Char) (  FT_Face face, FT_UInt *agindex  ) = nullptr;
-FT_ULong (NV_FREETYPE_APIENTRY *FT_Get_Next_Char) (  FT_Face face, FT_ULong char_code, FT_UInt *agindex  ) = nullptr;
-FT_UInt (NV_FREETYPE_APIENTRY *FT_Get_Name_Index) (  FT_Face face, FT_String* glyph_name  ) = nullptr;
-FT_Error (NV_FREETYPE_APIENTRY *FT_Get_SubGlyph_Info) (  FT_GlyphSlot glyph, FT_UInt sub_index, FT_Int *p_index, FT_UInt *p_flags, FT_Int *p_arg1, FT_Int *p_arg2, FT_Matrix *p_transform  ) = nullptr;
-FT_UShort (NV_FREETYPE_APIENTRY *FT_Get_FSType_Flags) (  FT_Face  face  ) = nullptr;
-FT_UInt (NV_FREETYPE_APIENTRY *FT_Face_GetCharVariantIndex) (  FT_Face face, FT_ULong charcode, FT_ULong variantSelector  ) = nullptr;
-FT_Int (NV_FREETYPE_APIENTRY *FT_Face_GetCharVariantIsDefault) (  FT_Face face, FT_ULong charcode, FT_ULong variantSelector  ) = nullptr;
-FT_UInt32* (NV_FREETYPE_APIENTRY *FT_Face_GetVariantSelectors) (  FT_Face face  ) = nullptr;
-FT_UInt32* (NV_FREETYPE_APIENTRY *FT_Face_GetVariantsOfChar) (  FT_Face face, FT_ULong charcode  ) = nullptr;
-FT_UInt32* (NV_FREETYPE_APIENTRY *FT_Face_GetCharsOfVariant) (  FT_Face face, FT_ULong variantSelector  ) = nullptr;
-FT_Long (NV_FREETYPE_APIENTRY *FT_MulFix) (  FT_Long  a, FT_Long  b  ) = nullptr;
-FT_Long (NV_FREETYPE_APIENTRY *FT_DivFix) (  FT_Long  a, FT_Long  b  ) = nullptr;
-FT_Fixed (NV_FREETYPE_APIENTRY *FT_RoundFix) (  FT_Fixed  a  ) = nullptr;
-FT_Fixed (NV_FREETYPE_APIENTRY *FT_CeilFix) (  FT_Fixed  a  ) = nullptr;
-FT_Fixed (NV_FREETYPE_APIENTRY *FT_FloorFix) (  FT_Fixed  a  ) = nullptr;
-void (NV_FREETYPE_APIENTRY *FT_Vector_Transform) (  FT_Vector* vec, const FT_Matrix*  matrix  ) = nullptr;
-void (NV_FREETYPE_APIENTRY *FT_Library_Version) (  FT_Library library, FT_Int *amajor, FT_Int *aminor, FT_Int *apatch  ) = nullptr; 
-FT_Error (NV_FREETYPE_APIENTRY *FT_Get_Glyph) (  FT_GlyphSlot slot, FT_Glyph *aglyph  ) = nullptr;
-FT_Error (NV_FREETYPE_APIENTRY *FT_Glyph_Copy) (  FT_Glyph source, FT_Glyph *target  ) = nullptr;
-FT_Error (NV_FREETYPE_APIENTRY *FT_Glyph_Transform) (  FT_Glyph glyph, FT_Matrix* matrix, FT_Vector* delta  ) = nullptr;
-void (NV_FREETYPE_APIENTRY *FT_Glyph_Get_CBox) (  FT_Glyph glyph, FT_UInt bbox_mode, FT_BBox  *acbox  ) = nullptr;
-FT_Error (NV_FREETYPE_APIENTRY *FT_Glyph_To_Bitmap) (  FT_Glyph* the_glyph, FT_Render_Mode render_mode, FT_Vector* origin, FT_Bool destroy  ) = nullptr;
-void (NV_FREETYPE_APIENTRY *FT_Done_Glyph) (  FT_Glyph  glyph  ) = nullptr;
-void (NV_FREETYPE_APIENTRY *FT_Matrix_Multiply) (  const FT_Matrix*  a, FT_Matrix*        b  ) = nullptr;
-FT_Error (NV_FREETYPE_APIENTRY *FT_Matrix_Invert) (  FT_Matrix*  matrix  ) = nullptr;
-FT_Renderer (NV_FREETYPE_APIENTRY *FT_Get_Renderer) (  FT_Library library, FT_Glyph_Format format  ) = nullptr;
-FT_Error (NV_FREETYPE_APIENTRY *FT_Set_Renderer) (  FT_Library library, FT_Renderer renderer, FT_UInt num_params, FT_Parameter* parameters  ) = nullptr;
-FT_Error (NV_FREETYPE_APIENTRY *FT_Add_Module) (  FT_Library library, const FT_Module_Class*  clazz  ) = nullptr;
-FT_Module (NV_FREETYPE_APIENTRY *FT_Get_Module) (  FT_Library library, const char*  module_name  ) = nullptr;
-FT_Error (NV_FREETYPE_APIENTRY *FT_Remove_Module) (  FT_Library  library, FT_Module   module  ) = nullptr;
-FT_Error (NV_FREETYPE_APIENTRY *FT_Reference_Library) (  FT_Library  library  ) = nullptr;
-FT_Error (NV_FREETYPE_APIENTRY *FT_New_Library) (  FT_Memory memory, FT_Library  *alibrary  ) = nullptr;
-FT_Error (NV_FREETYPE_APIENTRY *FT_Done_Library) (  FT_Library  library  ) = nullptr;
-void (NV_FREETYPE_APIENTRY *FT_Set_Debug_Hook) (  FT_Library library, FT_UInt hook_index, FT_DebugHook_Func  debug_hook  ) = nullptr;
-void (NV_FREETYPE_APIENTRY *FT_Add_Default_Modules) (  FT_Library  library  ) = nullptr;
-FT_TrueTypeEngineType (NV_FREETYPE_APIENTRY *FT_Get_TrueType_Engine_Type) (  FT_Library  library  ) = nullptr;
-FT_Error (NV_FREETYPE_APIENTRY *FT_Get_Advance) (  FT_Face face, FT_UInt gindex, FT_Int32 load_flags, FT_Fixed *padvance  ) = nullptr;
-FT_Error (NV_FREETYPE_APIENTRY *FT_Get_Advances) (  FT_Face face, FT_UInt start, FT_UInt count, FT_Int32 load_flags, FT_Fixed *padvances  ) = nullptr; 
-FT_Error (NV_FREETYPE_APIENTRY *FT_Outline_Decompose) (  FT_Outline* outline, const FT_Outline_Funcs*  func_interface, void* user  ) = nullptr;
-FT_Error (NV_FREETYPE_APIENTRY *FT_Outline_New) (  FT_Library library, FT_UInt numPoints, FT_Int numContours, FT_Outline  *anoutline  ) = nullptr;
-FT_Error (NV_FREETYPE_APIENTRY *FT_Outline_New_Internal) (  FT_Memory memory, FT_UInt numPoints, FT_Int numContours, FT_Outline  *anoutline  ) = nullptr;
-FT_Error (NV_FREETYPE_APIENTRY *FT_Outline_Done) (  FT_Library library, FT_Outline*  outline  ) = nullptr;
-FT_Error (NV_FREETYPE_APIENTRY *FT_Outline_Done_Internal) (  FT_Memory memory, FT_Outline* outline  ) = nullptr;
-FT_Error (NV_FREETYPE_APIENTRY *FT_Outline_Check) (  FT_Outline*  outline  ) = nullptr;
-void (NV_FREETYPE_APIENTRY *FT_Outline_Get_CBox) (  const FT_Outline* outline, FT_BBox *acbox  ) = nullptr;
-void (NV_FREETYPE_APIENTRY *FT_Outline_Translate) (  const FT_Outline* outline, FT_Pos xOffset, FT_Pos yOffset  ) = nullptr;
-FT_Error (NV_FREETYPE_APIENTRY *FT_Outline_Copy) (  const FT_Outline* source, FT_Outline *target  ) = nullptr;
-void (NV_FREETYPE_APIENTRY *FT_Outline_Transform) (  const FT_Outline* outline, const FT_Matrix* matrix  ) = nullptr;
-FT_Error (NV_FREETYPE_APIENTRY *FT_Outline_Embolden) (  FT_Outline* outline, FT_Pos strength  ) = nullptr;
-void (NV_FREETYPE_APIENTRY *FT_Outline_Reverse) (  FT_Outline*  outline  ) = nullptr;
-FT_Error (NV_FREETYPE_APIENTRY *FT_Outline_Get_Bitmap) (  FT_Library library, FT_Outline* outline, const FT_Bitmap *abitmap  ) = nullptr;
-FT_Error (NV_FREETYPE_APIENTRY *FT_Outline_Render) (  FT_Library library, FT_Outline* outline, FT_Raster_Params* params  ) = nullptr;
-FT_Orientation (NV_FREETYPE_APIENTRY *FT_Outline_Get_Orientation) (  FT_Outline*  outline  ) = nullptr;
-FT_Error (NV_FREETYPE_APIENTRY *FT_Outline_Get_BBox) (  FT_Outline* outline, FT_BBox *abbox  ) = nullptr;
-void (NV_FREETYPE_APIENTRY *FT_Bitmap_New) (  FT_Bitmap  *abitmap  ) = nullptr;
-FT_Error (NV_FREETYPE_APIENTRY *FT_Bitmap_Copy) (  FT_Library library, const FT_Bitmap *source, FT_Bitmap *target  ) = nullptr;
-FT_Error (NV_FREETYPE_APIENTRY *FT_Bitmap_Embolden) (  FT_Library library, FT_Bitmap* bitmap, FT_Pos xStrength, FT_Pos yStrength  ) = nullptr;
-FT_Error (NV_FREETYPE_APIENTRY *FT_Bitmap_Convert) (  FT_Library library, const FT_Bitmap *source, FT_Bitmap *target, FT_Int alignment  ) = nullptr;
-FT_Error (NV_FREETYPE_APIENTRY *FT_GlyphSlot_Own_Bitmap) (  FT_GlyphSlot  slot  ) = nullptr;
-FT_Error (NV_FREETYPE_APIENTRY *FT_Bitmap_Done) (  FT_Library library, FT_Bitmap *bitmap  ) = nullptr;
-FT_Error (NV_FREETYPE_APIENTRY *FT_Get_BDF_Charset_ID) (  FT_Face face, const char* *acharset_encoding, const char* *acharset_registry  ) = nullptr;
-FT_Error (NV_FREETYPE_APIENTRY *FT_Get_BDF_Property) (  FT_Face face, const char* prop_name, BDF_PropertyRec *aproperty  ) = nullptr;
-FT_Error (NV_FREETYPE_APIENTRY *FT_Get_CID_Registry_Ordering_Supplement) (  FT_Face face, const char* *registry, const char* *ordering, FT_Int *supplement  ) = nullptr;
-FT_Error (NV_FREETYPE_APIENTRY *FT_Get_CID_Is_Internally_CID_Keyed) (  FT_Face face, FT_Bool *is_cid  ) = nullptr;
-FT_Error (NV_FREETYPE_APIENTRY *FT_Get_CID_From_Glyph_Index) (  FT_Face face, FT_UInt glyph_index, FT_UInt *cid  ) = nullptr;
-FT_Error (NV_FREETYPE_APIENTRY *FT_Get_PFR_Metrics) (  FT_Face face, FT_UInt *aoutline_resolution, FT_UInt   *ametrics_resolution, FT_Fixed  *ametrics_x_scale, FT_Fixed  *ametrics_y_scale  ) = nullptr;
-FT_Error (NV_FREETYPE_APIENTRY *FT_Get_PFR_Kerning) (  FT_Face face, FT_UInt left, FT_UInt right, FT_Vector  *avector  ) = nullptr;
-FT_Error (NV_FREETYPE_APIENTRY *FT_Get_PFR_Advance) (  FT_Face face, FT_UInt gindex, FT_Pos *aadvance  ) = nullptr;
-FT_Int (NV_FREETYPE_APIENTRY *FT_Get_Gasp) (  FT_Face face, FT_UInt ppem  ) = nullptr; 
-FT_Error (NV_FREETYPE_APIENTRY *FT_New_Size) (  FT_Face face, FT_Size* size  ) = nullptr;
-FT_Error (NV_FREETYPE_APIENTRY *FT_Done_Size) (  FT_Size size  ) = nullptr;
-FT_Error (NV_FREETYPE_APIENTRY *FT_Activate_Size) (  FT_Size  size  ) = nullptr;
-FT_UInt (NV_FREETYPE_APIENTRY *FT_Get_Sfnt_Name_Count) (  FT_Face  face  ) = nullptr; 
-FT_Error (NV_FREETYPE_APIENTRY *FT_Get_Sfnt_Name) (  FT_Face face, FT_UInt idx, FT_SfntName  *aname  ) = nullptr;
-
-FT_StrokerBorder (NV_FREETYPE_APIENTRY *FT_Outline_GetInsideBorder) (  FT_Outline* outline  ) = nullptr;
-FT_StrokerBorder (NV_FREETYPE_APIENTRY *FT_Outline_GetOutsideBorder) (  FT_Outline* outline  ) = nullptr;
-FT_Error (NV_FREETYPE_APIENTRY *FT_Stroker_New) (  FT_Library library, FT_Stroker *astroker  ) = nullptr;
-void (NV_FREETYPE_APIENTRY *FT_Stroker_Set) (  FT_Stroker stroker, FT_Fixed radius, FT_Stroker_LineCap line_cap, FT_Stroker_LineJoin line_join, FT_Fixed miter_limit  ) = nullptr;
-void (NV_FREETYPE_APIENTRY *FT_Stroker_Rewind) (  FT_Stroker stroker  ) = nullptr;
-FT_Error (NV_FREETYPE_APIENTRY *FT_Stroker_ParseOutline) (  FT_Stroker stroker, FT_Outline* outline, FT_Bool opened  ) = nullptr;
-FT_Error (NV_FREETYPE_APIENTRY *FT_Stroker_BeginSubPath) (  FT_Stroker stroker, FT_Vector* to, FT_Bool open  ) = nullptr;
-FT_Error (NV_FREETYPE_APIENTRY *FT_Stroker_EndSubPath) (  FT_Stroker stroker  ) = nullptr;
-FT_Error (NV_FREETYPE_APIENTRY *FT_Stroker_LineTo) (  FT_Stroker stroker, FT_Vector* to  ) = nullptr;
-FT_Error (NV_FREETYPE_APIENTRY *FT_Stroker_ConicTo) (  FT_Stroker stroker, FT_Vector* control, FT_Vector* to  ) = nullptr;
-FT_Error (NV_FREETYPE_APIENTRY *FT_Stroker_CubicTo) (  FT_Stroker stroker, FT_Vector* control1, FT_Vector* control2, FT_Vector* to  ) = nullptr;
-FT_Error (NV_FREETYPE_APIENTRY *FT_Stroker_GetBorderCounts) (  FT_Stroker stroker, FT_StrokerBorder border, FT_UInt *anum_points, FT_UInt *anum_contours  ) = nullptr;
-void (NV_FREETYPE_APIENTRY *FT_Stroker_ExportBorder) (  FT_Stroker stroker, FT_StrokerBorder border, FT_Outline* outline  ) = nullptr;
-FT_Error (NV_FREETYPE_APIENTRY *FT_Stroker_GetCounts) (  FT_Stroker stroker, FT_UInt *anum_points, FT_UInt *anum_contours  ) = nullptr;
-void (NV_FREETYPE_APIENTRY *FT_Stroker_Export) (  FT_Stroker stroker, FT_Outline* outline  ) = nullptr;
-void (NV_FREETYPE_APIENTRY *FT_Stroker_Done) (  FT_Stroker stroker  ) = nullptr;
-FT_Error (NV_FREETYPE_APIENTRY *FT_Glyph_Stroke) (  FT_Glyph *pglyph, FT_Stroker stroker, FT_Bool destroy  ) = nullptr;
-FT_Error (NV_FREETYPE_APIENTRY *FT_Glyph_StrokeBorder) (  FT_Glyph *pglyph, FT_Stroker stroker, FT_Bool inside, FT_Bool destroy  ) = nullptr;
-
-FT_Fixed (NV_FREETYPE_APIENTRY *FT_Sin) (  FT_Angle angle  ) = nullptr;
-FT_Fixed (NV_FREETYPE_APIENTRY *FT_Cos) (  FT_Angle angle  ) = nullptr;
-FT_Fixed (NV_FREETYPE_APIENTRY *FT_Tan) (  FT_Angle angle  ) = nullptr;
-FT_Angle (NV_FREETYPE_APIENTRY *FT_Atan2) (  FT_Fixed x, FT_Fixed  y  ) = nullptr;
-FT_Angle (NV_FREETYPE_APIENTRY *FT_Angle_Diff) (  FT_Angle angle1, FT_Angle  angle2  ) = nullptr;
-void (NV_FREETYPE_APIENTRY *FT_Vector_Unit) (  FT_Vector* vec, FT_Angle angle  ) = nullptr;
-void (NV_FREETYPE_APIENTRY *FT_Vector_Rotate) (  FT_Vector* vec, FT_Angle angle  ) = nullptr;
-FT_Fixed (NV_FREETYPE_APIENTRY *FT_Vector_Length) (  FT_Vector* vec  ) = nullptr;
-void (NV_FREETYPE_APIENTRY *FT_Vector_Polarize) (  FT_Vector* vec, FT_Fixed *length, FT_Angle *angle  ) = nullptr;
-void (NV_FREETYPE_APIENTRY *FT_Vector_From_Polar) (  FT_Vector* vec, FT_Fixed length, FT_Angle angle  ) = nullptr;
-
-FT_Error (NV_FREETYPE_APIENTRY *FT_Library_SetLcdFilter) ( FT_Library library, FT_LcdFilter  filter ) = nullptr;
-FT_Error (NV_FREETYPE_APIENTRY *FT_Library_SetLcdFilterWeights) ( FT_Library library, unsigned char *weights ) = nullptr;
-
+#define NV_FREETYPE_FUN( rtype, fname, fparams ) rtype (*fname) fparams = nullptr;
+#include <nv/lib/detail/freetype2_functions.inc>
+#undef NV_FREETYPE_FUN
 
 bool nv::load_freetype_library( const char* path )
 {
-#	define NV_FREETYPE_LOAD( symbol ) *(void **) (&symbol) = freetype_library.get(#symbol);
 	static nv::library freetype_library;
 	if ( freetype_library.is_open() ) return true;
 	freetype_library.open( path );
 
-	NV_FREETYPE_LOAD( FT_Init_FreeType );
-	NV_FREETYPE_LOAD( FT_Done_FreeType );
-	NV_FREETYPE_LOAD( FT_New_Face );
-	NV_FREETYPE_LOAD( FT_New_Memory_Face );
-	NV_FREETYPE_LOAD( FT_Open_Face );
-	NV_FREETYPE_LOAD( FT_Attach_File );
-	NV_FREETYPE_LOAD( FT_Attach_Stream );
-	NV_FREETYPE_LOAD( FT_Reference_Face );
-	NV_FREETYPE_LOAD( FT_Done_Face );
-	NV_FREETYPE_LOAD( FT_Select_Size );
-	NV_FREETYPE_LOAD( FT_Request_Size );
-	NV_FREETYPE_LOAD( FT_Set_Char_Size );
-	NV_FREETYPE_LOAD( FT_Set_Pixel_Sizes );
-	NV_FREETYPE_LOAD( FT_Load_Glyph );
-	NV_FREETYPE_LOAD( FT_Load_Char );
-	NV_FREETYPE_LOAD( FT_Set_Transform );
-	NV_FREETYPE_LOAD( FT_Render_Glyph );
-	NV_FREETYPE_LOAD( FT_Get_Kerning );
-	NV_FREETYPE_LOAD( FT_Get_Track_Kerning );
-	NV_FREETYPE_LOAD( FT_Get_Glyph_Name );
-	NV_FREETYPE_LOAD( FT_Get_Postscript_Name );
-	NV_FREETYPE_LOAD( FT_Select_Charmap );
-	NV_FREETYPE_LOAD( FT_Set_Charmap );
-	NV_FREETYPE_LOAD( FT_Get_Charmap_Index );
-	NV_FREETYPE_LOAD( FT_Get_Char_Index );
-	NV_FREETYPE_LOAD( FT_Get_First_Char );
-	NV_FREETYPE_LOAD( FT_Get_Next_Char );
-	NV_FREETYPE_LOAD( FT_Get_Name_Index );
-	NV_FREETYPE_LOAD( FT_Get_SubGlyph_Info );
-	NV_FREETYPE_LOAD( FT_Get_FSType_Flags );
-	NV_FREETYPE_LOAD( FT_Face_GetCharVariantIndex );
-	NV_FREETYPE_LOAD( FT_Face_GetCharVariantIsDefault );
-	NV_FREETYPE_LOAD( FT_Face_GetVariantSelectors );
-	NV_FREETYPE_LOAD( FT_Face_GetVariantsOfChar );
-	NV_FREETYPE_LOAD( FT_Face_GetCharsOfVariant );
-	NV_FREETYPE_LOAD( FT_MulFix );
-	NV_FREETYPE_LOAD( FT_DivFix );
-	NV_FREETYPE_LOAD( FT_RoundFix );
-	NV_FREETYPE_LOAD( FT_CeilFix );
-	NV_FREETYPE_LOAD( FT_FloorFix );
-	NV_FREETYPE_LOAD( FT_Vector_Transform );
-	NV_FREETYPE_LOAD( FT_Library_Version ); 
-	NV_FREETYPE_LOAD( FT_Get_Glyph );
-	NV_FREETYPE_LOAD( FT_Glyph_Copy );
-	NV_FREETYPE_LOAD( FT_Glyph_Transform );
-	NV_FREETYPE_LOAD( FT_Glyph_Get_CBox );
-	NV_FREETYPE_LOAD( FT_Glyph_To_Bitmap );
-	NV_FREETYPE_LOAD( FT_Done_Glyph );
-	NV_FREETYPE_LOAD( FT_Matrix_Multiply );
-	NV_FREETYPE_LOAD( FT_Matrix_Invert );
-	NV_FREETYPE_LOAD( FT_Get_Renderer );
-	NV_FREETYPE_LOAD( FT_Set_Renderer );
-	NV_FREETYPE_LOAD( FT_Add_Module );
-	NV_FREETYPE_LOAD( FT_Get_Module );
-	NV_FREETYPE_LOAD( FT_Remove_Module );
-	NV_FREETYPE_LOAD( FT_Reference_Library );
-	NV_FREETYPE_LOAD( FT_New_Library );
-	NV_FREETYPE_LOAD( FT_Done_Library );
-	NV_FREETYPE_LOAD( FT_Set_Debug_Hook );
-	NV_FREETYPE_LOAD( FT_Add_Default_Modules );
-	NV_FREETYPE_LOAD( FT_Get_TrueType_Engine_Type );
-	NV_FREETYPE_LOAD( FT_Get_Advance );
-	NV_FREETYPE_LOAD( FT_Get_Advances ); 
-	NV_FREETYPE_LOAD( FT_Outline_Decompose );
-	NV_FREETYPE_LOAD( FT_Outline_New );
-	NV_FREETYPE_LOAD( FT_Outline_New_Internal );
-	NV_FREETYPE_LOAD( FT_Outline_Done );
-	NV_FREETYPE_LOAD( FT_Outline_Done_Internal );
-	NV_FREETYPE_LOAD( FT_Outline_Check );
-	NV_FREETYPE_LOAD( FT_Outline_Get_CBox );
-	NV_FREETYPE_LOAD( FT_Outline_Translate );
-	NV_FREETYPE_LOAD( FT_Outline_Copy );
-	NV_FREETYPE_LOAD( FT_Outline_Transform );
-	NV_FREETYPE_LOAD( FT_Outline_Embolden );
-	NV_FREETYPE_LOAD( FT_Outline_Reverse );
-	NV_FREETYPE_LOAD( FT_Outline_Get_Bitmap );
-	NV_FREETYPE_LOAD( FT_Outline_Render );
-	NV_FREETYPE_LOAD( FT_Outline_Get_Orientation );
-	NV_FREETYPE_LOAD( FT_Outline_Get_BBox );
-	NV_FREETYPE_LOAD( FT_Bitmap_New );
-	NV_FREETYPE_LOAD( FT_Bitmap_Copy );
-	NV_FREETYPE_LOAD( FT_Bitmap_Embolden );
-	NV_FREETYPE_LOAD( FT_Bitmap_Convert );
-	NV_FREETYPE_LOAD( FT_GlyphSlot_Own_Bitmap );
-	NV_FREETYPE_LOAD( FT_Bitmap_Done );
-	NV_FREETYPE_LOAD( FT_Get_BDF_Charset_ID );
-	NV_FREETYPE_LOAD( FT_Get_BDF_Property );
-	NV_FREETYPE_LOAD( FT_Get_CID_Registry_Ordering_Supplement );
-	NV_FREETYPE_LOAD( FT_Get_CID_Is_Internally_CID_Keyed );
-	NV_FREETYPE_LOAD( FT_Get_CID_From_Glyph_Index );
-	NV_FREETYPE_LOAD( FT_Get_PFR_Metrics );
-	NV_FREETYPE_LOAD( FT_Get_PFR_Kerning );
-	NV_FREETYPE_LOAD( FT_Get_PFR_Advance );
-	NV_FREETYPE_LOAD( FT_Get_Gasp ); 
-	NV_FREETYPE_LOAD( FT_New_Size );
-	NV_FREETYPE_LOAD( FT_Done_Size );
-	NV_FREETYPE_LOAD( FT_Activate_Size );
-	NV_FREETYPE_LOAD( FT_Get_Sfnt_Name_Count ); 
-	NV_FREETYPE_LOAD( FT_Get_Sfnt_Name );
-
-	NV_FREETYPE_LOAD( FT_Outline_GetInsideBorder );
-	NV_FREETYPE_LOAD( FT_Outline_GetOutsideBorder );
-	NV_FREETYPE_LOAD( FT_Stroker_New );
-	NV_FREETYPE_LOAD( FT_Stroker_Set );
-	NV_FREETYPE_LOAD( FT_Stroker_Rewind );
-	NV_FREETYPE_LOAD( FT_Stroker_ParseOutline );
-	NV_FREETYPE_LOAD( FT_Stroker_BeginSubPath );
-	NV_FREETYPE_LOAD( FT_Stroker_EndSubPath );
-	NV_FREETYPE_LOAD( FT_Stroker_LineTo );
-	NV_FREETYPE_LOAD( FT_Stroker_ConicTo );
-	NV_FREETYPE_LOAD( FT_Stroker_CubicTo );
-	NV_FREETYPE_LOAD( FT_Stroker_GetBorderCounts );
-	NV_FREETYPE_LOAD( FT_Stroker_ExportBorder );
-	NV_FREETYPE_LOAD( FT_Stroker_GetCounts );
-	NV_FREETYPE_LOAD( FT_Stroker_Export );
-	NV_FREETYPE_LOAD( FT_Stroker_Done );
-	NV_FREETYPE_LOAD( FT_Glyph_Stroke );
-	NV_FREETYPE_LOAD( FT_Glyph_StrokeBorder );
-
-	NV_FREETYPE_LOAD( FT_Sin );
-	NV_FREETYPE_LOAD( FT_Cos );
-	NV_FREETYPE_LOAD( FT_Tan );
-	NV_FREETYPE_LOAD( FT_Atan2 );
-	NV_FREETYPE_LOAD( FT_Angle_Diff );
-	NV_FREETYPE_LOAD( FT_Vector_Unit );
-	NV_FREETYPE_LOAD( FT_Vector_Rotate );
-	NV_FREETYPE_LOAD( FT_Vector_Length );
-	NV_FREETYPE_LOAD( FT_Vector_Polarize );
-	NV_FREETYPE_LOAD( FT_Vector_From_Polar );
-	NV_FREETYPE_LOAD( FT_Library_SetLcdFilter );
-	NV_FREETYPE_LOAD( FT_Library_SetLcdFilterWeights );
-
-#	undef NV_FREETYPE_LOAD
+#	define NV_FREETYPE_FUN( rtype, fname, fparams ) *(void **) (&fname) = freetype_library.get(#fname);
+#	include <nv/lib/detail/freetype2_functions.inc>
+#	undef NV_FREETYPE_FUN
 	return true;
 }
Index: trunk/src/lib/gl.cc
===================================================================
--- trunk/src/lib/gl.cc	(revision 166)
+++ trunk/src/lib/gl.cc	(revision 167)
@@ -16,184 +16,9 @@
 #endif
 
-/* OpenGL 1.1 non-deprecated functions */
-void (NV_GL_APIENTRY *glCullFace) ( GLenum ) = nullptr;
-void (NV_GL_APIENTRY *glFrontFace) ( GLenum ) = nullptr;
-void (NV_GL_APIENTRY *glHint) ( GLenum, GLenum ) = nullptr;
-void (NV_GL_APIENTRY *glLineWidth) ( GLfloat ) = nullptr;
-void (NV_GL_APIENTRY *glPointSize) ( GLfloat ) = nullptr;
-void (NV_GL_APIENTRY *glPolygonMode) ( GLenum, GLenum ) = nullptr;
-void (NV_GL_APIENTRY *glScissor) ( GLint , GLint , GLsizei , GLsizei ) = nullptr;
-void (NV_GL_APIENTRY *glTexParameterf) ( GLenum , GLenum , GLfloat ) = nullptr;
-void (NV_GL_APIENTRY *glTexParameterfv) ( GLenum , GLenum , const GLfloat *) = nullptr;
-void (NV_GL_APIENTRY *glTexParameteri) ( GLenum , GLenum , GLint ) = nullptr;
-void (NV_GL_APIENTRY *glTexParameteriv) ( GLenum , GLenum , const GLint *) = nullptr;
-void (NV_GL_APIENTRY *glTexImage1D) ( GLenum , GLint , GLint , GLsizei , GLint , GLenum , GLenum , const GLvoid *) = nullptr;
-void (NV_GL_APIENTRY *glTexImage2D) ( GLenum , GLint , GLint , GLsizei , GLsizei , GLint , GLenum , GLenum , const GLvoid *) = nullptr;
-void (NV_GL_APIENTRY *glDrawBuffer) ( GLenum ) = nullptr;
-void (NV_GL_APIENTRY *glClear) ( GLbitfield ) = nullptr;
-void (NV_GL_APIENTRY *glClearColor) ( GLfloat , GLfloat , GLfloat , GLfloat ) = nullptr;
-void (NV_GL_APIENTRY *glClearStencil) ( GLint ) = nullptr;
-void (NV_GL_APIENTRY *glClearDepth) ( GLdouble ) = nullptr;
-void (NV_GL_APIENTRY *glStencilMask) ( GLuint ) = nullptr;
-void (NV_GL_APIENTRY *glColorMask) ( GLboolean , GLboolean , GLboolean , GLboolean ) = nullptr;
-void (NV_GL_APIENTRY *glDepthMask) ( GLboolean ) = nullptr;
-void (NV_GL_APIENTRY *glDisable) ( GLenum ) = nullptr;
-void (NV_GL_APIENTRY *glEnable) ( GLenum ) = nullptr;
-void (NV_GL_APIENTRY *glFinish) ( void ) = nullptr;
-void (NV_GL_APIENTRY *glFlush) ( void ) = nullptr;
-void (NV_GL_APIENTRY *glBlendFunc) ( GLenum, GLenum ) = nullptr;
-void (NV_GL_APIENTRY *glLogicOp) ( GLenum ) = nullptr;
-void (NV_GL_APIENTRY *glStencilFunc) ( GLenum , GLint , GLuint ) = nullptr;
-void (NV_GL_APIENTRY *glStencilOp) ( GLenum , GLenum , GLenum ) = nullptr;
-void (NV_GL_APIENTRY *glDepthFunc) ( GLenum ) = nullptr;
-void (NV_GL_APIENTRY *glPixelStoref) ( GLenum , GLfloat ) = nullptr;
-void (NV_GL_APIENTRY *glPixelStorei) ( GLenum , GLint ) = nullptr;
-void (NV_GL_APIENTRY *glReadBuffer) ( GLenum ) = nullptr;
-void (NV_GL_APIENTRY *glReadPixels) ( GLint , GLint , GLsizei , GLsizei , GLenum , GLenum , GLvoid *) = nullptr;
-void (NV_GL_APIENTRY *glGetBooleanv) ( GLenum , GLboolean *) = nullptr;
-void (NV_GL_APIENTRY *glGetDoublev) ( GLenum , GLdouble *) = nullptr;
-GLenum (NV_GL_APIENTRY *glGetError) ( void ) = nullptr;
-void (NV_GL_APIENTRY *glGetFloatv) ( GLenum , GLfloat *) = nullptr;
-void (NV_GL_APIENTRY *glGetIntegerv) ( GLenum , GLint *) = nullptr;
-const GLubyte * (NV_GL_APIENTRY *glGetString) ( GLenum ) = nullptr;
-void (NV_GL_APIENTRY *glGetTexImage) ( GLenum , GLint , GLenum , GLenum , GLvoid *) = nullptr;
-void (NV_GL_APIENTRY *glGetTexParameterfv) ( GLenum , GLenum , GLfloat *) = nullptr;
-void (NV_GL_APIENTRY *glGetTexParameteriv) ( GLenum , GLenum , GLint *) = nullptr;
-void (NV_GL_APIENTRY *glGetTexLevelParameterfv) ( GLenum , GLint , GLenum , GLfloat *) = nullptr;
-void (NV_GL_APIENTRY *glGetTexLevelParameteriv) ( GLenum , GLint , GLenum , GLint *) = nullptr;
-GLboolean (NV_GL_APIENTRY *glIsEnabled) ( GLenum ) = nullptr;
-void (NV_GL_APIENTRY *glDepthRange) ( GLdouble , GLdouble ) = nullptr;
-void (NV_GL_APIENTRY *glViewport) ( GLint , GLint , GLsizei , GLsizei ) = nullptr;
-void (NV_GL_APIENTRY *glDrawArrays) ( GLenum , GLint , GLsizei ) = nullptr;
-void (NV_GL_APIENTRY *glDrawElements) ( GLenum , GLsizei , GLenum , const GLvoid *) = nullptr;
-void (NV_GL_APIENTRY *glGetPointerv) ( GLenum , GLvoid* *) = nullptr;
-void (NV_GL_APIENTRY *glPolygonOffset) ( GLfloat , GLfloat ) = nullptr;
-void (NV_GL_APIENTRY *glCopyTexImage1D) ( GLenum , GLint , GLenum , GLint , GLint , GLsizei , GLint ) = nullptr;
-void (NV_GL_APIENTRY *glCopyTexImage2D) ( GLenum , GLint , GLenum , GLint , GLint , GLsizei , GLsizei , GLint ) = nullptr;
-void (NV_GL_APIENTRY *glCopyTexSubImage1D) ( GLenum , GLint , GLint , GLint , GLint , GLsizei ) = nullptr;
-void (NV_GL_APIENTRY *glCopyTexSubImage2D) ( GLenum , GLint , GLint , GLint , GLint , GLint , GLsizei , GLsizei ) = nullptr;
-void (NV_GL_APIENTRY *glTexSubImage1D) ( GLenum , GLint , GLint , GLsizei , GLenum , GLenum , const GLvoid *) = nullptr;
-void (NV_GL_APIENTRY *glTexSubImage2D) ( GLenum , GLint , GLint , GLsizei , GLenum , GLenum , const GLvoid *) = nullptr;
-void (NV_GL_APIENTRY *glBindTexture) ( GLenum , GLuint ) = nullptr;
-void (NV_GL_APIENTRY *glDeleteTextures) ( GLsizei , const GLuint *) = nullptr;
-void (NV_GL_APIENTRY *glGenTextures) ( GLsizei , GLuint *) = nullptr;
-GLboolean (NV_GL_APIENTRY *glIsTexture) ( GLuint ) = nullptr;
-void (NV_GL_APIENTRY *glIndexub) ( GLubyte ) = nullptr;
-void (NV_GL_APIENTRY *glIndexubv) ( const GLubyte *) = nullptr;
-
-/* OpenGL 1.2 non-deprecated functions */
-void (NV_GL_APIENTRY *glBlendColor) ( GLfloat , GLfloat , GLfloat , GLfloat ) = nullptr;
-void (NV_GL_APIENTRY *glBlendEquation) ( GLenum ) = nullptr;
-void (NV_GL_APIENTRY *glDrawRangeElements) ( GLenum , GLuint , GLuint , GLsizei , GLenum , const GLvoid *) = nullptr;
-void (NV_GL_APIENTRY *glTexSubImage3D) ( GLenum , GLint , GLint , GLint , GLint , GLsizei , GLsizei , GLsizei , GLenum , GLenum , const GLvoid *) = nullptr;
-void (NV_GL_APIENTRY *glCopyTexSubImage3D) ( GLenum , GLint , GLint , GLint , GLint , GLint , GLint , GLsizei , GLsizei ) = nullptr;
-
-/* OpenGL 1.3 non-deprecated functions */
-void (NV_GL_APIENTRY *glActiveTexture) ( GLenum ) = nullptr;
-void (NV_GL_APIENTRY *glSampleCoverage) ( GLfloat , GLboolean ) = nullptr;
-void (NV_GL_APIENTRY *glCompressedTexImage3D) ( GLenum , GLint , GLenum , GLsizei , GLsizei , GLsizei , GLint , GLsizei , const GLvoid *) = nullptr;
-void (NV_GL_APIENTRY *glCompressedTexImage2D) ( GLenum , GLint , GLenum , GLsizei , GLsizei , GLint , GLsizei , const GLvoid *) = nullptr;
-void (NV_GL_APIENTRY *glCompressedTexImage1D) ( GLenum , GLint , GLenum , GLsizei , GLint , GLsizei , const GLvoid *) = nullptr;
-void (NV_GL_APIENTRY *glCompressedTexSubImage3D) ( GLenum , GLint , GLint , GLint , GLint , GLsizei , GLsizei , GLsizei , GLenum , GLsizei , const GLvoid *) = nullptr;
-void (NV_GL_APIENTRY *glCompressedTexSubImage2D) ( GLenum , GLint , GLint , GLint , GLsizei , GLsizei , GLenum , GLsizei , const GLvoid *) = nullptr;
-void (NV_GL_APIENTRY *glCompressedTexSubImage1D) ( GLenum , GLint , GLint , GLsizei , GLenum , GLsizei , const GLvoid *) = nullptr;
-void (NV_GL_APIENTRY *glGetCompressedTexImage) ( GLenum , GLint , GLvoid *) = nullptr;
-
-/* OpenGL 1.4 non-deprecated functions */
-void (NV_GL_APIENTRY *glBlendFuncSeparate) ( GLenum , GLenum , GLenum , GLenum ) = nullptr;
-void (NV_GL_APIENTRY *glMultiDrawArrays) ( GLenum , const GLint *, const GLsizei *, GLsizei ) = nullptr;
-void (NV_GL_APIENTRY *glMultiDrawElements) ( GLenum , const GLsizei *, GLenum , const GLvoid* const *, GLsizei ) = nullptr;
-void (NV_GL_APIENTRY *glPointParameterf) ( GLenum , GLfloat ) = nullptr;
-void (NV_GL_APIENTRY *glPointParameterfv) ( GLenum , const GLfloat *) = nullptr;
-void (NV_GL_APIENTRY *glPointParameteri) ( GLenum , GLint ) = nullptr;
-void (NV_GL_APIENTRY *glPointParameteriv) ( GLenum , const GLint *) = nullptr;
-
-/* OpenGL 1.5 non-deprecated functions */
-void (NV_GL_APIENTRY *glGenQueries) ( GLsizei , GLuint *) = nullptr;
-void (NV_GL_APIENTRY *glDeleteQueries) ( GLsizei , const GLuint *) = nullptr;
-GLboolean (NV_GL_APIENTRY *glIsQuery) ( GLuint ) = nullptr;
-void (NV_GL_APIENTRY *glBeginQuery) ( GLenum , GLuint ) = nullptr;
-void (NV_GL_APIENTRY *glEndQuery) ( GLenum ) = nullptr;
-void (NV_GL_APIENTRY *glGetQueryiv) ( GLenum , GLenum , GLint *) = nullptr;
-void (NV_GL_APIENTRY *glGetQueryObjectiv) ( GLuint , GLenum , GLint *) = nullptr;
-void (NV_GL_APIENTRY *glGetQueryObjectuiv) ( GLuint , GLenum , GLuint *) = nullptr;
-void (NV_GL_APIENTRY *glBindBuffer) ( GLenum , GLuint ) = nullptr;
-void (NV_GL_APIENTRY *glDeleteBuffers) ( GLsizei , const GLuint *) = nullptr;
-void (NV_GL_APIENTRY *glGenBuffers) ( GLsizei , GLuint *) = nullptr;
-GLboolean (NV_GL_APIENTRY *glIsBuffer) ( GLuint ) = nullptr;
-void (NV_GL_APIENTRY *glBufferData) ( GLenum , GLsizeiptr , const GLvoid *, GLenum ) = nullptr;
-void (NV_GL_APIENTRY *glBufferSubData) ( GLenum , GLintptr , GLsizeiptr , const GLvoid *) = nullptr;
-void (NV_GL_APIENTRY *glGetBufferSubData) ( GLenum , GLintptr , GLsizeiptr , GLvoid *) = nullptr;
-GLvoid* (NV_GL_APIENTRY *glMapBuffer) ( GLenum , GLenum ) = nullptr;
-GLboolean (NV_GL_APIENTRY *glUnmapBuffer) ( GLenum ) = nullptr;
-void (NV_GL_APIENTRY *glGetBufferParameteriv) ( GLenum , GLenum , GLint *) = nullptr;
-void (NV_GL_APIENTRY *glGetBufferPointerv) ( GLenum , GLenum , GLvoid* *) = nullptr;
-
-/* OpenGL 2.0 non-deprecated functions */
-void (NV_GL_APIENTRY *glBlendEquationSeparate) ( GLenum , GLenum ) = nullptr;
-void (NV_GL_APIENTRY *glDrawBuffers) ( GLsizei , const GLenum *) = nullptr;
-void (NV_GL_APIENTRY *glStencilOpSeparate) ( GLenum , GLenum , GLenum , GLenum ) = nullptr;
-void (NV_GL_APIENTRY *glStencilFuncSeparate) ( GLenum , GLenum , GLint , GLuint ) = nullptr;
-void (NV_GL_APIENTRY *glStencilMaskSeparate) ( GLenum , GLuint ) = nullptr;
-void (NV_GL_APIENTRY *glAttachShader) ( GLuint , GLuint ) = nullptr;
-void (NV_GL_APIENTRY *glBindAttribLocation) ( GLuint , GLuint , const GLchar *) = nullptr;
-void (NV_GL_APIENTRY *glCompileShader) ( GLuint ) = nullptr;
-GLuint (NV_GL_APIENTRY *glCreateProgram) ( void ) = nullptr;
-GLuint (NV_GL_APIENTRY *glCreateShader) ( GLenum ) = nullptr;
-void (NV_GL_APIENTRY *glDeleteProgram) ( GLuint ) = nullptr;
-void (NV_GL_APIENTRY *glDeleteShader) ( GLuint ) = nullptr;
-void (NV_GL_APIENTRY *glDetachShader) ( GLuint, GLuint ) = nullptr;
-void (NV_GL_APIENTRY *glDisableVertexAttribArray) ( GLuint ) = nullptr;
-void (NV_GL_APIENTRY *glEnableVertexAttribArray) ( GLuint ) = nullptr;
-void (NV_GL_APIENTRY *glGetActiveAttrib) ( GLuint , GLuint , GLsizei , GLsizei *, GLint *, GLenum *, GLchar *) = nullptr;
-void (NV_GL_APIENTRY *glGetActiveUniform) ( GLuint , GLuint , GLsizei , GLsizei *, GLint *, GLenum *, GLchar *) = nullptr;
-void (NV_GL_APIENTRY *glGetAttachedShaders) ( GLuint , GLsizei , GLsizei *, GLuint *) = nullptr;
-GLint (NV_GL_APIENTRY *glGetAttribLocation) ( GLuint , const GLchar *) = nullptr;
-void (NV_GL_APIENTRY *glGetProgramiv) ( GLuint , GLenum , GLint *) = nullptr;
-void (NV_GL_APIENTRY *glGetProgramInfoLog) ( GLuint , GLsizei , GLsizei *, GLchar *) = nullptr;
-void (NV_GL_APIENTRY *glGetShaderiv) ( GLuint , GLenum , GLint *) = nullptr;
-void (NV_GL_APIENTRY *glGetShaderInfoLog) ( GLuint , GLsizei , GLsizei *, GLchar *) = nullptr;
-void (NV_GL_APIENTRY *glGetShaderSource) ( GLuint , GLsizei , GLsizei *, GLchar *) = nullptr;
-GLint (NV_GL_APIENTRY *glGetUniformLocation) ( GLuint , const GLchar *) = nullptr;
-void (NV_GL_APIENTRY *glGetUniformfv) ( GLuint , GLint , GLfloat *) = nullptr;
-void (NV_GL_APIENTRY *glGetUniformiv) ( GLuint , GLint , GLint *) = nullptr;
-void (NV_GL_APIENTRY *glGetVertexAttribdv) ( GLuint , GLenum , GLdouble *) = nullptr;
-void (NV_GL_APIENTRY *glGetVertexAttribfv) ( GLuint , GLenum , GLfloat *) = nullptr;
-void (NV_GL_APIENTRY *glGetVertexAttribiv) ( GLuint , GLenum , GLint *) = nullptr;
-void (NV_GL_APIENTRY *glGetVertexAttribPointerv) ( GLuint , GLenum , GLvoid* *) = nullptr;
-GLboolean (NV_GL_APIENTRY *glIsProgram) ( GLuint ) = nullptr;
-GLboolean (NV_GL_APIENTRY *glIsShader) ( GLuint ) = nullptr;
-void (NV_GL_APIENTRY *glLinkProgram) ( GLuint ) = nullptr;
-void (NV_GL_APIENTRY *glShaderSource) ( GLuint , GLsizei , const GLchar* const *, const GLint *) = nullptr;
-void (NV_GL_APIENTRY *glUseProgram) ( GLuint ) = nullptr;
-void (NV_GL_APIENTRY *glUniform1f) ( GLint , GLfloat ) = nullptr;
-void (NV_GL_APIENTRY *glUniform2f) ( GLint , GLfloat , GLfloat ) = nullptr;
-void (NV_GL_APIENTRY *glUniform3f) ( GLint , GLfloat , GLfloat , GLfloat ) = nullptr;
-void (NV_GL_APIENTRY *glUniform4f) ( GLint , GLfloat , GLfloat , GLfloat , GLfloat ) = nullptr;
-void (NV_GL_APIENTRY *glUniform1i) ( GLint , GLint ) = nullptr;
-void (NV_GL_APIENTRY *glUniform2i) ( GLint , GLint , GLint ) = nullptr;
-void (NV_GL_APIENTRY *glUniform3i) ( GLint , GLint , GLint , GLint ) = nullptr;
-void (NV_GL_APIENTRY *glUniform4i) ( GLint , GLint , GLint , GLint , GLint ) = nullptr;
-void (NV_GL_APIENTRY *glUniform1fv) ( GLint , GLsizei , const GLfloat *) = nullptr;
-void (NV_GL_APIENTRY *glUniform2fv) ( GLint , GLsizei , const GLfloat *) = nullptr;
-void (NV_GL_APIENTRY *glUniform3fv) ( GLint , GLsizei , const GLfloat *) = nullptr;
-void (NV_GL_APIENTRY *glUniform4fv) ( GLint , GLsizei , const GLfloat *) = nullptr;
-void (NV_GL_APIENTRY *glUniform1iv) ( GLint , GLsizei , const GLint *) = nullptr;
-void (NV_GL_APIENTRY *glUniform2iv) ( GLint , GLsizei , const GLint *) = nullptr;
-void (NV_GL_APIENTRY *glUniform3iv) ( GLint , GLsizei , const GLint *) = nullptr;
-void (NV_GL_APIENTRY *glUniform4iv) ( GLint , GLsizei , const GLint *) = nullptr;
-void (NV_GL_APIENTRY *glUniformMatrix2fv) ( GLint , GLsizei , GLboolean , const GLfloat *) = nullptr;
-void (NV_GL_APIENTRY *glUniformMatrix3fv) ( GLint , GLsizei , GLboolean , const GLfloat *) = nullptr;
-void (NV_GL_APIENTRY *glUniformMatrix4fv) ( GLint , GLsizei , GLboolean , const GLfloat *) = nullptr;
-void (NV_GL_APIENTRY *glValidateProgram) ( GLuint ) = nullptr;
-void (NV_GL_APIENTRY *glVertexAttribPointer) ( GLuint , GLint , GLenum , GLboolean , GLsizei , const GLvoid *) = nullptr;
-
-/* OpenGL 2.1 non-deprecated functions */
-void (NV_GL_APIENTRY *glUniformMatrix2x3fv) ( GLint , GLsizei , GLboolean , const GLfloat *) = nullptr;
-void (NV_GL_APIENTRY *glUniformMatrix3x2fv) ( GLint , GLsizei , GLboolean , const GLfloat *) = nullptr;
-void (NV_GL_APIENTRY *glUniformMatrix2x4fv) ( GLint , GLsizei , GLboolean , const GLfloat *) = nullptr;
-void (NV_GL_APIENTRY *glUniformMatrix4x2fv) ( GLint , GLsizei , GLboolean , const GLfloat *) = nullptr;
-void (NV_GL_APIENTRY *glUniformMatrix3x4fv) ( GLint , GLsizei , GLboolean , const GLfloat *) = nullptr;
-void (NV_GL_APIENTRY *glUniformMatrix4x3fv) ( GLint , GLsizei , GLboolean , const GLfloat *) = nullptr;
+#define NV_GL_FUN( rtype, fname, fparams ) rtype (NV_GL_APIENTRY *fname) fparams = nullptr;
+#define NV_GL_FUN_EXT NV_GL_FUN
+#include <nv/lib/detail/gl_functions.inc>
+#undef NV_GL_FUN_EXT
+#undef NV_GL_FUN
 
 bool nv::load_gl_library( const char* path )
@@ -222,184 +47,9 @@
 #endif
 
-/* OpenGL 1.1 non-deprecated functions */
-	NV_GL_LOAD( glCullFace );
-	NV_GL_LOAD( glFrontFace );
-	NV_GL_LOAD( glHint );
-	NV_GL_LOAD( glLineWidth );
-	NV_GL_LOAD( glPointSize );
-	NV_GL_LOAD( glPolygonMode );
-	NV_GL_LOAD( glScissor );
-	NV_GL_LOAD( glTexParameterf );
-	NV_GL_LOAD( glTexParameterfv );
-	NV_GL_LOAD( glTexParameteri );
-	NV_GL_LOAD( glTexParameteriv );
-	NV_GL_LOAD( glTexImage1D );
-	NV_GL_LOAD( glTexImage2D );
-	NV_GL_LOAD( glDrawBuffer );
-	NV_GL_LOAD( glClear );
-	NV_GL_LOAD( glClearColor );
-	NV_GL_LOAD( glClearStencil );
-	NV_GL_LOAD( glClearDepth );
-	NV_GL_LOAD( glStencilMask );
-	NV_GL_LOAD( glColorMask );
-	NV_GL_LOAD( glDepthMask );
-	NV_GL_LOAD( glDisable );
-	NV_GL_LOAD( glEnable );
-	NV_GL_LOAD( glFinish );
-	NV_GL_LOAD( glFlush );
-	NV_GL_LOAD( glBlendFunc );
-	NV_GL_LOAD( glLogicOp );
-	NV_GL_LOAD( glStencilFunc );
-	NV_GL_LOAD( glStencilOp );
-	NV_GL_LOAD( glDepthFunc );
-	NV_GL_LOAD( glPixelStoref );
-	NV_GL_LOAD( glPixelStorei );
-	NV_GL_LOAD( glReadBuffer );
-	NV_GL_LOAD( glReadPixels );
-	NV_GL_LOAD( glGetBooleanv );
-	NV_GL_LOAD( glGetDoublev );
-	NV_GL_LOAD( glGetError );
-	NV_GL_LOAD( glGetFloatv );
-	NV_GL_LOAD( glGetIntegerv );
-	NV_GL_LOAD( glGetString );
-	NV_GL_LOAD( glGetTexImage );
-	NV_GL_LOAD( glGetTexParameterfv );
-	NV_GL_LOAD( glGetTexParameteriv );
-	NV_GL_LOAD( glGetTexLevelParameterfv );
-	NV_GL_LOAD( glGetTexLevelParameteriv );
-	NV_GL_LOAD( glIsEnabled );
-	NV_GL_LOAD( glDepthRange );
-	NV_GL_LOAD( glViewport );
-	NV_GL_LOAD( glDrawArrays );
-	NV_GL_LOAD( glDrawElements );
-	NV_GL_LOAD( glGetPointerv );
-	NV_GL_LOAD( glPolygonOffset );
-	NV_GL_LOAD( glCopyTexImage1D );
-	NV_GL_LOAD( glCopyTexImage2D );
-	NV_GL_LOAD( glCopyTexSubImage1D );
-	NV_GL_LOAD( glCopyTexSubImage2D );
-	NV_GL_LOAD( glTexSubImage1D );
-	NV_GL_LOAD( glTexSubImage2D );
-	NV_GL_LOAD( glBindTexture );
-	NV_GL_LOAD( glDeleteTextures );
-	NV_GL_LOAD( glGenTextures );
-	NV_GL_LOAD( glIsTexture );
-	NV_GL_LOAD( glIndexub );
-	NV_GL_LOAD( glIndexubv );
-
-/* OpenGL 1.2 non-deprecated functions */
-	NV_GL_LOAD_EXT( glBlendColor );
-	NV_GL_LOAD_EXT( glBlendEquation );
-	NV_GL_LOAD_EXT( glDrawRangeElements );
-	NV_GL_LOAD_EXT( glTexSubImage3D );
-	NV_GL_LOAD_EXT( glCopyTexSubImage3D );
-
-/* OpenGL 1.3 non-deprecated functions */
-	NV_GL_LOAD_EXT( glActiveTexture );
-	NV_GL_LOAD_EXT( glSampleCoverage );
-	NV_GL_LOAD_EXT( glCompressedTexImage3D );
-	NV_GL_LOAD_EXT( glCompressedTexImage2D );
-	NV_GL_LOAD_EXT( glCompressedTexImage1D );
-	NV_GL_LOAD_EXT( glCompressedTexSubImage3D );
-	NV_GL_LOAD_EXT( glCompressedTexSubImage2D );
-	NV_GL_LOAD_EXT( glCompressedTexSubImage1D );
-	NV_GL_LOAD_EXT( glGetCompressedTexImage );
-
-/* OpenGL 1.4 non-deprecated functions */
-	NV_GL_LOAD_EXT( glBlendFuncSeparate );
-	NV_GL_LOAD_EXT( glMultiDrawArrays );
-	NV_GL_LOAD_EXT( glMultiDrawElements );
-	NV_GL_LOAD_EXT( glPointParameterf );
-	NV_GL_LOAD_EXT( glPointParameterfv );
-	NV_GL_LOAD_EXT( glPointParameteri );
-	NV_GL_LOAD_EXT( glPointParameteriv );
-
-/* OpenGL 1.5 non-deprecated functions */
-	NV_GL_LOAD_EXT( glGenQueries );
-	NV_GL_LOAD_EXT( glDeleteQueries );
-	NV_GL_LOAD_EXT( glIsQuery );
-	NV_GL_LOAD_EXT( glBeginQuery );
-	NV_GL_LOAD_EXT( glEndQuery );
-	NV_GL_LOAD_EXT( glGetQueryiv );
-	NV_GL_LOAD_EXT( glGetQueryObjectiv );
-	NV_GL_LOAD_EXT( glGetQueryObjectuiv );
-	NV_GL_LOAD_EXT( glBindBuffer );
-	NV_GL_LOAD_EXT( glDeleteBuffers );
-	NV_GL_LOAD_EXT( glGenBuffers );
-	NV_GL_LOAD_EXT( glIsBuffer );
-	NV_GL_LOAD_EXT( glBufferData );
-	NV_GL_LOAD_EXT( glBufferSubData );
-	NV_GL_LOAD_EXT( glGetBufferSubData );
-	NV_GL_LOAD_EXT( glMapBuffer );
-	NV_GL_LOAD_EXT( glUnmapBuffer );
-	NV_GL_LOAD_EXT( glGetBufferParameteriv );
-	NV_GL_LOAD_EXT( glGetBufferPointerv );
-
-/* OpenGL 2.0 non-deprecated functions */
-	NV_GL_LOAD_EXT( glBlendEquationSeparate );
-	NV_GL_LOAD_EXT( glDrawBuffers );
-	NV_GL_LOAD_EXT( glStencilOpSeparate );
-	NV_GL_LOAD_EXT( glStencilFuncSeparate );
-	NV_GL_LOAD_EXT( glStencilMaskSeparate );
-	NV_GL_LOAD_EXT( glAttachShader );
-	NV_GL_LOAD_EXT( glBindAttribLocation );
-	NV_GL_LOAD_EXT( glCompileShader );
-	NV_GL_LOAD_EXT( glCreateProgram );
-	NV_GL_LOAD_EXT( glCreateShader );
-	NV_GL_LOAD_EXT( glDeleteProgram );
-	NV_GL_LOAD_EXT( glDeleteShader );
-	NV_GL_LOAD_EXT( glDetachShader );
-	NV_GL_LOAD_EXT( glDisableVertexAttribArray );
-	NV_GL_LOAD_EXT( glEnableVertexAttribArray );
-	NV_GL_LOAD_EXT( glGetActiveAttrib );
-	NV_GL_LOAD_EXT( glGetActiveUniform );
-	NV_GL_LOAD_EXT( glGetAttachedShaders );
-	NV_GL_LOAD_EXT( glGetAttribLocation );
-	NV_GL_LOAD_EXT( glGetProgramiv );
-	NV_GL_LOAD_EXT( glGetProgramInfoLog );
-	NV_GL_LOAD_EXT( glGetShaderiv );
-	NV_GL_LOAD_EXT( glGetShaderInfoLog );
-	NV_GL_LOAD_EXT( glGetShaderSource );
-	NV_GL_LOAD_EXT( glGetUniformLocation );
-	NV_GL_LOAD_EXT( glGetUniformfv );
-	NV_GL_LOAD_EXT( glGetUniformiv );
-	NV_GL_LOAD_EXT( glGetVertexAttribdv );
-	NV_GL_LOAD_EXT( glGetVertexAttribfv );
-	NV_GL_LOAD_EXT( glGetVertexAttribiv );
-	NV_GL_LOAD_EXT( glGetVertexAttribPointerv );
-	NV_GL_LOAD_EXT( glIsProgram );
-	NV_GL_LOAD_EXT( glIsShader );
-	NV_GL_LOAD_EXT( glLinkProgram );
-	NV_GL_LOAD_EXT( glShaderSource );
-	NV_GL_LOAD_EXT( glUseProgram );
-	NV_GL_LOAD_EXT( glUniform1f );
-	NV_GL_LOAD_EXT( glUniform2f );
-	NV_GL_LOAD_EXT( glUniform3f );
-	NV_GL_LOAD_EXT( glUniform4f );
-	NV_GL_LOAD_EXT( glUniform1i );
-	NV_GL_LOAD_EXT( glUniform2i );
-	NV_GL_LOAD_EXT( glUniform3i );
-	NV_GL_LOAD_EXT( glUniform4i );
-	NV_GL_LOAD_EXT( glUniform1fv );
-	NV_GL_LOAD_EXT( glUniform2fv );
-	NV_GL_LOAD_EXT( glUniform3fv );
-	NV_GL_LOAD_EXT( glUniform4fv );
-	NV_GL_LOAD_EXT( glUniform1iv );
-	NV_GL_LOAD_EXT( glUniform2iv );
-	NV_GL_LOAD_EXT( glUniform3iv );
-	NV_GL_LOAD_EXT( glUniform4iv );
-	NV_GL_LOAD_EXT( glUniformMatrix2fv );
-	NV_GL_LOAD_EXT( glUniformMatrix3fv );
-	NV_GL_LOAD_EXT( glUniformMatrix4fv );
-	NV_GL_LOAD_EXT( glValidateProgram );
-	NV_GL_LOAD_EXT( glVertexAttribPointer );
-
-/* OpenGL 2.1 non-deprecated functions */
-	NV_GL_LOAD_EXT( glUniformMatrix2x3fv );
-	NV_GL_LOAD_EXT( glUniformMatrix3x2fv );
-	NV_GL_LOAD_EXT( glUniformMatrix2x4fv );
-	NV_GL_LOAD_EXT( glUniformMatrix4x2fv );
-	NV_GL_LOAD_EXT( glUniformMatrix3x4fv );
-	NV_GL_LOAD_EXT( glUniformMatrix4x3fv );
+#	define NV_GL_FUN( rtype, fname, fparams ) NV_GL_LOAD( fname )
+#	define NV_GL_FUN_EXT( rtype, fname, fparams ) NV_GL_LOAD_EXT( fname )
+#	include <nv/lib/detail/gl_functions.inc>
+#	undef NV_GL_FUN_EXT
+#	undef NV_GL_FUN
 
 #	undef NV_GL_LOAD
