I'm looking to learn OpenGL ES 2.0
on Android and the tutorials I've found are nearly all for using the SDK with Java
. I want to use native code however so I want to do it through the NDK.
The only tutorial/example I've found is the sample-stuff in the NDK
itself.
Where can I find some NDK OpenGL ES 2.0
tutorials?
If there are no good tutorials out there, is it possible to use the Java OpenGL
tutorials to learn how to use it in the NDK as well? For example do the methods map 1:1 from java to native?
The main difference between the two is that OpenGL ES is made for embedded systems like smartphones, while OpenGL is the one on desktops. On the coding level, OpenGL ES does not support fixed-function functions like glBegin/glEnd etc... OpenGL can support fixed-function pipeline (using a compatibility profile).
OpenGL ES provides a fast way to display the camera images, possibly after some image processing, and allows building simple user interfaces. In this section, we only cover 2D graphics using OpenGL ES 2.0.
The OpenGL ES 1.0 and 1.1 API specifications have been supported since Android 1.0. Beginning with Android 2.2 (API level 8), the framework supports the OpenGL ES 2.0 API specification. OpenGL ES 2.0 is supported by most Android devices and is recommended for new applications being developed with OpenGL.
You can't. You need to have a supported GPU which implements OGL 4.1 at the driver level.
I've created an example on how to combine UI done in Java with native NDK code that does all the OpenGL rendering. It is possible to do without resorting to GLSurfaceView and JNI calls for rendering each frame like done in the NDK sample.
See the code at https://github.com/tsaarni/android-native-egl-example
Check this link. It concerns NDK and OpenGL issues, as well as several other related to game engine programming and more. I find it very interesting and helpful.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With