Help: gl call in key listener generates exceptions

Hi, all:
I’m using JOGL, but met a big problem: I can make gl calls in event handling functions(keyPressed or mouseClicked), and gl call (e.g. glEnable) will generate native code exceptions like following:

An unexpected exception has been detected in native code outside the VM.
Unexpected Signal : 11 occurred at PC=0x4D356998
Function=glEnable+0x0
Library=/usr/lib/libGL.so.1

Current Java thread:
at net.java.games.jogl.impl.x11.X11GLImpl.glEnable(Native Method)
at vis.VRenderer.saveContent(VRenderer.java:259)
at vis.VRenderer.keyPressed(VRenderer.java:290)
at java.awt.Component.processKeyEvent(Component.java:5058)
at java.awt.Component.processEvent(Component.java:4909)
at java.awt.Component.dispatchEventImpl(Component.java:3615)
at java.awt.Component.dispatchEvent(Component.java:3477)
at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1713)

The platform is Debian GNU/Linux + nvidia driver
I’v tested on other non-nvidia windows platform and that’s O.K.

I don’t know if there is anyone who can drop me a suggestion to this problem.

Thanx!

The gl context is only active during the display/init methods. You need to save the information about the events and tell your GLDrawable to redraw. Then during the display callback you can respond to those events and use the gl functions.

Thank u very much!

I also found that the problem may relate to Animator, when I removed Animator I found exceptions does not occur again.