I’m getting an exception I don’t understand when calling the following:
gl.glTexImage2D(
GL.GL_TEXTURE_2D,
0,
GL.GL_RGBA,
newImage.getWidth(),
newImage.getHeight(),
0,
GL.GL_RGBA,
GL.GL_UNSIGNED_BYTE,
ByteBuffer.wrap(texPixels));
This is the stack trace that gets spit out:
Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: Illegally formatted version identifier: "null"
at com.sun.opengl.impl.FunctionAvailabilityCache$Version.<init>(FunctionAvailabilityCache.java:354)
at com.sun.opengl.impl.FunctionAvailabilityCache.initAvailableExtensions(FunctionAvailabilityCache.java:133)
at com.sun.opengl.impl.FunctionAvailabilityCache.isExtensionAvailable(FunctionAvailabilityCache.java:104)
at com.sun.opengl.impl.GLContextImpl.isExtensionAvailable(GLContextImpl.java:351)
at com.sun.opengl.impl.GLImpl.isExtensionAvailable(GLImpl.java:30494)
at com.sun.opengl.impl.GLImpl.initBufferObjectExtensionChecks(GLImpl.java:30639)
at com.sun.opengl.impl.GLImpl.checkUnpackPBODisabled(GLImpl.java:30674)
at com.sun.opengl.impl.GLImpl.glTexImage2D(GLImpl.java:21146)
at starball.util.TexturePool.getGLTexID(TexturePool.java:122)
at starball.util.TexturePool.getTexID(TexturePool.java:72)
at starball.Model.loadTexture(Model.java:46)
at starball.GameLogic.<init>(GameLogic.java:153)
at starball.Game.init(Game.java:57)
at com.sun.opengl.impl.GLDrawableHelper.init(GLDrawableHelper.java:72)
at javax.media.opengl.GLCanvas$InitAction.run(GLCanvas.java:418)
at com.sun.opengl.impl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:189)
at javax.media.opengl.GLCanvas.maybeDoSingleThreadedWorkaround(GLCanvas.java:412)
at javax.media.opengl.GLCanvas.display(GLCanvas.java:244)
at javax.media.opengl.GLCanvas.paint(GLCanvas.java:277)
at sun.awt.RepaintArea.paintComponent(Unknown Source)
at sun.awt.RepaintArea.paint(Unknown Source)
at sun.awt.windows.WComponentPeer.handleEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.lang.NullPointerException
at com.sun.opengl.impl.FunctionAvailabilityCache$Version.<init>(FunctionAvailabilityCache.java:309)
... 30 more
I’m updating this project from an old pre-JSR version of JOGL. I first tried this with RC7, then with RC8, and get the same exception with both versions. Is there something I’m doing wrong?