的Andr​​oid NDK和渲染,以动态壁纸 [英] Android NDK and rendering to live wallpapers

查看:129
本文介绍了的Andr​​oid NDK和渲染,以动态壁纸的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是环顾开始学习NDK,在考虑某个特定项目:

I'm just looking around for starting learning NDK, with one particular project in mind:

我要不断地渲染来自NDK方不断变化的位图,以便能够显示它在一个活的壁纸。

I want to continually render a changing bitmap from NDK side to be able to show it in a live wallpaper.

(所以我不是在谈论渲染到OpenGL的纹理在这里,而是呈现为位图)

(hence I'm not talking about rendering to OpenGL texture here, but about rendering to a Bitmap)

我用Google搜索了一下,发现有一个选项,以直接操纵位图的像素。但我也发现,文档中说,此功能只有缴费由于Android 2.2。 我想,以支持2.1在我居住的壁纸。

I googled a bit and found out that there's an option to directly manipulate a Bitmap pixels. But I also found that documentation says that this feature is avaiable only since Android 2.2. And I'd like to support 2.1 in my live wallpaper.

在另一方面,我发现了几个项目做类似的东西 - 渲染从NDK的东西,并显示在动态壁纸。他们在2.1工作。例子有:精彩视频动态壁纸,我认为的动摇他们所有的动态壁纸做同样的东西。

On the other hand I found several projects that do similar stuff - render something from ndk and show it in live wallpaper. And they work on 2.1. Examples are: wonderful Video Live Wallpaper, and I think Shake Them All Live Wallpaper does the same kind of stuff.

所以,问题是 - 我失去了一些其他的方式做持续呈现为LW比直接操作位图数据的其他? 或者一些其他的事情我错了吗? :)

So the question is - am I missing some other way to do continuous rendering to LW other than direct manipulation of Bitmap data? Or some other thing I got wrong? :)

推荐答案

据我所知,那些渲染与NDK和使用等项目 jnigraphics 之前, 2.2实际上包括在项目库中,并加载它作为一个3-第三方库。

As far as I know, the other projects that do rendering with the NDK and use jnigraphics prior to 2.2 actually include that library in the project and load it as a 3-rd party library.

preBUILT_SHARED_LIBRARY 的说明Android的NDK-R5B /文档/ ANDROID-MK.html 有关如何做到这一点的详细信息。

See the description of PREBUILT_SHARED_LIBRARY in android-ndk-r5b/docs/ANDROID-MK.html for more information on how to do that.

您可以在jnigraphics:

You can find jnigraphics in:

android-ndk-r5b/platforms/android-8/arch-arm/usr/lib/libjnigraphics.so

当然,我不知道它实际上允许重新分配NDK(也许别人可以在这个权衡)的一部分,但显然使用唯一的滞留 jnigraphics 之前的Andr​​oid 2.2很简单的事实,即它不是present早期版本。

Of course, I don't know if it's actually permissible to redistribute part of the NDK (maybe someone else can weigh in on this), but apparently the only holdup with using jnigraphics prior to Android 2.2 is simply the fact that it's not present in earlier releases.

希望有所帮助。

这篇关于的Andr​​oid NDK和渲染,以动态壁纸的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆