OpenGL and Live Wallpapers

Problems with Canvas, OpenGL, etc...

OpenGL and Live Wallpapers

Postby Resilient » Wed Jun 02, 2010 4:35 am

Does anyone know if there is a good method of implementing OpenGL in live wallpapers? I have seen a method from Robert Greens blog that has some issues with memory leaks currently.

Has anyone here successfully implemented a live wallpaper with OpenGL? If so what was your approach?
Resilient
Junior Developer
Junior Developer
 
Posts: 15
Joined: Tue May 18, 2010 1:33 am

Top

Re: OpenGL and Live Wallpapers

Postby oceand » Sat Jun 19, 2010 4:34 am

I've had some success with OpenGL and live wallpapers. I didn't really care for the implementation in the blog you mentioned, however there really isn't a better way to do it that I've found.

The GL ES code needs to be called from a separate thread which means you have to handle state changes in your rendering loop. This really isn't a big deal except I don't believe live wallpapers were ever intended to use the GL hardware.

I've come across a number of race conditions, the most troublesome being onVisibilityChanged. From the testing I've done the parent whom calls onVisibilityChanged doesn't actually wait for it to return. In the case of slower hardware the GL thread has a good chance of calling eglSwapBuffers after it's lost access to the surface.

I need to grab the source out of git and see what the parent is really doing.

It's entirely possible I'm handling the threading wrong, Java isn't my best language. Still I've got a fairly clean implementation that works pretty well on faster hardware, the Droid for example.

I'd be glad to share if you're interested.
oceand
Freshman
Freshman
 
Posts: 2
Joined: Sat Jun 19, 2010 4:17 am

Top

Return to Android 2D/3D Graphics - OpenGL Problems

Who is online

Users browsing this forum: Exabot [Bot] and 2 guests