开发者

OpenGL on Android using C++ only [closed]

开发者 https://www.devze.com 2023-01-23 04:32 出处:网络
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.

We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.

开发者_Go百科

Closed 4 years ago.

Improve this question

I'm developing an Android application for Android 2.1.

I'm trying to code OpenGL's stuff with C++ only.

Do you know a tutorial or an article showing an example about how to do that?

UPDATE:

Sorry, I've forget to say that I will use a Java home application to launch main activity.

I'm trying to say if I have to code on Java glSurfaceView or this statement must be on C++ code.

Ok, better explained: If I have a complete openGl on C++, may I have to modify C++ code?

Thanks.


In the Android NDK there is a san-angeles demo under the samples directory which shows off using OpenGL ES 1.x in C code and a Java wrapper. As for changes to already existing C++ code be aware that there is no official STL implementation for the NDK r4 (although I believe there are some ports available) [edit: as of NDK r5 there is a STLport based implementation of STL]. And I'm guessing that you'll need to mimic what the demo does for the GLSurfaceView since outside events (touch, keyboard, etc.) along with the Android activity lifecycle must be to be handled by the Java side. If you are looking for a OpenGL ES 2.0 example, there is a basic one in the samples directory of the Android NDK as well.


According to http://developer.android.com/sdk/ndk you can't do it purely in C++. As you suggest in your update, you'll need to do the application with the standard (Java) SDK, but can create C++ libraries and call into them. With respect to OpenGL, the article suggests that you have full access to OpenGL ES, either 1.1 or 2.0. ES is not the same as the full OpenGL.


Try Arm Developer Center link. It has native tutorials on basics of an OpenGL ES application.

0

精彩评论

暂无评论...
验证码 换一张
取 消