Reputation: 21
I am Using Java OpenGL(JOGL). I knew GL context depends on each thread. But I have to convert Local coordinate to Global one when mouse clicked. Can I refer the CACHED GL CONTEXT in AWT EVENT THREAD? If I can not, then is there any alternative logic?
Upvotes: 1
Views: 227
Reputation: 4125
Please read the JOGL user's guide. You mustn't use a GL instance when its OpenGL context isn't current, you mustn't store the GL instance, you should use it in a GLEventListener and you should avoid passing it. You can use GLAutoDrawable.invoke() to execute a task when the drawable is displayed. I don't advise you to make the OpenGL context current even though it's possible.
Are you sure that you need something OpenGL related to convert local coordinates to global ones?
Finally, you should rather ask questions specific to JOGL on our official forum as only a very few JogAmp contributors come here. We can't be everywhere.
Upvotes: 0