From cbb780a9da75fbca34e91c997d8b190bccd81c4e Mon Sep 17 00:00:00 2001 From: kiritow <1362050620@qq.com> Date: Wed, 7 Jun 2017 20:37:54 +0800 Subject: [PATCH] Add system info querying functions (CPU,RAM) --- MiniEngine.cpp | 18 ++++++++++++++++++ MiniEngine.h | 5 +++++ 2 files changed, 23 insertions(+) diff --git a/MiniEngine.cpp b/MiniEngine.cpp index a259ade..361a7c2 100644 --- a/MiniEngine.cpp +++ b/MiniEngine.cpp @@ -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) { diff --git a/MiniEngine.h b/MiniEngine.h index ab9a544..12632f4 100644 --- a/MiniEngine.h +++ b/MiniEngine.h @@ -634,6 +634,11 @@ namespace MiniEngine static std::tuple GetTTFCompileVersion(); static std::tuple GetTTFLinkedVersion(); + static int GetCPUCount(); + static int GetCPUCacheLineSize(); + /// RAM is calculated in MB. + static int GetSystemRAM(); + class Android { public: