From f70855e959370e8363407c33d609eb798b20bad0 Mon Sep 17 00:00:00 2001 From: Walzer Date: Sat, 5 May 2012 10:06:41 +0800 Subject: [PATCH] fixed #1229, reduce the requirement of gles20 branch from NDK android-10 to android-8 level (official android 2.2 image, the lowest version which supports OpenGL ES 2.0), remove EGL dependency. --- cocos2dx/Android.mk | 3 +-- cocos2dx/platform/android/CCEGLView.cpp | 15 ++++++++++----- tests/proj.android/project.properties | 2 +- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/cocos2dx/Android.mk b/cocos2dx/Android.mk index cf089b11a8..1e458304c8 100644 --- a/cocos2dx/Android.mk +++ b/cocos2dx/Android.mk @@ -170,8 +170,7 @@ LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/ \ LOCAL_EXPORT_LDLIBS := -llog\ -lz \ - -lGLESv2 \ - -lEGL + -lGLESv2 LOCAL_C_INCLUDES := $(LOCAL_PATH)/ \ $(LOCAL_PATH)/actions \ diff --git a/cocos2dx/platform/android/CCEGLView.cpp b/cocos2dx/platform/android/CCEGLView.cpp index 21cbee45c7..0fe313fd62 100644 --- a/cocos2dx/platform/android/CCEGLView.cpp +++ b/cocos2dx/platform/android/CCEGLView.cpp @@ -30,18 +30,23 @@ THE SOFTWARE. #include "jni/MessageJni.h" #include -#include "CCGL.h" -#include #include +#include "CCGL.h" -PFNGLGENVERTEXARRAYSOESPROC glGenVertexArraysOESEXT = 0; -PFNGLBINDVERTEXARRAYOESPROC glBindVertexArrayOESEXT = 0; -PFNGLDELETEVERTEXARRAYSOESPROC glDeleteVertexArraysOESEXT = 0; + +#if CC_TEXTURE_ATLAS_USE_VAO + #include + PFNGLGENVERTEXARRAYSOESPROC glGenVertexArraysOESEXT = 0; + PFNGLBINDVERTEXARRAYOESPROC glBindVertexArrayOESEXT = 0; + PFNGLDELETEVERTEXARRAYSOESPROC glDeleteVertexArraysOESEXT = 0; +#endif void initExtensions() { +#if CC_TEXTURE_ATLAS_USE_VAO glGenVertexArraysOESEXT = (PFNGLGENVERTEXARRAYSOESPROC)eglGetProcAddress("glGenVertexArraysOES"); glBindVertexArrayOESEXT = (PFNGLBINDVERTEXARRAYOESPROC)eglGetProcAddress("glBindVertexArrayOES"); glDeleteVertexArraysOESEXT = (PFNGLDELETEVERTEXARRAYSOESPROC)eglGetProcAddress("glDeleteVertexArraysOES"); +#endif } NS_CC_BEGIN diff --git a/tests/proj.android/project.properties b/tests/proj.android/project.properties index f049142c17..ea89160e01 100644 --- a/tests/proj.android/project.properties +++ b/tests/proj.android/project.properties @@ -8,4 +8,4 @@ # project structure. # Project target. -target=android-10 +target=android-8