mirror of
https://github.com/dashr9230/SA-MP.git
synced 2025-01-08 18:43:31 +08:00
42 lines
1.3 KiB
C
42 lines
1.3 KiB
C
|
//--------------------------------------------------------------------------------------
|
||
|
// File: DXUTMisc.h
|
||
|
//
|
||
|
// Helper functions for Direct3D programming.
|
||
|
//
|
||
|
// Copyright (c) Microsoft Corporation. All rights reserved
|
||
|
//--------------------------------------------------------------------------------------
|
||
|
#pragma once
|
||
|
#ifndef DXUT_MISC_H
|
||
|
#define DXUT_MISC_H
|
||
|
|
||
|
|
||
|
//--------------------------------------------------------------------------------------
|
||
|
// Performs timer operations
|
||
|
// Use DXUTGetGlobalTimer() to get the global instance
|
||
|
//--------------------------------------------------------------------------------------
|
||
|
class CDXUTTimer
|
||
|
{
|
||
|
public:
|
||
|
CDXUTTimer();
|
||
|
|
||
|
void Reset(); // resets the timer
|
||
|
void Start(); // starts the timer
|
||
|
void Stop(); // stop (or pause) the timer
|
||
|
void Advance(); // advance the timer by 0.1 seconds
|
||
|
double GetAbsoluteTime(); // get the absolute system time
|
||
|
double GetTime(); // get the current time
|
||
|
double GetElapsedTime(); // get the time that elapsed between GetElapsedTime() calls
|
||
|
bool IsStopped(); // returns true if timer stopped
|
||
|
|
||
|
protected:
|
||
|
bool m_bUsingQPF;
|
||
|
bool m_bTimerStopped;
|
||
|
LONGLONG m_llQPFTicksPerSec;
|
||
|
|
||
|
LONGLONG m_llStopTime;
|
||
|
LONGLONG m_llLastElapsedTime;
|
||
|
LONGLONG m_llBaseTime;
|
||
|
};
|
||
|
|
||
|
#endif
|