@@ -26,6 +26,7 @@ Index of this file:
2626#include "pl_gpu_allocators_ext.h"
2727#include "pl_image_ext.h"
2828#include "pl_vfs_ext.h"
29+ #include "pl_platform_ext.h"
2930
3031// unstable extensions
3132#include "pl_dxt_ext.h"
@@ -60,6 +61,7 @@ Index of this file:
6061 static const plVfsI * gptVfs = NULL ;
6162 static const plDdsI * gptDds = NULL ;
6263 static const plDxtI * gptDxt = NULL ;
64+ static const plFileI * gptFile = NULL ;
6365#endif
6466
6567// libs
@@ -159,7 +161,12 @@ pl_resource_initialize(plResourceManagerInit tDesc)
159161 if (tDesc .uMaxTextureResolution == 0 )
160162 tDesc .uMaxTextureResolution = 1024 ;
161163
164+ if (tDesc .pcCacheDirectory == NULL )
165+ tDesc .pcCacheDirectory = "../cache" ;
166+
162167 gptResourceManager -> tDesc = tDesc ;
168+ gptFile -> create_directory (tDesc .pcCacheDirectory );
169+ gptVfs -> mount_directory ("/cache" , tDesc .pcCacheDirectory , PL_VFS_MOUNT_FLAGS_NONE );
163170
164171 plDevice * ptDevice = tDesc .ptDevice ;
165172
@@ -984,6 +991,7 @@ pl_load_resource_ext(plApiRegistryI* ptApiRegistry, bool bReload)
984991 gptVfs = pl_get_api_latest (ptApiRegistry , plVfsI );
985992 gptDds = pl_get_api_latest (ptApiRegistry , plDdsI );
986993 gptDxt = pl_get_api_latest (ptApiRegistry , plDxtI );
994+ gptFile = pl_get_api_latest (ptApiRegistry , plFileI );
987995 #endif
988996
989997 const plDataRegistryI * ptDataRegistry = pl_get_api_latest (ptApiRegistry , plDataRegistryI );
0 commit comments