Projects > cpp > Issues > Bug #1229

We are migrating issue tracker of Cocos2d-x Project to Github, please create new issue there. Thanks.

Create Issue on Github

(gles20) android port can not be compiled on ndk android-8 level

Bug #1229 [Closed]
walzer 2012-05-05 01:53 . Updated almost 3 years ago

android-3 > Official Android 1.5 system images
> Official Android 1.6 system images
android-5 > Official Android 2.0 system images
> Official Android 2.0.1 system images
android-7 > Official Android 2.1 system images
> Official Android 2.2 system images
android-9 > Official Android 2.3 system images
> Official Android 2.3.3 system images
android-14 -> Official Android 4.0 system images

Currently in gles20 branch’s project.porperties, android-10 is required, which means 2.0 games can only run on android 2.3.3 or higher devices.

Finally I find that gles20 depends on android-9 and higher, coz CCEGLView includes EGL/egl.h, while android-8 has no EGL headers.
We depends EGL to get only 3 APIs,
# glGenVertexArraysOES
# glBindVertexArrayOES
# glDeleteVertexArraysOES
In CCGL.h, these 3 APIs are redefined

#define glDeleteVertexArrays        glDeleteVertexArraysOES
#define glGenVertexArrays           glGenVertexArraysOES
#define glBindVertexArray           glBindVertexArrayOES

And finally they are invoked in CCParticleSystemQuad.cpp & CCTextureAtlas.cpp, with a pre-condition that marco CC_TEXTURE_ATLAS_USE_VAO 1
CC_TEXTURE_ATLAS_USE_VAO marco is defined in ccConfig.h
/* Some android devices cannot support VAO very well, so we disable it by default for android platform. */
So it means on android platform CC_TEXTURE_ATLAS_USE_VAO 0, it’s disabled.

OK, so if your game is very performance-hungry, you can enable CC_TEXTURE_ATLAS_USE_VAO to run it faster, but your game is limited to android 2.3 and higher devices,
By default, we should disable CC_TEXTURE_ATLAS_USE_VAO to adapt games on wider range.

walzer 2012-05-05 02:05


Caution: OpenGL ES 2.0 is currently not supported by the Android Emulator. You must have a physical test device running Android 2.2 (API Level 8) or higher in order to run and test the example code in this tutorial.

walzer 2012-05-05 02:25
  • Status changed from New to Resolved
  • % Done changed from 0 to 100

Applied in changeset commit:435c74e52c5b18ae7e0f6257711e251330362881.

zhangxm 2012-05-07 09:10

>> OK, so if your game is very performance-hungry, you can enable CC_TEXTURE_ATLAS_USE_VAO to run it faster, but your game is limited to android 2.3 and higher devices,

No, Android can not work correctly if CC_TEXTURE_ATLAS_USE_VAO is set to 1.
It meas, Android dones’t support opengl es 20 very well.
You can not use these three opengl es functions on Android.

walzer 2012-05-08 05:49
  • Status changed from Resolved to Closed
walzer 2012-05-25 07:57
  • Project changed from cocos2d-x to cpp
  • Category deleted (2)
walzer 2012-05-25 07:58
  • Target version deleted (26)
walzer 2012-05-25 09:25
  • Target version set to cocos2d-2.0-rc0a-x-2.0

Atom PDF

Start date:2012-05-05
Due date:
% Done:


Target version:cocos2d-2.0-rc0a-x-2.0

Sign up for our newsletter to keep up with the latest developments, releases and updates for Cocos2d-x.