jPCT-AE - a 3d engine for Android > Support

jPCT and Android LiveWallpaper

<< < (2/2)

EgonOlsen:
To be honest, i'm not sure what you are talking about. What exactly is a 'renderer' in this case? Have you tried to synchronize you renderers....whatever they are...!?

Andrey8000:
renderer is:

...
public class WallpaperService extends GLWallpaperService {
...
...
   public void onCreate(){
      Log.d(LOGTAG, "Load textures here");
      myTex mTex = new myTex(getResources());
   }
...
...
   public Engine onCreateEngine() {
      MyEngine engine = new MyEngine();
      return engine;
   }

class MyEngine extends GLEngine  {
      
      MyRenderer renderer;

      public MyEngine() {
         super();
         renderer = new MyRenderer();
         setRenderer(renderer);
      }
...
...

and:

class MyRenderer implements GLSurfaceView.Renderer {
       
       private FrameBuffer fb = null;
       private RGBColor back = new RGBColor(0, 0, 0);
      
      public MyRenderer() {
         Log.d(LOGTAG,"Create scene here");
         createWorld();
      }
      
      public void onSurfaceChanged(GL10 gl, int w, int h) {
         Log.d(LOGTAG,"SurfaseChanged()");
         if (fb != null) {
            fb.dispose();
         }
         fb = new FrameBuffer( gl, w, h);
                       //  no need to rebuild world, it cost a lot of time
      }
...
...

How i understand Wallpaper Service is designed so that if the wallpaper is already installed - then we get new renderer in preview (for example, when we want to change the settings)... and some bugs

EgonOlsen:
I think we had this issue before. Somehow, both wallpapers are running in parallel. The solution should be somewhere in the forum, but i can't really search for it, because i'm on a very slow mobile connection for this week.

Andrey8000:
A little more about the problem: the bug looks like a short-term (may be 1-2 frames) collapsing objects, short-term movement of objects in other places and back, short-term change in the scale of objects.

EgonOlsen:
As said: There should be a thread dealing with this problem. IIRC, the solution was to not let the preview renderer render anything as long as the normal one hasn't really stopped.

Navigation

[0] Message Index

[*] Previous page

Go to full version