Wired problems for a beginner

I’m a beginner in JOGL. I tired to write a sample app with a canvas inside a Swing frame and run it under Windows and linux.

I found out that on windows i had to generate the canvas before invoking any kind of Swing or AWT object or method, otherwhise i would get a double viewport outside the frame and an unwanted screen res change.
This applies also to other java apps :
for example if i start a java app with no openGL BEFORE my JOGL sample i get the same error, if i do the opposite all works fine. Why that?

On linux instead i run into some TLS error with my driver, and JOGL app doesn’t load at all, stating :
UnsatisfiedLinkError libGL.so cannot handle TLS data.

What’s wrong? Are this common erros?

Before switching back to C++ i would like to hear some opinion!

Thanks in advance!
Byez =8)!
Ob1

Do the demos in the jogl-demos workspace (on java.net) work?

On Windows you should specify -Dsun.java2d.noddraw=true when launching JOGL apps to prevent conflicts with the DirectDraw implementation of Java2D. Try that and see if it clears up some of the strange problems on that platform. I don’t know what the problem could be under Linux, though. You may want to try building the JOGL sources directly. If this fixes your problem, please post.

Forcing no direct draw under windows seems to solve my problems.
Still I have some trouble under linux. I understand there’s a problem whith multithreading on my linux-nvidia drivers, it seems like jogl.so tries to communicate with libGL.so with a TLS protocol that is not supported.
If that’s the problem, i don’t feel that rebuilding the whole library will solve anything.
Hope someone can help me!

By the way, I always test both jogl-demos and my own code, just to be sure it is not a coding problem!

Thanks again!
Byez =8)!
Ob1

I’ve read a little about the TLS issue on Linux but to the best of my understanding it isn’t really a bug in the way JOGL is built or linked, but instead a bug in glibc. The JOGL release builds are currently built on a Red Hat 7.3 system and I think they should work on any compatible distribution. Google for terms “opengl cannot handle tls data” for some discussions and possible workarounds. I think that building from source would also work around your problem.

Thanks again!
I’ve tinkered around my glibc but it seems ok ( using Knoppix 3.3 kernel 2.4…something ), also the latest distribution from GNU is not linux compatible.
I’ve seen that this TLS problem happens also if you try to launch games such as Quake3 or UT which are quite old indeed and i was wondering if there’s some other way to make the thing work other than recompiling the whole thing.
As I’m quite new to this, I’m keeping full JOGL rebuild as a very last resource, as I’m afraid it would turn out to be a painful and probably usless experience.
Infact, how can recompiling JOGL solve a problem in openGL link libraries, that are not able to handle TSL?
Just a question anyway, forgive my ignorance!
Thanks in advance!
Byez =8)!
Ob1

Without knowing exactly what you’re running, I think upgrading your Linux distribution will also probably solve the problem.