Hello,
I also try to adapt my program from “old” JOGL to JSR-231. However the binding of textures crashes my JVM (1.5.0_05) with ATI Radeon. It works/worked perfectly with JOGL. With the new binding it crashes when I call glTexImage2D(…) Without the binding it runs OK - but no textures.
int width = ...
int height = ...
BufferedImage pixelbild = new BufferedImage(width, height, BufferedImage.TYPE_3BYTE_BGR); // or TYPE_INT_ARGB
...
int picformat = GL_RGBA; // or GL_RGB;
int internformat = GL_RGBA; // or GL_RGB or GL_COMPRESSED_RGBA or GL_COMPRESSED_RGB;
IntBuffer mIntbuffer = IntBuffer.allocate(1);
Raster raster = pixelbild.getData();
DataBufferByte datapuffer = (DataBufferByte) raster.getDataBuffer();
byte[] bytearray = datapuffer.getData();
ByteBuffer niobuffer = ByteBuffer.allocateDirect(bytefeld.length);
niobuffer.order(ByteOrder.nativeOrder());
niobuffer.put(bytearray);
gl.glGenTextures(1, mIntbuffer);
int mTexturobjektId = mIntbuffer.get(0);
int target = GL_TEXTURE_2D; // or GL.GL_TEXTURE_RECTANGLE_ARB for NPOT textures
gl.glBindTexture(target, mTexturobjektId);
gl.glTexImage2D(target, 0, internformat, width, height, 0, picformat, GL_UNSIGNED_BYTE, niobuffer);
The crash looks like this:
An unexpected error has been detected by HotSpot Virtual Machine:
EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x690a1bf6, pid=3384, tid=3960
Java VM: Java HotSpot™ Client VM (1.5.0_05-b05 mixed mode)
Problematic frame:
C [atioglxx.dll+0xa1bf6]
An error report file with more information is saved as hs_err_pid3384.log
Is there anything I missed?