jPCT-AE - a 3d engine for Android > Support
gles2.0 in GLWallpaperService
(1/1)
ruspa:
Hi there, I successfully merged jpct-ae samples with GLWallpaperService and have my imported .3ds model rotating happily in my homescreen.
Now I want initialize and switch to opengl es2 and found this documentation http://www.jpct.net/wiki/index.php/OpenGL_ES_2.0_support
so I have to do something like this, somewhere:
--- Code: ---
mGLView = new GLSurfaceView(getApplication()); // don't know were to find mGLView..
mGLView.setEGLContextClientVersion(2);
[...]
frameBuffer = new FrameBuffer(/*gl,*/ w, h); //existing line, commenting only the first parameter obviously blows up everything
--- End code ---
the point is that using GLWallpaperService I cannot find any reference to "mGLView" in order to modify it. I think I looked everywhere stepping in debug and I din't see anything similar, so perhaps this might be a bad approach, or I'm just blindfolded...
Where can I get a hook to the mGLView using live wallpapers? Is this approach correct?
Sounds like GLWallpaperService is not based on GLSurfaceView.
Thanks :D
EgonOlsen:
Maybe this part will do the trick:
--- Code: ---public void setRenderer(GLSurfaceView.Renderer renderer) {
checkRenderThreadState();
if (mEGLConfigChooser == null) {
mEGLConfigChooser = new SimpleEGLConfigChooser(true, mEGLContextClientVersion);
}
if (mEGLContextFactory == null) {
mEGLContextFactory = new DefaultContextFactory(mEGLContextClientVersion);
}
if (mEGLWindowSurfaceFactory == null) {
mEGLWindowSurfaceFactory = new DefaultWindowSurfaceFactory();
}
mGLThread = new GLThread(renderer, mEGLConfigChooser, mEGLContextFactory, mEGLWindowSurfaceFactory, mGLWrapper);
mGLThread.start();
}
--- End code ---
It seems to set the mEGLContextClientVersion in the constructor of the DefaultContextFactory. Looks like the place to modify for GL 2.0 to me.
Navigation
[0] Message Index
Go to full version