Install OpenGL ES and compile code for android

前端 未结 4 1282
天涯浪人
天涯浪人 2021-02-15 14:27

I\'ve just started learning OpenGL ES on android (using this book) and came across an issue of adopting source code from chapter 5 to existing methods of using jni in android (a

4条回答
  •  春和景丽
    2021-02-15 14:38

    I just added

    #include 
    

    to cube.c & cuberenderer.c

    Changed

    (*g_VM)->AttachCurrentThread (g_VM, (void **) &env, NULL);
    

    to

    (*g_VM)->AttachCurrentThread (g_VM, (const struct JNINativeInterface ***) &env, NULL);
    

    My Android.mk:

    LOCAL_PATH:= $(call my-dir)
    
    include $(CLEAR_VARS)
    
    LOCAL_MODULE    := libgltest_jni
    LOCAL_CFLAGS    := -Werror
    LOCAL_SRC_FILES := cube.c cuberenderer.c
    LOCAL_LDLIBS    := -llog
    -lGLESv1_CM
    
    include $(BUILD_SHARED_LIBRARY)
    

    My Application.mk:

    # The ARMv7 is significanly faster due to the use of the hardware FPU
    APP_ABI := armeabi armeabi-v7a
    APP_PLATFORM := android-9
    

    And built it on android-ndk-r6

提交回复
热议问题