2022-07-30 12:24:03 -04:00
|
|
|
#ifndef __CC_APPLICATION_WIN32_H__
|
|
|
|
#define __CC_APPLICATION_WIN32_H__
|
|
|
|
|
2022-10-17 08:46:36 -04:00
|
|
|
#include "../../include/ccMacros.h"
|
2022-07-30 12:24:03 -04:00
|
|
|
#include "CCStdC.h"
|
2022-10-17 08:46:36 -04:00
|
|
|
#include "../CCCommon.h"
|
|
|
|
#include "../CCApplicationProtocol.h"
|
2022-07-30 12:24:03 -04:00
|
|
|
#include <string>
|
|
|
|
|
|
|
|
NS_CC_BEGIN
|
|
|
|
|
|
|
|
class CCRect;
|
|
|
|
|
|
|
|
class CC_DLL CCApplication : public CCApplicationProtocol
|
|
|
|
{
|
|
|
|
GEODE_FRIEND_MODIFY
|
|
|
|
public:
|
2023-03-05 16:52:39 -05:00
|
|
|
GEODE_ZERO_CONSTRUCTOR_BEGIN(CCApplication)
|
2022-07-30 12:24:03 -04:00
|
|
|
CCApplication();
|
|
|
|
virtual ~CCApplication();
|
|
|
|
|
|
|
|
/**
|
|
|
|
@brief Run the message loop.
|
|
|
|
*/
|
|
|
|
RT_REMOVE( virtual int run(); )
|
|
|
|
RT_ADD( virtual void gameDidSave(); )
|
|
|
|
|
|
|
|
/**
|
|
|
|
@brief Get current applicaiton instance.
|
|
|
|
@return Current application instance pointer.
|
|
|
|
*/
|
|
|
|
static CCApplication* sharedApplication();
|
|
|
|
|
2023-02-01 17:03:01 -05:00
|
|
|
static GEODE_DLL CCApplication* get();
|
2022-10-06 15:33:56 -04:00
|
|
|
|
2022-07-30 12:24:03 -04:00
|
|
|
/* override functions */
|
|
|
|
virtual void setAnimationInterval(double interval);
|
|
|
|
virtual ccLanguageType getCurrentLanguage();
|
|
|
|
|
|
|
|
/**
|
|
|
|
@brief Get target platform
|
|
|
|
*/
|
|
|
|
virtual TargetPlatform getTargetPlatform();
|
|
|
|
|
|
|
|
RT_ADD(
|
|
|
|
virtual void openURL(const char* url);
|
|
|
|
virtual int run();
|
|
|
|
virtual void setupGLView();
|
|
|
|
virtual void platformShutdown();
|
|
|
|
void toggleVerticalSync(bool);
|
2022-10-12 21:46:23 -04:00
|
|
|
bool getVerticalSyncEnabled() const;
|
2022-07-30 12:24:03 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets the Resource root path.
|
|
|
|
* @deprecated Please use CCFileUtils::sharedFileUtils()->setSearchPaths() instead.
|
|
|
|
*/
|
|
|
|
CC_DEPRECATED_ATTRIBUTE void setResourceRootPath(const gd::string& rootResDir);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the Resource root path.
|
|
|
|
* @deprecated Please use CCFileUtils::sharedFileUtils()->getSearchPaths() instead.
|
|
|
|
*/
|
|
|
|
CC_DEPRECATED_ATTRIBUTE const gd::string& getResourceRootPath(void);
|
|
|
|
|
|
|
|
void setStartupScriptFilename(const gd::string& startupScriptFile);
|
|
|
|
|
|
|
|
bool getControllerConnected() const;
|
|
|
|
|
|
|
|
const gd::string& getStartupScriptFilename(void)
|
|
|
|
{
|
|
|
|
return m_startupScriptFilename;
|
|
|
|
}
|
|
|
|
|
|
|
|
protected:
|
|
|
|
HINSTANCE m_hInstance;
|
|
|
|
HACCEL m_hAccelTable;
|
|
|
|
LARGE_INTEGER m_nAnimationInterval;
|
|
|
|
gd::string m_resourceRootPath;
|
|
|
|
gd::string m_startupScriptFilename;
|
|
|
|
|
|
|
|
static CCApplication * sm_pSharedApplication;
|
|
|
|
};
|
|
|
|
|
|
|
|
NS_CC_END
|
|
|
|
|
|
|
|
#endif // __CC_APPLICATION_WIN32_H__
|