如何创建 OpenGL 动态壁纸?
我正在尝试找到创建 Android OpenGL 动态壁纸的正确方法,即一种将使用 GLSurfaceView 编写的应用程序转换为动态壁纸的方法。令人惊讶的是,Android 官方文档中似乎没有任何关于此的内容,而且也不清楚该怎么做。
我在其他地方发现了一些关于此问题的讨论,其中大多数最终链接到 Android 开发人员编写的以下代码: http://www.rbgrn.net/content/354-glsurfaceview -adapted-3d-live-wallpapers
但是,页面上的评论表明代码存在问题(内存泄漏、锁定)。有谁知道有什么替代方案吗?如果我将壁纸上传到市场,我显然希望避免因错误代码引起的投诉。
I'm trying to find the right approach for creating an Android OpenGL live wallpaper i.e. a way to convert an app written to use GLSurfaceView into a live wallpaper. There appears to be nothing in the official Android documentation about this surprisingly and it's not obvious what to do.
I've found a few discussions about this elsewhere where most end up linking to the following code written an Android developer:
http://www.rbgrn.net/content/354-glsurfaceview-adapted-3d-live-wallpapers
However, the comments on the page suggest there are problems with the code (memory leaks, lock ups). Does anyone know of any alternatives? If I upload a wallpaper to the market, I'd obviously like to avoid complaints caused by buggy code.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我找到了一个可能对您有帮助的开源示例。
http://code.google.com/p/android-deep-wallpaper/
另外,看起来像是使用 open GL,GL ES 代码需要从不同的线程调用。
希望这有帮助:D
I found an open source example that may help you.
http://code.google.com/p/android-deep-wallpaper/
also, it looks like to use open GL, the GL ES code needs to be called from a different thread.
hope this helps :D
有一个用于为 Android 构建 OpenGL 动态壁纸的库,称为 GLWallpaperService。您可以在 GitHub 上的 GLWallpaperService 找到。它包含您在 rbgrn.net 上链接到的代码,但包含一些错误修复。还有一些可用的替代实现。祝你好运。
There is a library for building OpenGL Live Wallpapers for Android called GLWallpaperService. You can find GLWallpaperService on GitHub. It includes the code you linked to on rbgrn.net but with a few bug fixes included. There are some alternate implementations available as well. Good luck.