We are migrating issue tracker of Cocos2d-x Project to Github, please create new issue there. Thanks.
(gles20) android port can not be compiled on ndk android-8 level
(gles20) android port can not be compiled on ndk android-8 level
from http://developer.android.com/resources/tutorials/opengl/opengl-es20.html
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.
- Status changed from New to Resolved
- % Done changed from 0 to 100
Applied in changeset commit:435c74e52c5b18ae7e0f6257711e251330362881.
>> 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.
- Status changed from Resolved to Closed
- Project changed from cocos2d-x to cpp
- Category deleted (
2)
- Target version deleted (
26)
- Target version set to cocos2d-2.0-rc0a-x-2.0
Status: | Closed | |
---|---|---|
Start date: | 2012-05-05 | |
Priority: | Normal | |
Due date: | ||
Assignee: | ||
% Done: | 100% |
|
Category: | - | |
Target version: | cocos2d-2.0-rc0a-x-2.0 |
android-3
> Official Android 1.5 system images> Official Android 1.6 system imagesandroid-4
android-5
> Official Android 2.0 system images> Official Android 2.0.1 system imagesandroid-6
android-7
> Official Android 2.1 system images> Official Android 2.2 system imagesandroid-8
android-9
> Official Android 2.3 system images> Official Android 2.3.3 system imagesandroid-10
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.
THIS IS UNACCEPTABLE.
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
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
<pre>
#ifndef CC_TEXTURE_ATLAS_USE_VAO
#if (CC_TARGET_PLATFORM CC_PLATFORM_IOS) || (CC_TARGET_PLATFORM CC_PLATFORM_WIN32)
#define CC_TEXTURE_ATLAS_USE_VAO 1
#else
/* Some android devices cannot support VAO very well, so we disable it by default for android platform. */
#define CC_TEXTURE_ATLAS_USE_VAO 0
#endif
#endif
</pre>
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.