使用模拟器的例子需要使用CMake+本地编译器编译,且需要安装PC端的OpenGL ES SDK。我安装了高通的Adreno SDK,但是用VS 2015编译成功后运行程序时崩溃,不知什么原因。Adreno号称支持OpenGL ES 3.0, 但是lib里只有2.0的。不知道是不是OpenGL ES版本不对造成的崩溃。
例子:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
$ cd opengles3-book/Chapter_2/Hello_Triangle/Android/jni $ ndk-build [armeabi] Compile thumb : Hello_Triangle <= esShader.c [armeabi] Compile thumb : Hello_Triangle <= esShapes.c [armeabi] Compile thumb : Hello_Triangle <= esTransform.c [armeabi] Compile thumb : Hello_Triangle <= esUtil.c [armeabi] Compile thumb : Hello_Triangle <= esUtil_Android.c [armeabi] Compile thumb : Hello_Triangle <= Hello_Triangle.c [armeabi] Compile thumb : android_native_app_glue <= android_native_app_glue.c [armeabi] StaticLibrary : libandroid_native_app_glue.a [armeabi] SharedLibrary : libHello_Triangle.so [armeabi] Install : libHello_Triangle.so => libs/armeabi/libHello_Triangle.so