2013-05-05 15:01:15 +08:00
|
|
|
/****************************************************************************
|
|
|
|
Copyright (c) 2013 cocos2d-x.org
|
|
|
|
Copyright (c) 2013 Lee, Jae-Hong
|
|
|
|
|
|
|
|
http://www.cocos2d-x.org
|
|
|
|
|
|
|
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
of this software and associated documentation files (the "Software"), to deal
|
|
|
|
in the Software without restriction, including without limitation the rights
|
|
|
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
copies of the Software, and to permit persons to whom the Software is
|
|
|
|
furnished to do so, subject to the following conditions:
|
|
|
|
|
|
|
|
The above copyright notice and this permission notice shall be included in
|
|
|
|
all copies or substantial portions of the Software.
|
|
|
|
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
|
|
THE SOFTWARE.
|
|
|
|
****************************************************************************/
|
|
|
|
|
2013-05-05 14:42:01 +08:00
|
|
|
//
|
|
|
|
// This file contains the Tizen application entry point.
|
|
|
|
//
|
|
|
|
#include "../../Classes/AppDelegate.h"
|
|
|
|
#include "cocos2d.h"
|
|
|
|
|
|
|
|
USING_NS_CC;
|
|
|
|
using namespace Tizen::Base;
|
|
|
|
using namespace Tizen::Base::Collection;
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C"
|
|
|
|
{
|
|
|
|
#endif // __cplusplus
|
|
|
|
|
|
|
|
void
|
|
|
|
ApplicationInitialized(void)
|
|
|
|
{
|
|
|
|
AppDelegate* pAppDelegate = new AppDelegate;
|
|
|
|
|
2013-06-20 14:17:10 +08:00
|
|
|
EGLView* eglView = EGLView::sharedOpenGLView();
|
2013-05-06 20:37:51 +08:00
|
|
|
eglView->setFrameSize(1280, 720);
|
2013-05-05 14:42:01 +08:00
|
|
|
|
2013-06-20 14:17:10 +08:00
|
|
|
Application::sharedApplication()->run();
|
2013-05-05 14:42:01 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// The entry function of Tizen application called by the operating system.
|
|
|
|
//
|
|
|
|
_EXPORT_ int
|
|
|
|
OspMain(int argc, char *pArgv[])
|
|
|
|
{
|
2013-05-06 18:44:54 +08:00
|
|
|
AppLog("Application started.");
|
|
|
|
ArrayList args(SingleObjectDeleter);
|
|
|
|
args.Construct();
|
|
|
|
for (int i = 0; i < argc; i++)
|
|
|
|
{
|
|
|
|
args.Add(new (std::nothrow) String(pArgv[i]));
|
|
|
|
}
|
2013-05-05 14:42:01 +08:00
|
|
|
|
2013-06-20 14:17:10 +08:00
|
|
|
OspApplication::SetApplicationInitializedCallback(ApplicationInitialized);
|
|
|
|
OspApplication::SetScreenOrientation(Tizen::Ui::ORIENTATION_LANDSCAPE);
|
|
|
|
result r = Tizen::App::Application::Execute(OspApplication::CreateInstance, &args);
|
2013-05-06 18:44:54 +08:00
|
|
|
TryLog(r == E_SUCCESS, "[%s] Application execution failed", GetErrorMessage(r));
|
|
|
|
AppLog("Application finished.");
|
2013-05-05 14:42:01 +08:00
|
|
|
|
2013-05-06 18:44:54 +08:00
|
|
|
return static_cast<int>(r);
|
2013-05-05 14:42:01 +08:00
|
|
|
}
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif // __cplusplus
|