📄 appstate.h
字号:
/*
* ==============================================================================
* Name : AppState.h
* Part of : RGA Game Example
* Interface :
* Description : abstract application state interface
* Version : 1.0
*
* Copyright (c) 2007-2008 Nokia Corporation.
* This material, including documentation and any related
* computer programs, is protected by copyright controlled by
* Nokia Corporation.
* ==============================================================================
*/
#ifndef __APPSTATE_H__
#define __APPSTATE_H__
#include "ApplicationBase.h"
class CExampleApplication;
/**
* EAppUpdateState
* return values from application state 'Update' function
* main application object reads this value and updates
* application state accordingly
*/
enum EAppUpdateState
{
EAppUpdateStateContinue = 0, // continue running current state
EAppUpdateStateExit, // exit application
EAppUpdateStateInitIntro, // init intro state
EAppUpdateStateInitMenu, // init main menu state
EAppUpdateStateInitMenuHighScores, // init main menu state and open high scores
EAppUpdateStateInitGame, // init game state
EAppUpdateStateInitNewHighScore // init new high score state
};
class CAppState : public CBase
{
public:
CAppState(CExampleApplication& aApp);
virtual ~CAppState();
/**
* Init
* Initialise the state
* @return KErrNone if successfull
*/
virtual TInt Init();
/**
* Update
* Update application state
* @param aFrametime seconds elapsed since last frame
* @return state change value
*/
virtual EAppUpdateState Update(const TReal64& aFrametime) = 0;
/**
* Draw
* Draw state graphics to given graphics context
* @param aContext graphics context to draw to.
*/
virtual void Draw(IGraphicsContext& aContext) = 0;
/**
* KeyDown
* This handler is called by the main application object
* when any key is pressed
* @param aKeyCode RGA input key code of the pressed key
*/
virtual void KeyDown(TUint32 aKeyCode);
/**
* DisplayOrientationChanged
* This handler is called by the application object
* when display orientation changes (portrait-landscape)
* Default implementation does nothing.
*/
virtual void DisplayOrientationChanged();
/**
* Pause
* this handler is called by the application when it
* requires application state to pause (incoming phone call...)
*/
virtual void Pause();
/**
* App
* @return reference to application object that created this state
*/
CExampleApplication& App();
private:
CExampleApplication& iApplication;
};
#endif /* __APPSTATE_H__*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -