Obtaining external GL context in Android

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Obtaining external GL context in Android

Marc Kurtz
I have an existing Android GLSurfaceView class that draws a map to the screen. I also have an existing OpenGL rendering library written that uses JOGL bindings to do it's drawing that I'd like to use with my GLSurfaceView. I'd like to obtain the JOGL GL instance object for my GLSurfaceView so I can pass that to my rendering library and allow it to draw to my map.

For a desktop GL context I can do GLDrawableFactory.getDesktopFactory().createExternalGLContext() which I can call getGL() on to get the GL object instance. However, when I do GLDrawableFactory.getEGLFactory().createExternalGLContext() on Android I get a null exception. I think the EGLExternalContext is not actually implemented. Looking at the code:

public class EGLExternalContext extends EGLContext {
    public EGLExternalContext(AbstractGraphicsScreen var1) {
        super((GLDrawableImpl)null, (GLContext)null);
passing in nulls to the super class will trigger a IllegalArgumentException("Null drawable") so this class is unusable as-is. I've looked into some of the NEWT stuff but that seems to always be centered around creating it's own window rather than using an existing GLSurfaceView.

So to reiterate - I am trying to integrate JOGL to integrate with Android's GLSurfaceView. I think what I need is to be able to instantiate a JOGL instance using an externally created GL context. Thank you!

Reply | Threaded
Open this post in threaded view
|

Re: Obtaining external GL context in Android

gouessej
Administrator
Sorry for the late reply but I advise you not to mix Android OpenGL API with JOGL, use the former or the latter, not both.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Obtaining external GL context in Android

Martin
In reply to this post by Marc Kurtz
I have been looking for simple Android demonstrations of JOGL and haven’t found any up to now. Could you recommend me a starting point? A very simple app showing a triangle would be perfect for me. I am not an android developer so my point is rather to have a good standalone demo app showing how to start a JOGL Canvas, rather than advanced OpenGL demo.

Regards,

Martin