Hello JOGL’ers
Having a problem with the chapter 9 program from
http://www.genedavissoftware.com/books/jogl/
Details below. Its loading the texture image from the classpath, but the GLUImpl.gluBuild2DMipmaps() doesn’t seem to like the image. I threw in an extra sys.out to print out the BufferedImage. I’m running on Java 1.5. I made no changes to the image, just downloaded it from Gene’s site.
Any guess on what the problem is? Also, how do you make texture images the will work with JOGL without buying a bazillion dollar image program like Photoshop?
Darrel
====================================
bi=BufferedImage@dd87b2: type = 0 ColorModel: #pixelBits = 24 numComponents = 3 color space = java.awt.color.ICC_ColorSpace@1f7d134 transparency = 1 has alpha = false isAlphaPre = false ByteInterleavedRaster: width = 256 height = 144 #numDataElements 3 dataOff[0] = 0
Oops!
java.nio.BufferUnderflowException
at java.nio.Buffer.nextGetIndex(Buffer.java:398)
at java.nio.DirectByteBuffer.get(DirectByteBuffer.java:205)
at net.java.games.jogl.impl.mipmap.ScaleInternal.scale_internal_ubyte(ScaleInternal.java:243)
at net.java.games.jogl.impl.mipmap.BuildMipmap.gluBuild2DMipmapLevelsCore(BuildMipmap.java:520)
at net.java.games.jogl.impl.mipmap.Mipmap.gluBuild2DMipmaps(Mipmap.java:710)
at net.java.games.jogl.impl.GLUImpl.gluBuild2DMipmapsJava(GLUImpl.java:587)
at net.java.games.jogl.impl.GLUImpl.gluBuild2DMipmaps(GLUImpl.java:823)
at org.riekhof.jogl.ch9.TexturesView.mipmapsFromPNG(TexturesView.java:270)