mirror of https://github.com/axmolengine/axmol.git
Migrate namespace for templates [skip ci]
This commit is contained in:
parent
06079a5369
commit
154009da5f
|
@ -70,7 +70,7 @@ bool AppDelegate::applicationDidFinishLaunching()
|
||||||
#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) || (AX_TARGET_PLATFORM == AX_PLATFORM_MAC) || \
|
#if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32) || (AX_TARGET_PLATFORM == AX_PLATFORM_MAC) || \
|
||||||
(AX_TARGET_PLATFORM == AX_PLATFORM_LINUX)
|
(AX_TARGET_PLATFORM == AX_PLATFORM_LINUX)
|
||||||
glView = GLViewImpl::createWithRect(
|
glView = GLViewImpl::createWithRect(
|
||||||
"HelloCpp", axis::Rect(0, 0, designResolutionSize.width, designResolutionSize.height));
|
"HelloCpp", ax::Rect(0, 0, designResolutionSize.width, designResolutionSize.height));
|
||||||
#else
|
#else
|
||||||
glView = GLViewImpl::create("HelloCpp");
|
glView = GLViewImpl::create("HelloCpp");
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
|
|
||||||
Private inheritance here hides part of interface from Director.
|
Private inheritance here hides part of interface from Director.
|
||||||
*/
|
*/
|
||||||
class AppDelegate : private axis::Application
|
class AppDelegate : private ax::Application
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
AppDelegate();
|
AppDelegate();
|
||||||
|
|
|
@ -42,11 +42,11 @@ static AppDelegate s_sharedApplication;
|
||||||
- (BOOL)application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions
|
- (BOOL)application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions
|
||||||
{
|
{
|
||||||
|
|
||||||
axis::Application* app = axis::Application::getInstance();
|
ax::Application* app = ax::Application::getInstance();
|
||||||
|
|
||||||
// Initialize the GLView attributes
|
// Initialize the GLView attributes
|
||||||
app->initGLContextAttrs();
|
app->initGLContextAttrs();
|
||||||
axis::GLViewImpl::convertAttrs();
|
ax::GLViewImpl::convertAttrs();
|
||||||
|
|
||||||
// Override point for customization after application launch.
|
// Override point for customization after application launch.
|
||||||
|
|
||||||
|
@ -84,8 +84,8 @@ static AppDelegate s_sharedApplication;
|
||||||
}
|
}
|
||||||
|
|
||||||
// IMPORTANT: Setting the GLView should be done after creating the RootViewController
|
// IMPORTANT: Setting the GLView should be done after creating the RootViewController
|
||||||
axis::GLView* glView = axis::GLViewImpl::createWithEAGLView((__bridge void*)_viewController.view);
|
ax::GLView* glView = ax::GLViewImpl::createWithEAGLView((__bridge void*)_viewController.view);
|
||||||
axis::Director::getInstance()->setOpenGLView(glView);
|
ax::Director::getInstance()->setOpenGLView(glView);
|
||||||
|
|
||||||
// run the cocos2d-x game scene
|
// run the cocos2d-x game scene
|
||||||
app->run();
|
app->run();
|
||||||
|
@ -102,7 +102,7 @@ static AppDelegate s_sharedApplication;
|
||||||
throttle down OpenGL ES frame rates. Games should use this method to pause the game.
|
throttle down OpenGL ES frame rates. Games should use this method to pause the game.
|
||||||
*/
|
*/
|
||||||
// We don't need to call this method any more. It will interrupt user defined game pause&resume logic
|
// We don't need to call this method any more. It will interrupt user defined game pause&resume logic
|
||||||
/* axis::Director::getInstance()->pause(); */
|
/* ax::Director::getInstance()->pause(); */
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)applicationDidBecomeActive:(UIApplication*)application
|
- (void)applicationDidBecomeActive:(UIApplication*)application
|
||||||
|
@ -112,7 +112,7 @@ static AppDelegate s_sharedApplication;
|
||||||
previously in the background, optionally refresh the user interface.
|
previously in the background, optionally refresh the user interface.
|
||||||
*/
|
*/
|
||||||
// We don't need to call this method any more. It will interrupt user defined game pause&resume logic
|
// We don't need to call this method any more. It will interrupt user defined game pause&resume logic
|
||||||
/* axis::Director::getInstance()->resume(); */
|
/* ax::Director::getInstance()->resume(); */
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)applicationDidEnterBackground:(UIApplication*)application
|
- (void)applicationDidEnterBackground:(UIApplication*)application
|
||||||
|
@ -122,7 +122,7 @@ static AppDelegate s_sharedApplication;
|
||||||
information to restore your application to its current state in case it is terminated later. If your application
|
information to restore your application to its current state in case it is terminated later. If your application
|
||||||
supports background execution, called instead of applicationWillTerminate: when the user quits.
|
supports background execution, called instead of applicationWillTerminate: when the user quits.
|
||||||
*/
|
*/
|
||||||
axis::Application::getInstance()->applicationDidEnterBackground();
|
ax::Application::getInstance()->applicationDidEnterBackground();
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)applicationWillEnterForeground:(UIApplication*)application
|
- (void)applicationWillEnterForeground:(UIApplication*)application
|
||||||
|
@ -131,7 +131,7 @@ static AppDelegate s_sharedApplication;
|
||||||
Called as part of transition from the background to the inactive state: here you can undo many of the changes made
|
Called as part of transition from the background to the inactive state: here you can undo many of the changes made
|
||||||
on entering the background.
|
on entering the background.
|
||||||
*/
|
*/
|
||||||
axis::Application::getInstance()->applicationWillEnterForeground();
|
ax::Application::getInstance()->applicationWillEnterForeground();
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)applicationWillTerminate:(UIApplication*)application
|
- (void)applicationWillTerminate:(UIApplication*)application
|
||||||
|
|
|
@ -46,12 +46,12 @@ customization that is not appropriate for viewDidLoad.
|
||||||
{
|
{
|
||||||
// Initialize the CCEAGLView
|
// Initialize the CCEAGLView
|
||||||
CCEAGLView* eaglView = [CCEAGLView viewWithFrame:[UIScreen mainScreen].bounds
|
CCEAGLView* eaglView = [CCEAGLView viewWithFrame:[UIScreen mainScreen].bounds
|
||||||
pixelFormat:(__bridge NSString*)axis::GLViewImpl::_pixelFormat
|
pixelFormat:(__bridge NSString*)ax::GLViewImpl::_pixelFormat
|
||||||
depthFormat:axis::GLViewImpl::_depthFormat
|
depthFormat:ax::GLViewImpl::_depthFormat
|
||||||
preserveBackbuffer:NO
|
preserveBackbuffer:NO
|
||||||
sharegroup:nil
|
sharegroup:nil
|
||||||
multiSampling:axis::GLViewImpl::_multisamplingCount > 0 ? YES : NO
|
multiSampling:ax::GLViewImpl::_multisamplingCount > 0 ? YES : NO
|
||||||
numberOfSamples:axis::GLViewImpl::_multisamplingCount];
|
numberOfSamples:ax::GLViewImpl::_multisamplingCount];
|
||||||
|
|
||||||
// Enable or disable multiple touches
|
// Enable or disable multiple touches
|
||||||
#if !defined(AX_TARGET_OS_TVOS)
|
#if !defined(AX_TARGET_OS_TVOS)
|
||||||
|
@ -95,7 +95,7 @@ customization that is not appropriate for viewDidLoad.
|
||||||
{
|
{
|
||||||
[super didRotateFromInterfaceOrientation:fromInterfaceOrientation];
|
[super didRotateFromInterfaceOrientation:fromInterfaceOrientation];
|
||||||
|
|
||||||
auto glView = axis::Director::getInstance()->getOpenGLView();
|
auto glView = ax::Director::getInstance()->getOpenGLView();
|
||||||
|
|
||||||
if (glView)
|
if (glView)
|
||||||
{
|
{
|
||||||
|
@ -104,7 +104,7 @@ customization that is not appropriate for viewDidLoad.
|
||||||
if (eaglView)
|
if (eaglView)
|
||||||
{
|
{
|
||||||
CGSize s = CGSizeMake([eaglView getWidth], [eaglView getHeight]);
|
CGSize s = CGSizeMake([eaglView getWidth], [eaglView getHeight]);
|
||||||
axis::Application::getInstance()->applicationScreenSizeChanged((int)s.width, (int)s.height);
|
ax::Application::getInstance()->applicationScreenSizeChanged((int)s.width, (int)s.height);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<buildSpec>
|
<buildSpec>
|
||||||
</buildSpec>
|
</buildSpec>
|
||||||
<natures>
|
<natures>
|
||||||
<nature>org.ccdt.axisproj</nature>
|
<nature>org.ccdt.axproj</nature>
|
||||||
<nature>org.eclipse.koneki.ldt.nature</nature>
|
<nature>org.eclipse.koneki.ldt.nature</nature>
|
||||||
</natures>
|
</natures>
|
||||||
</projectDescription>
|
</projectDescription>
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
|
|
||||||
Private inheritance here hides part of interface from Director.
|
Private inheritance here hides part of interface from Director.
|
||||||
*/
|
*/
|
||||||
class AppDelegate : private axis::Application
|
class AppDelegate : private ax::Application
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
AppDelegate();
|
AppDelegate();
|
||||||
|
|
|
@ -42,11 +42,11 @@ static AppDelegate s_sharedApplication;
|
||||||
- (BOOL)application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions
|
- (BOOL)application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions
|
||||||
{
|
{
|
||||||
|
|
||||||
axis::Application* app = axis::Application::getInstance();
|
ax::Application* app = ax::Application::getInstance();
|
||||||
|
|
||||||
// Initialize the GLView attributes
|
// Initialize the GLView attributes
|
||||||
app->initGLContextAttrs();
|
app->initGLContextAttrs();
|
||||||
axis::GLViewImpl::convertAttrs();
|
ax::GLViewImpl::convertAttrs();
|
||||||
|
|
||||||
// Override point for customization after application launch.
|
// Override point for customization after application launch.
|
||||||
|
|
||||||
|
@ -84,8 +84,8 @@ static AppDelegate s_sharedApplication;
|
||||||
}
|
}
|
||||||
|
|
||||||
// IMPORTANT: Setting the GLView should be done after creating the RootViewController
|
// IMPORTANT: Setting the GLView should be done after creating the RootViewController
|
||||||
axis::GLView* glView = axis::GLViewImpl::createWithEAGLView((__bridge void*)_viewController.view);
|
ax::GLView* glView = ax::GLViewImpl::createWithEAGLView((__bridge void*)_viewController.view);
|
||||||
axis::Director::getInstance()->setOpenGLView(glView);
|
ax::Director::getInstance()->setOpenGLView(glView);
|
||||||
|
|
||||||
// run the cocos2d-x game scene
|
// run the cocos2d-x game scene
|
||||||
app->run();
|
app->run();
|
||||||
|
@ -102,7 +102,7 @@ static AppDelegate s_sharedApplication;
|
||||||
throttle down OpenGL ES frame rates. Games should use this method to pause the game.
|
throttle down OpenGL ES frame rates. Games should use this method to pause the game.
|
||||||
*/
|
*/
|
||||||
// We don't need to call this method any more. It will interrupt user defined game pause&resume logic
|
// We don't need to call this method any more. It will interrupt user defined game pause&resume logic
|
||||||
/* axis::Director::getInstance()->pause(); */
|
/* ax::Director::getInstance()->pause(); */
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)applicationDidBecomeActive:(UIApplication*)application
|
- (void)applicationDidBecomeActive:(UIApplication*)application
|
||||||
|
@ -112,7 +112,7 @@ static AppDelegate s_sharedApplication;
|
||||||
previously in the background, optionally refresh the user interface.
|
previously in the background, optionally refresh the user interface.
|
||||||
*/
|
*/
|
||||||
// We don't need to call this method any more. It will interrupt user defined game pause&resume logic
|
// We don't need to call this method any more. It will interrupt user defined game pause&resume logic
|
||||||
/* axis::Director::getInstance()->resume(); */
|
/* ax::Director::getInstance()->resume(); */
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)applicationDidEnterBackground:(UIApplication*)application
|
- (void)applicationDidEnterBackground:(UIApplication*)application
|
||||||
|
@ -122,7 +122,7 @@ static AppDelegate s_sharedApplication;
|
||||||
information to restore your application to its current state in case it is terminated later. If your application
|
information to restore your application to its current state in case it is terminated later. If your application
|
||||||
supports background execution, called instead of applicationWillTerminate: when the user quits.
|
supports background execution, called instead of applicationWillTerminate: when the user quits.
|
||||||
*/
|
*/
|
||||||
axis::Application::getInstance()->applicationDidEnterBackground();
|
ax::Application::getInstance()->applicationDidEnterBackground();
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)applicationWillEnterForeground:(UIApplication*)application
|
- (void)applicationWillEnterForeground:(UIApplication*)application
|
||||||
|
@ -131,7 +131,7 @@ static AppDelegate s_sharedApplication;
|
||||||
Called as part of transition from the background to the inactive state: here you can undo many of the changes made
|
Called as part of transition from the background to the inactive state: here you can undo many of the changes made
|
||||||
on entering the background.
|
on entering the background.
|
||||||
*/
|
*/
|
||||||
axis::Application::getInstance()->applicationWillEnterForeground();
|
ax::Application::getInstance()->applicationWillEnterForeground();
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)applicationWillTerminate:(UIApplication*)application
|
- (void)applicationWillTerminate:(UIApplication*)application
|
||||||
|
|
|
@ -46,8 +46,8 @@ customization that is not appropriate for viewDidLoad.
|
||||||
{
|
{
|
||||||
// Initialize the CCEAGLView
|
// Initialize the CCEAGLView
|
||||||
CCEAGLView* eaglView = [CCEAGLView viewWithFrame:[UIScreen mainScreen].bounds
|
CCEAGLView* eaglView = [CCEAGLView viewWithFrame:[UIScreen mainScreen].bounds
|
||||||
pixelFormat:(__bridge NSString*)axis::GLViewImpl::_pixelFormat
|
pixelFormat:(__bridge NSString*)ax::GLViewImpl::_pixelFormat
|
||||||
depthFormat:axis::GLViewImpl::_depthFormat
|
depthFormat:ax::GLViewImpl::_depthFormat
|
||||||
preserveBackbuffer:NO
|
preserveBackbuffer:NO
|
||||||
sharegroup:nil
|
sharegroup:nil
|
||||||
multiSampling:NO
|
multiSampling:NO
|
||||||
|
@ -93,7 +93,7 @@ customization that is not appropriate for viewDidLoad.
|
||||||
{
|
{
|
||||||
[super didRotateFromInterfaceOrientation:fromInterfaceOrientation];
|
[super didRotateFromInterfaceOrientation:fromInterfaceOrientation];
|
||||||
|
|
||||||
auto glView = axis::Director::getInstance()->getOpenGLView();
|
auto glView = ax::Director::getInstance()->getOpenGLView();
|
||||||
|
|
||||||
if (glView)
|
if (glView)
|
||||||
{
|
{
|
||||||
|
@ -102,7 +102,7 @@ customization that is not appropriate for viewDidLoad.
|
||||||
if (eaglView)
|
if (eaglView)
|
||||||
{
|
{
|
||||||
CGSize s = CGSizeMake([eaglView getWidth], [eaglView getHeight]);
|
CGSize s = CGSizeMake([eaglView getWidth], [eaglView getHeight]);
|
||||||
axis::Application::getInstance()->applicationScreenSizeChanged((int)s.width, (int)s.height);
|
ax::Application::getInstance()->applicationScreenSizeChanged((int)s.width, (int)s.height);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue