Author Topic: LiveWallpaper Shader Problem  (Read 9560 times)

Offline MrM

  • byte
  • *
  • Posts: 36
    • View Profile
Re: LiveWallpaper Shader Problem
« Reply #15 on: September 14, 2011, 12:24:11 am »
I'm not sure I understand you, or I'm unaware of some of the GL restrictions...

Code: [Select]
public EGLContext createContext(final EGL10 egl, final EGLDisplay display, final EGLConfig config) {
return egl.eglCreateContext(display, config, EGL10.EGL_NO_CONTEXT, null);
}

Does this help? It's from Green's library...

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: LiveWallpaper Shader Problem
« Reply #16 on: September 14, 2011, 06:58:56 am »
No, not quite. From what i understood, you were using the FrameBuffer constructor that takes a GL10 instance (instead of the one that doesn't) and i'm puzzled where this instance should come from when working with a GL2.0 context.

Offline MrM

  • byte
  • *
  • Posts: 36
    • View Profile
Re: LiveWallpaper Shader Problem
« Reply #17 on: September 14, 2011, 03:20:28 pm »
I'm using the FrameBuffer like this now:
fb = new FrameBuffer(width, height);

In:
Code: [Select]
@Override
public Engine onCreateEngine() {
mRenderer = new MyRenderer(this);
return new WallpaperEngine(getBaseContext(), mRenderer);
}

I'm using getBaseContext(), which returns the base context as set by the constructor or setBaseContext.
**
Or maybe you need this which is taken from another library within net.rbgrn.opengl and a little modified:

Code: [Select]
private private EGL10 gL1; //and for everything else you'll see below.

this.gL1 = (EGL10) EGLContext.getEGL();  //An instance


final int[] version = new int[2];   //Initialization
this.gL1.eglInitialize(this.gL1Display, version);   //Take a look at this line, because I think this is what you need.
this.gL1Config = this.gL1ConfigChooser.chooseConfig(this.gL1, this.gL1Display);

Other than this, I really don't know...

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: LiveWallpaper Shader Problem
« Reply #18 on: September 14, 2011, 09:52:18 pm »
I'm using the FrameBuffer like this now:
fb = new FrameBuffer(width, height);
Yes. And before that, you've used new FrameBuffer(<GL10>, width, height), right? And that <GL10>...what is/was it? It can't be the EGL10 that is in your code snippets, because that's a completely different interface.

Offline MrM

  • byte
  • *
  • Posts: 36
    • View Profile
Re: LiveWallpaper Shader Problem
« Reply #19 on: September 14, 2011, 10:25:35 pm »
Oh my god... I think I've completely misunderstood you...

Before, I was using the FrameBuffer with GL10 but I had messed up in my GL initialization. That's why in one of my previous questions, the GL Renderer being called was OpenGL ES-CM 1.0, while I had been calling a mixed context (that's why the shaders and lightning didn't work), along with PixelFinger (though PixelFinger was on Emu, not sure on device), since that question I've REWRITTEN it COMPLETELY, so I initalize the ES 2.0 Renderer correctly and render the appropriate context...

Before, when I used the FrameBuffer with GL10, I think I had cast it like so (GL11) gl10... Yes, I know... I've CAST it  :-[
That was a result of my frustration and silliness, so about catching that... I don't think many people would try that out :D