cgametimer.h

来自「This package includes a 3-D game engine 」· C头文件 代码 · 共 82 行

H
82
字号
    /*
    *
============================================================================
    *  Name     : CGameTimer.h
    *  Part of  : Example3D
    *  Created  : 12/14/2003 by Forum Nokia
    *  Description:
    *     This is the project specification file for Example3D.
    *     Initial content was generated by Series 60 AppWizard.
    *
    *  Version  : 1.0.0
    *  Copyright: Forum Nokia
    *
============================================================================
    */

#ifndef __CGAMETIMER_H__
#define __CGAMETIMER_H__


// INCLUDES
#include <e32base.h>

   
// FORWARD DECLARATIONS
class MGameTimerObserver;

// CLASS DECLARATION

/**
*  CGameTimer's purpose is to give all possible
*  processing time to CEngine without stalling
*  the operating system
*/

class CGameTimer 
	: public CBase
	{
	public:
		/// Two-phased constructor
		static CGameTimer* NewL( MGameTimerObserver& aObserver );

		/// Two-phased constructor
		/// leaves pointer to cleanup stack
		static CGameTimer* NewLC( MGameTimerObserver& aObserver );

		/// Destructor
		~CGameTimer();

	private:

		/// Second-phase constructor
		void ConstructL();

		/// Default constructor
		CGameTimer( MGameTimerObserver& aObserver );

	public: // New methods:

		/// Starts timer
		void Start();

		/// Cancels timer
		void Cancel();

	private: // Private methods

		/// Callback called by CIdle member
		static TInt IdleCallBack( TAny* aPtr );

		/// Called by IdleCallBack
		/// @return boolean ETrue continues timer, EFalse stops.
		TInt DoCall();

	private: // data

		MGameTimerObserver& iObserver;	// reference to timer observer ( CEngine )
		CIdle*	iIdle;					// CIdle timer

	};

#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?