cgametimer.h

来自「一个基于symbian s60 3rd 的3D汽车游戏演示程序,模拟器上编译通过」· C头文件 代码 · 共 76 行

H
76
字号
   /*
============================================================================
    * Name : CGameTimer.h
    * Part of : Example3D
    * Description : Definition of CGameTimer
    * Copyright (c) 2007 Nokia Corporation
============================================================================
    */

#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 + -
显示快捷键?