Required extensions not available to call this function

I’m trying to load a texture to draw with, and I try to run this:

gl.glTexImage2D(GL.GL_TEXTURE_2D, 0, 3, w, h,
0, GL.GL_RGB, GL.GL_UNSIGNED_BYTE, textures.get(iship));

and I get this:

Exception in thread “AWT-EventQueue-0” javax.media.opengl.GLException: Required extensions not available to call this function

I can’t find any information about this…the few guesses I have don’t really make much sense.

I’d guess you’re calling this in a button or mouse listener? You can only make GL calls in the active gl thread (which would be the one that calls reshape(), display() etc. You should avoid caching the GL object for this reason.

This is called in init().