+
+static void vg_tex2d_init( vg_tex2d *textures[], int num )
+{
+ for( int i = 0; i < num; i ++ )
+ {
+ vg_tex2d *tex = textures[i];
+ tex->name = vg_tex2d_rgba( tex->path );
+ if( !(tex->flags & VG_TEXTURE_NO_MIP) )
+ vg_tex2d_mipmap();
+
+ if( tex->flags & VG_TEXTURE_NEAREST )
+ {
+ if( tex->flags & VG_TEXTURE_NO_MIP )
+ vg_error( "Invalid texture settings\n" );
+ else
+ vg_tex2d_nearest();
+ }
+ else
+ {
+ if( tex->flags & VG_TEXTURE_NO_MIP )
+ vg_tex2d_linear();
+ else
+ vg_tex2d_linear_mipmap();
+ }
+
+ if( tex->flags & VG_TEXTURE_CLAMP )
+ vg_tex2d_clamp();
+ else
+ vg_tex2d_repeat();
+ }
+}
+
+static void vg_tex2d_free( vg_tex2d *textures[], int num )
+{
+ for( int i = 0; i < num; i ++ )
+ {
+ glDeleteTextures( 1, &textures[i]->name );
+ }
+}