Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android - tutorials for OpenGL ES 2.0 using the NDK?

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?

like image 613
KaiserJohaan Avatar asked Dec 20 '11 15:12

KaiserJohaan


People also ask

What is the difference between OpenGL and OpenGL ES?

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).

What is OpenGL es2?

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.

Can Android run OpenGL?

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.

Can I update OpenGL version Android?

You can't. You need to have a supported GPU which implements OGL 4.1 at the driver level.


2 Answers

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

like image 53
tsaarni Avatar answered Oct 14 '22 11:10

tsaarni


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.

like image 43
user2275545 Avatar answered Oct 14 '22 09:10

user2275545