OpenGL on Android using only C ++

I am developing an Android application for Android 2.1.

I am trying to encode OpenGL objects only with C ++.

Do you know a tutorial or article showing an example on how to do this?

UPDATE :

Sorry, I forgot to say that I will use the home Java application to start the main action.

I am trying to say whether I should encode Java glSurfaceView, or this operator should be in C ++ code.

Ok, better explained: if I have full openGl in C ++, can I change the code in C ++?

Thanks.

+7
c ++ android opengl-es
source share
2 answers

Android NDK has a san-angeles demo under the samples directory, which shows the use of OpenGL ES 1.x in C code and the Java shell. Regarding changes to existing C ++ code, keep in mind that there is no official STL implementation for NDK r4 (although I believe there are some ports available) [edit: there is an STL version of STL with NDK r5]. And I suppose that you will need to imitate what the demo for GLSurfaceView does, since external events (touch, keyboard, etc.) Together with the Android activity life cycle should be handled by the Java side. If you are looking for an OpenGL ES 2.0 example, there is a basic one in the Android NDK sample directory.

+8
source share

According to http://developer.android.com/sdk/ndk , you cannot do this exclusively in C ++. As you suggest in your update, you will need to make an application with a standard (Java) SDK, but it can create C ++ libraries and call them. Regarding OpenGL, the article assumes that you have full access to OpenGL ES, either 1.1 or 2.0. ES does not match full OpenGL.

+2
source share

All Articles