Horde3D

Next-Generation Graphics Engine
It is currently 29.03.2024, 07:37

All times are UTC + 1 hour




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: CPU information
PostPosted: 04.09.2010, 09:47 
Offline

Joined: 17.01.2010, 13:30
Posts: 7
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 827 times


Last edited by ZONER on 04.09.2010, 11:05, edited 2 times in total.
Top
 Profile  
Reply with quote  
 Post subject: Re: CPU information
PostPosted: 04.09.2010, 10:46 
Offline

Joined: 21.08.2008, 11:44
Posts: 354
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());
}


Top
 Profile  
Reply with quote  
 Post subject: Re: CPU information
PostPosted: 04.09.2010, 11:08 
Offline

Joined: 17.01.2010, 13:30
Posts: 7
Thank you, Siavash! :) I'll update my code


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 42 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group