//システム情報取得
bool systemInfo(IrrlichtDevice *device, IVideoDriver* driver, c8* buf, s32 length)
{
s32 len;
u32 fps = 0;
u32 speed = 0;
u32 total = 0;
u32 avail = 0;
c8* name = NULL;
c8* ver = NULL;
IOSOperator* os;
//引数チェック
if(device == NULL || buf == NULL || length < 256)
return false;
//システム情報取得
os = device->getOSOperator();
fps = driver->getFPS();
os->getProcessorSpeedMHz(&speed);
os->getSystemMemory(&total, &avail);
name = utf16be_to_sjis(driver->getName(), &len);
ver = utf16be_to_sjis(os->getOperationSystemVersion(), &len);
memset(buf, 0x00, length);
sprintf(buf, "FPS : %d\nCPU : %d MHz\nMEM : %d / %d Kb\nNAME: %s\nVER :%s",
fps, speed, avail, total, name, ver);
return true;
}
|