Add system info querying functions (CPU,RAM)

This commit is contained in:
Kirigaya Kazuto 2017-06-07 20:37:54 +08:00
parent 6df4068539
commit cbb780a9da
2 changed files with 23 additions and 0 deletions

View File

@ -2347,6 +2347,24 @@ namespace MiniEngine
return std::make_tuple(ptr->major,ptr->minor,ptr->patch);
}
//static
int SDLSystem::GetCPUCount()
{
return SDL_GetCPUCount();
}
//static
int SDLSystem::GetCPUCacheLineSize()
{
return SDL_GetCPUCacheLineSize();
}
//static
int SDLSystem::GetSystemRAM()
{
return SDL_GetSystemRAM();
}
/// Global Executor For class Timer
Uint32 _global_timer_executor(Uint32 interval,void* param)
{

View File

@ -634,6 +634,11 @@ namespace MiniEngine
static std::tuple<int,int,int> GetTTFCompileVersion();
static std::tuple<int,int,int> GetTTFLinkedVersion();
static int GetCPUCount();
static int GetCPUCacheLineSize();
/// RAM is calculated in MB.
static int GetSystemRAM();
class Android
{
public: