ISSUE: Coordinates are upside down

Hi,

I decided to create a hybrid Win32 and Android project. Here are the steps. However my Android project runs upside down, they appear to be rotated by 90º ClockWise . I have posted all images and settings used. Please advice on proper course of action.

Win32 Project

  1. Created my Win32 “winand” Project using the Wizard on Visual Studio 2010. Sound and Box2D (default settings).

  2. Changed one string “Hello World” to “Hello World WinANDROID” and size to 32.

  3. Build my Win32 project

  4. Test by Run project. Works perfect.

Android Project

  1. Rename Win32 Folder to “winand_TEMP”
  2. Use script: create-android-project.bat to create a folder with the previous name
  • package name: org.cocos2d.winand
  • project name: winand
  1. copy android folder into winand_TEMP
  2. remove winand
  3. rename winand_TEMP to winand
  4. open Cygwin batch shell and navigate to …/winand/android folder
  5. build project using ./build_native.sh

ERRORS:

Compile thumb  : stlport_static <= c_locale.c
Compile thumb  : stlport_static <= cxa.c
StaticLibrary  : libstdc++.a
make: Circular /cygdrive/c/Users/dan/Downloads/cocos2d-1.0.1-x-0.9.2/cocos2d-1.0
.1-x-0.9.2/winand/android/obj/local/armeabi/libstlport_static.a <- /cygdrive/c/U
sers/dan/Downloads/cocos2d-1.0.1-x-0.9.2/cocos2d-1.0.1-x-0.9.2/winand/android/ob
j/local/armeabi/libstlport_static.a dependency dropped.
StaticLibrary  : libstlport_static.a
SharedLibrary  : libcocos2d.so
Install        : libcocos2d.so => libs/armeabi/libcocos2d.so
Compile++ thumb  : cocosdenshion <= SimpleAudioEngine.cpp
Compile++ thumb  : cocosdenshion <= SimpleAudioEngineJni.cpp
SharedLibrary  : libcocosdenshion.so
Install        : libcocosdenshion.so => libs/armeabi/libcocosdenshion.so
Compile++ thumb  : game <= main.cpp
Compile++ thumb  : game <= AppDelegate.cpp
In file included from C:/Users/dan/Downloads/cocos2d-1.0.1-x-0.9.2/cocos2d-1.0.1
-x-0.9.2/winand/android/jni/helloworld/../../../Classes/AppDelegate.cpp:8:
C:/Users/dan/Downloads/cocos2d-1.0.1-x-0.9.2/cocos2d-1.0.1-x-0.9.2/winand/androi
d/jni/helloworld/../../../Classes/HelloWorldScene.h:6:25: error: Box2D/Box2D.h:
No such file or directory
make: *** [/cygdrive/c/Users/dan/Downloads/cocos2d-1.0.1-x-0.9.2/cocos2d-1.0.1-x
-0.9.2/winand/android/obj/local/armeabi/objs-debug/game/../../../Classes/AppDele
gate.o] Error 1
make: Leaving directory `/cygdrive/c/Users/dan/Downloads/cocos2d-1.0.1-x-0.9.2/c
ocos2d-1.0.1-x-0.9.2/winand/android'

It appears that Box2D can’t be found. OK looking at the error code it wants Box2D inside the …/winand/Classes. OK let’s do that!
8) Copy Box2D folder from root cocos2d-x into …/winand/Classes.
9) Start Eclipse, create New Android Project, create project from existing source, point it to …/winand/android and select the SDK API level.
10) Build the package
11) Connect USB Device.
12) Run as Android Application.

Application starts but there are some issues, the application runs upside down.

Image Capture from Samsung Galaxy S i9000

This is the manifest file

I think I find the mistake, AppDelegate.cpp generated by msvc template is wrong.
It uses old version.
So you should copy android folder and Classes folder into winand_TEMP.

Yep that is it. Thanks! I fixed my AppDelegate.cpp to use

//Android does not need setup. It uses XML
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32)
// sets landscape mode
pDirector->setDeviceOrientation(kCCDeviceOrientationLandscapeLeft);
#endif // CC_PLATFORM_WIN32

perhaps it would be worth patching the …2d-1.0.1-x-0.10.0\template\msvc\CCAppWiz.win32\Templates\1033\Classes\AppDelegate.cpp Template so that there isn’t an issue any more. Also it may be worth merging all changes on the generated AppDelegates so that 0.11.0 we can build hybrid projects with ease.

#915 is created for it.
Thank you.

Hi!

In lieu to the setup of Cocos2d-x wiht Visual Studio. is there a way where in I will be creating cocos2d-x android project using vs-android directly?

Thanks!