LiveWallpaper Shader Problem

Started by MrM, September 11, 2011, 01:06:33 AM

Previous topic - Next topic

MrM

I'm not sure I understand you, or I'm unaware of some of the GL restrictions...


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...

EgonOlsen

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.

MrM

I'm using the FrameBuffer like this now:
fb = new FrameBuffer(width, height);

In:

@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:


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...

EgonOlsen

Quote from: MrM on September 14, 2011, 03:20:28 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.

MrM

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