I am trying to attach to external GL context created by native application. Eerything works as expected on both Windows and Linux but on MacOSX
GLDrawableFactory.getDesktopFactory().createExternalGLContext()
calls hangs inside GLProfile.initSingleton while loading awt lib. I believe I am seing issue described
https://jogamp.org/bugzilla/show_bug.cgi?id=485http://stackoverflow.com/questions/8750690/osx-javavm-awt-swing-and-possibly-a-deadlockIt is suggested to:
- spawn JVM from separate thread; this is not an option for me as I do not have control of the native app in which I am embedding JVM and I will still receive callbacks from the main thread where I would not have access to JVM
- launch JVM with -Djava.awt.headless. That results with:
com.jogamp.opengl.GLException: Error: current Context (CGL) null, no Context (NS)
at jogamp.opengl.macosx.cgl.MacOSXExternalCGLContext.create(MacOSXExternalCGLContext.java:91)
at jogamp.opengl.macosx.cgl.MacOSXCGLDrawableFactory.createExternalGLContextImpl(MacOSXCGLDrawableFactory.java:446)
at jogamp.opengl.GLDrawableFactoryImpl.createExternalGLContext(GLDrawableFactoryImpl.java:599)
Is there any known workaround for this issue? I do not need any AWT stuff, all I need is to attach to current OpenGL context and do some drawing.
Many thanks,
- Dominik