1 #include <ivorium_config.hpp>
4 #define _WIN32_WINNT 0x0600
19 #if IV_FSPLATFORM_ANDROID
26 static std::string l_ConfigBase( std::string application_name )
30 std::string conf_home;
31 const char * xdg_config_home = std::getenv(
"XDG_CONFIG_HOME" );
34 conf_home = xdg_config_home;
38 const char * home = std::getenv(
"HOME" );
42 conf_home +=
"/.config";
46 conf_home =
"./.config";
50 return conf_home +
"/" + application_name;
52 #elif IV_FSPLATFORM_ANDROID
54 #if IV_GLPLATFORM_GLFM
55 return glfmAndroidGetActivity()->externalDataPath;
57 #error "Can not retrieve configuration base directory."
60 #elif IV_FSPLATFORM_EMSCRIPTEN
64 #elif IV_FSPLATFORM_WIN
67 PWSTR localAppDataPath;
68 HRESULT call_result = SHGetKnownFolderPath( FOLDERID_LocalAppData, 0,
nullptr, &localAppDataPath );
69 if( call_result != S_OK )
74 std::wstring wpath = localAppDataPath;
75 CoTaskMemFree(
static_cast< void *
>( localAppDataPath ) );
78 using convert_typeX = std::codecvt_utf8< wchar_t >;
79 std::wstring_convert< convert_typeX, wchar_t > converterX;
80 std::string path = converterX.to_bytes( wpath );
83 return path +
"/" + application_name;
86 #error "Unknown filesystem platform."
94 this->sc.template createOwnSystem< InstanceSystem >();
95 this->sc.template createOwnSystem< DVarSystem >();
96 this->sc.template createOwnSystem< DelayedLoadSystem >();
97 this->sc.template createOwnSystem< TimeSystem >();
98 this->sc.template createOwnSystem< ConfigFileSystem >( l_ConfigBase( identity.
configuration_tag.c_str() ) );
99 this->sc.template createOwnSystem< RandomSystem >();
100 this->sc.template createOwnSystem< ResourceManagementSystem >();
102 this->sc.template createOwnSystem< InputSystem >( window );
103 this->sc.template createOwnSystem< InputBindingSystem >();
104 this->sc.template createOwnSystem< ElementSystem >();
105 this->sc.template createOwnSystem< AnimSystem >();
106 this->sc.template createOwnSystem< LumaSystem >();
109 this->heap.template create< I< VirtualResourceProvider > >(
"virtual_resources", this->
system_container(), 0 );
110 this->heap.template create< I< PlatformDefault_ResourceProvider > >(
"stream_resources", this->
system_container(), 1 );
113 this->heap.template create< I< DefaultBinder > >(
"default_binder", this->
system_container() );
125 this->sc.template removeSystem< LumaSystem >();
126 this->sc.template removeSystem< AnimSystem >();
127 this->sc.template removeSystem< ElementSystem >();
128 this->sc.template removeSystem< InputBindingSystem >();
129 this->sc.template removeSystem< InputSystem >();
130 this->sc.template removeSystem< GlSystem >();
131 this->sc.template removeSystem< ResourceManagementSystem >();
132 this->sc.template removeSystem< RandomSystem >();
133 this->sc.template removeSystem< ConfigFileSystem >();
134 this->sc.template removeSystem< TimeSystem >();
135 this->sc.template removeSystem< DelayedLoadSystem >();
136 this->sc.template removeSystem< DVarSystem >();
137 this->sc.template removeSystem< InstanceSystem >();
201 return dls->loadStep();