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"
|
2024-05-14 02:22:47 -04:00
|
|
|
#include "CXBOXController.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-06 13:17:08 -05:00
|
|
|
GEODE_CUSTOM_CONSTRUCTOR_BEGIN(CCApplication)
|
2022-07-30 12:24:03 -04:00
|
|
|
CCApplication();
|
|
|
|
virtual ~CCApplication();
|
|
|
|
|
|
|
|
/**
|
|
|
|
@brief Run the message loop.
|
|
|
|
*/
|
2024-06-20 08:19:43 -04:00
|
|
|
// Robtop Removal
|
|
|
|
// virtual int run();
|
|
|
|
|
|
|
|
// @note RobTop Addition
|
|
|
|
virtual void gameDidSave();
|
2022-07-30 12:24:03 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
@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();
|
|
|
|
|
2023-03-25 14:31:11 -04:00
|
|
|
virtual void openURL(const char* url);
|
|
|
|
virtual int run();
|
|
|
|
virtual void setupGLView();
|
|
|
|
virtual void platformShutdown();
|
|
|
|
void toggleVerticalSync(bool);
|
2024-06-20 08:19:43 -04:00
|
|
|
// @note RobTop Addition
|
|
|
|
void setupVerticalSync();
|
|
|
|
// @note RobTop Addition
|
|
|
|
void updateVerticalSync();
|
|
|
|
// @note RobTop Addition
|
|
|
|
void updateControllerKeys(CXBOXController* controller, int userIndex);
|
|
|
|
|
|
|
|
// @note RobTop Addition
|
|
|
|
int getTimeElapsed();
|
|
|
|
// @note RobTop Addition
|
|
|
|
void resetForceTimer();
|
|
|
|
|
|
|
|
// @note RobTop Addition
|
|
|
|
void leftMouseDown();
|
|
|
|
// @note RobTop Addition
|
|
|
|
void leftMouseUp();
|
|
|
|
|
|
|
|
// @note RobTop Addition
|
|
|
|
void logTimeElapsed(gd::string);
|
|
|
|
|
|
|
|
// @note RobTop Addition
|
|
|
|
void moveMouse(int, int);
|
|
|
|
|
|
|
|
// @note RobTop Addition
|
|
|
|
void shutdownApplication();
|
|
|
|
// @note RobTop Addition
|
|
|
|
void toggleMouseControl(bool);
|
|
|
|
// @note RobTop Addition
|
|
|
|
void updateController();
|
|
|
|
// @note RobTop Addition
|
|
|
|
void updateMouseControl();
|
2023-12-20 21:14:53 -05:00
|
|
|
|
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);
|
|
|
|
|
|
|
|
const gd::string& getStartupScriptFilename(void)
|
|
|
|
{
|
|
|
|
return m_startupScriptFilename;
|
|
|
|
}
|
|
|
|
|
2023-04-15 07:18:09 -04:00
|
|
|
public:
|
2022-07-30 12:24:03 -04:00
|
|
|
HINSTANCE m_hInstance;
|
|
|
|
HACCEL m_hAccelTable;
|
|
|
|
LARGE_INTEGER m_nAnimationInterval;
|
2023-06-11 12:57:03 -04:00
|
|
|
LARGE_INTEGER m_nVsyncInterval;
|
2023-08-02 10:54:17 -04:00
|
|
|
gd::string m_resourceRootPath;
|
|
|
|
gd::string m_startupScriptFilename;
|
2024-05-14 02:22:47 -04:00
|
|
|
CXBOXController* m_pControllerHandler;
|
|
|
|
CXBOXController* m_pController2Handler; //might be swapped with m_pControllerHandler
|
2023-03-25 14:31:11 -04:00
|
|
|
bool m_bUpdateController;
|
|
|
|
CC_SYNTHESIZE_NV(bool, m_bShutdownCalled, ShutdownCalled);
|
|
|
|
INPUT m_iInput;
|
2023-06-11 12:57:03 -04:00
|
|
|
CCPoint m_obLeftThumb;
|
|
|
|
CCPoint m_obRightThumb;
|
2023-03-25 14:31:11 -04:00
|
|
|
bool m_bMouseControl;
|
|
|
|
float m_fAnimationInterval;
|
2023-06-11 18:50:10 -04:00
|
|
|
float m_fVsyncInterval;
|
2023-03-25 14:31:11 -04:00
|
|
|
CC_SYNTHESIZE_READONLY_NV(bool, m_bVerticalSyncEnabled, VerticalSyncEnabled);
|
|
|
|
CC_SYNTHESIZE_READONLY_NV(bool, m_bControllerConnected, ControllerConnected);
|
|
|
|
CC_SYNTHESIZE_NV(bool, m_bSleepMode, SleepMode);
|
|
|
|
CC_SYNTHESIZE_NV(bool, m_bForceTimer, ForceTimer);
|
|
|
|
CC_SYNTHESIZE_NV(bool, m_bSmoothFix, SmoothFix);
|
|
|
|
CC_SYNTHESIZE_NV(bool, m_bFullscreen, Fullscreen);
|
2024-01-17 12:09:08 -05:00
|
|
|
CC_SYNTHESIZE_NV(bool, m_bBorderless, Borderless);
|
2022-07-30 12:24:03 -04:00
|
|
|
|
2024-05-14 02:22:47 -04:00
|
|
|
protected:
|
2022-07-30 12:24:03 -04:00
|
|
|
static CCApplication * sm_pSharedApplication;
|
|
|
|
};
|
|
|
|
|
|
|
|
NS_CC_END
|
|
|
|
|
|
|
|
#endif // __CC_APPLICATION_WIN32_H__
|