dev.gamez.lv Forum Index dev.gamez.lv
Latvian Game Developers Community
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups 

get time

 
dev.gamez.lv Forum Index -> Programmēšana
View previous topic :: View next topic  
Author Message
Angel



Joined: 02 Jan 2005
Posts: 113
Location: Latvija

PostPosted: Wed Jun 01, 2005 8:58 pm    Post subject: get time

Taaa......
Vai kaads man luudzu nevareetu pateikt, kaadu liidziigu funkciju timeGetTime(), Vai arii varbut kaads vareetu man atsutit mmtimer.lib - Vnk nezinu kapeec man taada nav. mekleeju googlee, bet tur vispaar nekaa nav.

P.S. Un vai kaadam nav saglabaajies tutoriaalis no www.gametutorials.com par fontiem??? Cik atceros bij ljoti labs
Back to top
View user's profile Send e-mail
gazz



Joined: 03 Jan 2004
Posts: 355
Location: Teika

PostPosted: Wed Jun 01, 2005 10:33 pm    Post subject:

nevaig mmtimer.lib - pieliec pie linkera winmm.lib un buus viss chikiniekaa! ja gribi labaaku taimeri pameegjini pamekleet par high precission timer tutoriaaljus/samplus wai izgriez no directx sdk!
Back to top
View user's profile Send e-mail
Vecais_Dumais_Laacis
Guru
Guru


Joined: 29 Jan 2004
Posts: 800

PostPosted: Thu Jun 02, 2005 12:17 am    Post subject:

kautkaa taa

Code:

class DXE_Timer{
private:
   LARGE_INTEGER Frequency, TimeNow;
public:
   bool UsingQuery;
   DXE_Timer();
   double GetTime();
};


DXE_Timer::DXE_Timer(){
   UsingQuery=QueryPerformanceFrequency(&Frequency)!=0;
}

double DXE_Timer::GetTime(){
   if(UsingQuery){
      QueryPerformanceCounter(&TimeNow);
      return (double)TimeNow.QuadPart/(double)Frequency.QuadPart;
   }else{
      return (double)timeGetTime()/1000.0;
   }
}

_________________
...un ja bites buutu laachi...
Back to top
View user's profile
Display posts from previous:   
dev.gamez.lv Forum Index -> Programmēšana All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group