2012-08-02 13:02:59 +08:00
|
|
|
/*
|
|
|
|
* CCAplication.h
|
|
|
|
*
|
|
|
|
* Created on: Aug 8, 2011
|
|
|
|
* Author: laschweinski
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef CCAPLICATION_H_
|
|
|
|
#define CCAPLICATION_H_
|
|
|
|
|
2012-08-16 18:09:01 +08:00
|
|
|
#include "platform/CCCommon.h"
|
2012-08-02 13:02:59 +08:00
|
|
|
#include "platform/CCApplicationProtocol.h"
|
2013-01-28 11:56:56 +08:00
|
|
|
#include <string>
|
2012-08-02 13:02:59 +08:00
|
|
|
|
|
|
|
NS_CC_BEGIN
|
|
|
|
class CCRect;
|
|
|
|
|
|
|
|
class CCApplication : public CCApplicationProtocol
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CCApplication();
|
|
|
|
virtual ~CCApplication();
|
|
|
|
|
|
|
|
/**
|
|
|
|
@brief Callback by CCDirector for limit FPS.
|
|
|
|
@interval The time, which expressed in second in second, between current frame and next.
|
|
|
|
*/
|
|
|
|
void setAnimationInterval(double interval);
|
|
|
|
|
|
|
|
/**
|
|
|
|
@brief Run the message loop.
|
|
|
|
*/
|
|
|
|
int run();
|
|
|
|
|
|
|
|
/**
|
|
|
|
@brief Get current applicaiton instance.
|
|
|
|
@return Current application instance pointer.
|
|
|
|
*/
|
2012-08-21 15:28:43 +08:00
|
|
|
static CCApplication* sharedApplication();
|
2012-08-02 13:02:59 +08:00
|
|
|
|
2012-08-03 13:56:18 +08:00
|
|
|
/* override functions */
|
2012-08-02 13:02:59 +08:00
|
|
|
virtual ccLanguageType getCurrentLanguage();
|
2012-08-03 13:56:18 +08:00
|
|
|
|
2013-01-28 10:36:37 +08:00
|
|
|
/**
|
|
|
|
* Sets the Resource root path.
|
2013-01-29 09:56:38 +08:00
|
|
|
* @deprecated Please use CCFileUtils::sharedFileUtils()->setSearchPaths() instead.
|
2013-01-28 10:36:37 +08:00
|
|
|
*/
|
2013-01-28 11:56:56 +08:00
|
|
|
CC_DEPRECATED_ATTRIBUTE void setResourceRootPath(const std::string& rootResDir);
|
2012-08-16 10:21:15 +08:00
|
|
|
|
2013-01-28 10:36:37 +08:00
|
|
|
/**
|
|
|
|
* Gets the Resource root path.
|
2013-01-29 09:56:38 +08:00
|
|
|
* @deprecated Please use CCFileUtils::sharedFileUtils()->getSearchPaths() instead.
|
2013-01-28 10:36:37 +08:00
|
|
|
*/
|
2013-01-28 11:56:56 +08:00
|
|
|
CC_DEPRECATED_ATTRIBUTE const std::string& getResourceRootPath(void);
|
2012-08-16 10:21:15 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
@brief Get target platform
|
|
|
|
*/
|
2012-08-16 11:30:25 +08:00
|
|
|
virtual TargetPlatform getTargetPlatform();
|
2012-08-02 13:02:59 +08:00
|
|
|
protected:
|
|
|
|
long m_nAnimationInterval; //micro second
|
2013-01-28 10:36:37 +08:00
|
|
|
std::string m_resourceRootPath;
|
|
|
|
|
2012-08-02 13:02:59 +08:00
|
|
|
static CCApplication * sm_pSharedApplication;
|
|
|
|
};
|
|
|
|
|
|
|
|
NS_CC_END
|
|
|
|
|
|
|
|
#endif /* CCAPLICATION_H_ */
|