使用android studio搭建简单jni层的opengl

2020-07-10  本文已影响0人  James999

上层code Java 通过jni 调用 c 完成三角形的渲染, shader代码保存在assets。

代码结构

image.png

遇到的问题

  1. 要用到assetmanager 所以导入android
  2. 如果使用的是opengles 3.0版本,则需要导入GLESv3,
target_link_libraries( # Specifies the target library.
                       # native-lib
                       JNIOpenGLES30
                       GLESv3
                       # Links the target library to the log library
                       # included in the NDK.
                       android
                       ${log-lib} )

githup code

https://github.com/yuzhimin999/NDKOpenGlDemo

学习研究

REF

https://blog.csdn.net/peng_weida/article/details/45200241
https://blog.csdn.net/zhangpengzp/article/details/88714034

上一篇 下一篇

猜你喜欢

热点阅读