Horde3D
http://www.horde3d.org/forums/

CPU information
http://www.horde3d.org/forums/viewtopic.php?f=1&t=1240
Page 1 of 1

Author:  ZONER [ 04.09.2010, 09:47 ]
Post subject:  CPU information

Hello everyone!

I made some addition to Horde3D - CPU name and speed getting. If this will be very interesting for someone, who uses Horde3D or may be other engine - code works everywhere and it not bounded only to one engine. One exception - I don't have GCC or MinGW compiler, Linux or MacOSX on my computer - I can't check for cross-platform/cross-compiler support.

If you want to write CPU information in log just write that where you need:
Code:
 Modules::log().writeInfo( CPUCode::GetCPUString().c_str() );


Attachments:
egCPU.h [3.7 KiB]
Downloaded 835 times

Author:  Siavash [ 04.09.2010, 10:46 ]
Post subject:  Re: CPU information

Thanks!

EDIT: A small addition to get the number of Cores/CPUs on Windows platform :
http://msdn.microsoft.com/en-us/library/ms724423%28v=VS.85%29.aspx for more information
Code:
std::string GetNumOfCores()
{
   SYSTEM_INFO sysINFO;
   GetSystemInfo(&sysINFO);

   std::stringstream numOfCores;
   numOfCores << sysINFO.dwNumberOfProcessors;
   return std::string(numOfCores.str());
}

Author:  ZONER [ 04.09.2010, 11:08 ]
Post subject:  Re: CPU information

Thank you, Siavash! :) I'll update my code

Page 1 of 1 All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/