在Android上的OpenGL只

在Android上的OpenGL只

本文介绍了用C ++在Android上的OpenGL只的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发一个Android应用程序为Android 2.1。

I'm developing an Android application for Android 2.1.

我想code的OpenGL的东西与C ++只。

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?

更新

对不起,我忘了说我将使用Java主应用程序启动的主要活动。

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

我想说,如果我要对Java的glSurfaceView或本声明code必须是在C ++ code。

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

好,更好地解释:如果我有一个完整的OpenGL在C ++中,我必须修改C ++ code?

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

感谢。

推荐答案

在Android NDK有样本目录,显示断下,SAN-洛杉矶演示使用OpenGL ES 1.x中使用C code和Java包装。至于修改已经存在的C ++ code要知道,没有官方的STL实现的NDK R4(虽然我相信有一些可用的端口) 。我猜你需要模拟演示做了GLSurfaceView什么,因为之外的事件(触摸,键盘等)伴随着Android活动的生命周期必须是由Java端处理。如果你正在寻找一个OpenGL ES 2.0的例子,有一个基本的在Android NDK的样本目录中。

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.

这篇关于用C ++在Android上的OpenGL只的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-20 03:32