2017-03-09 18:00:19 +08:00
|
|
|
#include "MiniEngine.h"
|
|
|
|
|
|
|
|
namespace MiniEngine
|
|
|
|
{
|
|
|
|
|
|
|
|
/// Android Device
|
|
|
|
#if defined(__ANDROID__) && __ANDROID__
|
|
|
|
std::string SDLSystem::Android::GetInternal()
|
|
|
|
{
|
2017-05-24 03:09:27 +08:00
|
|
|
return std::string(SDL_AndroidGetInternalStoragePath());
|
2017-03-09 18:00:19 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
std::string SDLSystem::Android::GetExternal()
|
|
|
|
{
|
2017-05-24 03:09:27 +08:00
|
|
|
return std::string(SDL_AndroidGetExternalStoragePath());
|
2017-03-09 18:00:19 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
bool SDLSystem::Android::CanReadExternal()
|
|
|
|
{
|
|
|
|
return SDL_AndroidGetExternalStorageState() & SDL_ANDROID_EXTERNAL_STORAGE_READ;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool SDLSystem::Android::CanWriteExternal()
|
|
|
|
{
|
|
|
|
return SDL_AndroidGetExternalStorageState() & SDL_ANDROID_EXTERNAL_STORAGE_WRITE;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool SDLSystem::Android::ExternalAvaliable()
|
|
|
|
{
|
|
|
|
return SDL_AndroidGetExternalStorageState() != 0;
|
|
|
|
}
|
|
|
|
void* SDLSystem::Android::GetJNIEnv()
|
|
|
|
{
|
|
|
|
return SDL_AndroidGetJNIEnv();
|
|
|
|
}
|
|
|
|
|
|
|
|
/// Not An Android Device
|
|
|
|
#else
|
|
|
|
|
|
|
|
std::string SDLSystem::Android::GetInternal()
|
|
|
|
{
|
|
|
|
return "";
|
|
|
|
}
|
|
|
|
|
|
|
|
std::string SDLSystem::Android::GetExternal()
|
|
|
|
{
|
|
|
|
return "";
|
|
|
|
}
|
|
|
|
|
|
|
|
bool SDLSystem::Android::CanReadExternal()
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool SDLSystem::Android::CanWriteExternal()
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool SDLSystem::Android::ExternalAvaliable()
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
void* SDLSystem::Android::GetJNIEnv()
|
|
|
|
{
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
}///End of namespace MiniEngine
|