How to convert an Open GL ES 2.0 application to a Live Wallpaper?

南笙酒味 提交于 2019-12-04 17:22:08

Ok, got it! If you use the source from http://www.rbgrn.net/content/354-glsurfaceview-adapted-3d-live-wallpapers (And thank you very much to Robert Green for this!!)

For whatever reason I had to fix a few syntax errors, I suspect this is from having a newer version of Eclipse or whatever since the original was written.

To enable OpenGL ES 2.0 though, you need to make two changes. In the constructor of ComponentSizeChooser add

EGL10.EGL_RENDERABLE_TYPE, 4, 

To the super call. Also in createContext in DefaultContextFactory replace the null with

new int[] { 0x3098, 2, EGL10.EGL_NONE }

And that should have you enabled for GL ES 2.0.

Also, additionally, on his webpage, he has 'setRenderMode(RENDERMODE_WHEN_DIRTY);' I suspect most will want this to be 'setRenderMode(RENDERMODE_CONTINUOUSLY);'

Full code is available Here.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!