Works on Android

This commit is contained in:
Ricardo Quesada 2014-01-27 13:05:58 -08:00
parent 67b62224b4
commit 1f4ca2f0ad
10 changed files with 55 additions and 28 deletions

View File

@ -1,3 +1,7 @@
cocos2d-x-3.0rc0 Feb.??? 2014
[All]
[FIX] EGLView improvements: renamed to GLView, no longer a singleton, easier to customize
cocos2d-x-3.0beta2 Jan.24 2014
[All]
[NEW] Full screen support for desktop platforms.

View File

@ -17,12 +17,15 @@ AppDelegate::~AppDelegate()
{
}
bool AppDelegate::applicationDidFinishLaunching() {
bool AppDelegate::applicationDidFinishLaunching()
{
// initialize director
auto director = Director::getInstance();
auto glview = EGLView::createWithSize("Hello Cpp", Size(900,640));
auto glview = director->getOpenGLView();
if(!glview) {
auto glview = EGLView::createWithSize("Hello Cpp", Size(480, 720));
director->setOpenGLView(glview);
}
// Set the design resolution
glview->setDesignResolutionSize(designResolutionSize.width, designResolutionSize.height, ResolutionPolicy::NO_BORDER);

View File

@ -12,12 +12,14 @@ AppDelegate::~AppDelegate()
{
}
bool AppDelegate::applicationDidFinishLaunching() {
// initialize director
bool AppDelegate::applicationDidFinishLaunching()
{
auto director = Director::getInstance();
auto glview = EGLView::createWithSize("Simple Game", Size(900,640));
auto glview = director->getOpenGLView();
if(!glview) {
glview = EGLView::createWithSize("Simple Game", Size(900,640));
director->setOpenGLView(glview);
}
auto screenSize = glview->getFrameSize();
auto designSize = Size(480, 320);

View File

@ -33,8 +33,12 @@ bool AppDelegate::applicationDidFinishLaunching()
{
// initialize director
auto director = Director::getInstance();
auto glview = director->getOpenGLView();
if(!glview) {
auto glview = EGLView::createWithSize("CocosDragon JS", Size(480, 720));
director->setOpenGLView(glview);
}
director->setProjection(Director::Projection::_2D);

View File

@ -29,9 +29,12 @@ bool AppDelegate::applicationDidFinishLaunching()
{
// initialize director
auto director = Director::getInstance();
auto glview = director->getOpenGLView();
if(!glview) {
auto glview = EGLView::createWithSize("Crystal Craze", Size(480, 720));
director->setOpenGLView(glview);
}
director->setProjection(Director::Projection::_2D);
FileUtils::getInstance()->addSearchPath("script");

View File

@ -29,9 +29,12 @@ bool AppDelegate::applicationDidFinishLaunching()
{
// initialize director
auto director = Director::getInstance();
auto glview = director->getOpenGLView();
if(!glview) {
auto glview = EGLView::createWithSize("Moon Warriors", Size(480, 720));
director->setOpenGLView(glview);
}
director->setProjection(Director::Projection::_2D);
// Set the design resolution

View File

@ -38,9 +38,11 @@ bool AppDelegate::applicationDidFinishLaunching()
{
// initialize director
auto director = Director::getInstance();
auto glview = EGLView::createWithSize("Test JavaScript", Size(900,640));
auto glview = director->getOpenGLView();
if(!glview) {
glview = EGLView::createWithSize("Test JavaScript", Size(900,640));
director->setOpenGLView(glview);
}
// JS-Test in Html5 uses 800x450 as design resolution
glview->setDesignResolutionSize(800, 450, ResolutionPolicy::FIXED_HEIGHT);

View File

@ -29,8 +29,11 @@ bool AppDelegate::applicationDidFinishLaunching()
{
// initialize director
auto director = Director::getInstance();
auto glview = director->getOpenGLView();
if(!glview) {
auto glview = EGLView::createWithSize("Watermelon With Me", Size(900,640));
director->setOpenGLView(glview);
}
// turn on display FPS
director->setDisplayStats(true);

View File

@ -24,9 +24,11 @@ bool AppDelegate::applicationDidFinishLaunching()
{
// initialize director
auto director = Director::getInstance();
auto glview = director->getOpenGLView();
if(!glview) {
auto glview = EGLView::createWithSize("Hello Lua", Size(900,640));
director->setOpenGLView(glview);
}
glview->setDesignResolutionSize(480, 320, ResolutionPolicy::NO_BORDER);

View File

@ -19,11 +19,12 @@ AppDelegate::~AppDelegate()
bool AppDelegate::applicationDidFinishLaunching()
{
// initialize director
auto director = Director::getInstance();
auto glview = EGLView::createWithSize("Test Lua", Size(900,640));
auto glview = director->getOpenGLView();
if(!glview) {
glview = EGLView::createWithSize("Test Lua", Size(900,640));
director->setOpenGLView(glview);
}
// turn on display FPS
director->setDisplayStats(true);