I tried according to your advice but when I compiled my native code
using Cygwin, I got errors like below:
MYPC@MYPC-PC /cygdrive/c/android-ndk-r5b/samples/hello-gl2
$ ndk-build
Compile++ thumb : gl2jni <= gl_code.cpp
C:/android-ndk-r5b/samples/hello-gl2/jni/gl_code.cpp: In function
'GLuint loadShader(GLenum, const char*)':
C:/android-ndk-r5b/samples/hello-gl2/jni/gl_code.cpp:58: error:
'glCreateShader' was not declared in this scope
C:/android-ndk-r5b/samples/hello-gl2/jni/gl_code.cpp:60: error:
'glShaderSource' was not declared in this scope
C:/android-ndk-r5b/samples/hello-gl2/jni/gl_code.cpp:61: error:
'glCompileShader' was not declared in this scope
C:/android-ndk-r5b/samples/hello-gl2/jni/gl_code.cpp:63: error:
'GL_COMPILE_STATUS' was not declared in this scope
C:/android-ndk-r5b/samples/hello-gl2/jni/gl_code.cpp:63: error:
'glGetShaderiv' was not declared in this scope
C:/android-ndk-r5b/samples/hello-gl2/jni/gl_code.cpp:66: error:
'GL_INFO_LOG_LENGTH' was not declared in this scope
C:/android-ndk-r5b/samples/hello-gl2/jni/gl_code.cpp:70: error:
'glGetShaderInfoLog' was not declared in this scope
C:/android-ndk-r5b/samples/hello-gl2/jni/gl_code.cpp:75: error:
'glDeleteShader' was not declared in this scope
C:/android-ndk-r5b/samples/hello-gl2/jni/gl_code.cpp: In function
'GLuint createProgram(const char*, const char*)':
C:/android-ndk-r5b/samples/hello-gl2/jni/gl_code.cpp:84: error:
'GL_VERTEX_SHADER' was not declared in this scope
C:/android-ndk-r5b/samples/hello-gl2/jni/gl_code.cpp:89: error:
'GL_FRAGMENT_SHADER' was not declared in this scope
C:/android-ndk-r5b/samples/hello-gl2/jni/gl_code.cpp:94: error:
'glCreateProgram' was not declared in this scope
C:/android-ndk-r5b/samples/hello-gl2/jni/gl_code.cpp:96: error:
'glAttachShader' was not declared in this scope
C:/android-ndk-r5b/samples/hello-gl2/jni/gl_code.cpp:100: error:
'glLinkProgram' was not declared in this scope
C:/android-ndk-r5b/samples/hello-gl2/jni/gl_code.cpp:102: error:
'GL_LINK_STATUS' was not declared in this scope
C:/android-ndk-r5b/samples/hello-gl2/jni/gl_code.cpp:102: error:
'glGetProgramiv' was not declared in this scope
C:/android-ndk-r5b/samples/hello-gl2/jni/gl_code.cpp:105: error:
'GL_INFO_LOG_LENGTH' was not declared in this scope
C:/android-ndk-r5b/samples/hello-gl2/jni/gl_code.cpp:109: error:
'glGetProgramInfoLog' was not declared in this scope
C:/android-ndk-r5b/samples/hello-gl2/jni/gl_code.cpp:114: error:
'glDeleteProgram' was not declared in this scope
C:/android-ndk-r5b/samples/hello-gl2/jni/gl_code.cpp: In function
'bool setupGraphics(int, int)':
C:/android-ndk-r5b/samples/hello-gl2/jni/gl_code.cpp:136: error:
'glGetAttribLocation' was not declared in this scope
C:/android-ndk-r5b/samples/hello-gl2/jni/gl_code.cpp: In function
'void renderFrame()':
C:/android-ndk-r5b/samples/hello-gl2/jni/gl_code.cpp:160: error:
'glUseProgram' was not declared in this scope
C:/android-ndk-r5b/samples/hello-gl2/jni/gl_code.cpp:163: error:
'glVertexAttribPointer' was not declared in this scope
C:/android-ndk-r5b/samples/hello-gl2/jni/gl_code.cpp:165: error:
'glEnableVertexAttribArray' was not declared in this scope
make: *** [/cygdrive/c/android-ndk-r5b/samples/hello-gl2/obj/local/
armeabi/objs/gl2jni/gl_code.o] Error 1
-----------------------------------------------------------------------------------------------------------------------------------------------------
I have replaced the gl2 headers with gl & in Android.mk file, I
changed the gles library as below:
LOCAL_LDLIBS := -llog -lGLESv1
But still all my efforts goes in vain..
Rgds/ Atul Prakash Singh
On Apr 26, 3:00 pm, mic _ <
micol...@gmail.com> wrote:
> I can't verify it as I don't have the NDK set up on this computer, but I
> don't see why that wouldn't work. Just replace the gl2 headers with gl,
> change the gles library that is linked against in the makefile, and remove
> the shader stuff in the source code. You might have to add a call glColor in
> the render method before you draw the vertices, since the color is set in
> the fragment shader in the gles 2.0 version.
>
> /Michael
>