LWJGL Forum

Programming => OpenGL => Topic started by: Kai on October 28, 2014, 16:11:28

Title: lwjgl 3 and native functions loading
Post by: Kai on October 28, 2014, 16:11:28
Hello,

I was just testing lwjgl3 together with SWT a little bit more *without* OpenCL initialization first, and I cannot get it working.
What I did was, I created a SWT GLCanvas, set its managed GL context current in the invoking thread and tried to call GLContext glCtx = GLContext.createFromCurrent();
This call fails with:
java.lang.UnsatisfiedLinkError: org.lwjgl.system.windows.WGL.wglGetCurrentContext()J

When I include a call to CL.create() as the very first invocation, everything is okay and I can render with OpenGL just fine.

Apparently, lwjgl3 does not load native JNI functions from the native library when invoking GLContext glCtx = GLContext.createFromCurrent(); but somehow it does so when invoking CL.create();

What initialization method do I have to invoke in order to let lwjgl load the native functions?

Thanks!
Title: Re: lwjgl 3 and native functions loading
Post by: spasi on October 28, 2014, 16:59:23
As a temporary workaround, try calling Sys.touch() before GLContext.createFromCurrent(). In the future, I'll make sure all useful "entry points" properly trigger LWJGL's initialization.
Title: Re: lwjgl 3 and native functions loading
Post by: Kai on October 28, 2014, 19:07:48
Thanks, that works nicely.