Re: Problem when using an external context
Posted by
herve on
Mar 27, 2012; 11:15pm
URL: https://forum.jogamp.org/Problem-when-using-an-external-context-tp3851637p3863091.html
Hello, we still have the problem with the latest autobuild, but we were able to track where the problem takes place.
What we do is:
GLProfile profile = GLProfile.getDefault();
GLDrawableFactory factory = GLDrawableFactory.getFactory(profile);
GLContext context = factory.createExternalGLContext();
It works fine if we call this portion of code "standalone," (directly from the Java code while having no external context), except for the last line of course, but it is to be expected.
Now if we begin a drawing in C, then execute the method where we have this code in Java through JNI, we have no problem until the last line. The debugger shows that the problem arise in the wglGetCurrentContext method (WGL class) :
final long __addr_ = wglProcAddressTable._addressof_wglGetCurrentContext;
if (__addr_ == 0) {
throw new GLException("Method \"wglGetCurrentContext\" not available");
}
return dispatch_wglGetCurrentContext1(__addr_);
__addr__ is not null, but dispatch_wglGetCurrentContext1, which is a native method, return null (We are on Windows XP 32 bits).
Herve