【问题标题】:Android live wallpaper using opengl使用opengl的Android动态壁纸
【发布时间】:2013-08-05 05:46:18
【问题描述】:

我在android中创建了一个opengl动画,GlRenderer.java用于渲染我创建的动画

现在在 Glrenderer.java 公共类 GlRenderer 扩展 GLSurfaceView 实现 Renderer

当用作活动时,动画效果很好,但是当我尝试使用 GLWallpaperService 运行它时,它会出错。

为了将其设置为墙纸,我必须实现 GLWallpaperService 如**public class GlRenderer extends GLSurfaceView implements Renderer, GLWallpaperService** 它给出了错误*类型 GLWallpaperService 不能是 GlRenderer 的超接口;超接口必须是接口*

我还在安卓清单中添加了正在使用动态壁纸服务

【问题讨论】:

    标签: android live-wallpaper opengl-es-1.1


    【解决方案1】:

    你应该遵循以下方法。

    Approach 1: Using GLSurfaceView inside a live wallpaper
    Approach 2: Using a custom live wallpaper based on the internals of GLSurfaceView 
    

    所有示例和教程的建议链接。

    http://www.learnopengles.com/how-to-use-opengl-es-2-in-an-android-live-wallpaper/
    

    我发现可以在动态壁纸中使用 GLSurfaceView 的第一个证据来自 Ben Gruver 的这些文件:

    https://github.com/JesusFreke/Penroser/blob/master/src/org/jf/GLWallpaper/GLWallpaperService.java
    https://github.com/JesusFreke/Penroser/blob/master/src/org/jf/Penroser/PenroserLiveWallpaper.java 
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-05-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多