Login  Register

Re: Mixing C and Java opengl calls with JOGL

Posted by christopherplawrence on Jan 17, 2020; 6:24pm
URL: https://forum.jogamp.org/Mixing-C-and-Java-opengl-calls-with-JOGL-tp4040269p4040270.html

After spending some more time thinking about it, I believe that the linking has to occur dynamically at runtime.  My library will need to provide the gl* function definitions.  The implementation will delegate calls to function pointers.  These function pointers will be obtained, at runtime, from the GL library that was loaded by JOGL.

The basic idea is:
- obtain the handle to the GL implementation loaded by JOGL
- initialize the C library's internal GL function pointers via dlsym/GetProcAddress
- the C library's internal gl* function definitions proxy to the dynamically loaded function pointers

Guidance is still very much appreciated if anyone has experience with what I'm trying to do.