Problem with gluScaleImage

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Problem with gluScaleImage

gouessej
Administrator
Hi

GLUgl2.gluScaleImage(GL.GL_LUMINANCE,213,213,GL.GL_UNSIGNED_BYTE,inBuf, 256,256,GL.GL_UNSIGNED_BYTE,outBuf) throws an exception only on my machine, inBuf has a capacity of 45369 bytes and outBuf has a capacity of 66560 bytes. I can't use native GLU as gluScaleImageC isn't found even though GLU is installed (I used the flag to enable native GLU). Can it come from a bug of Mesa? My graphics card is an ATI Radeon 9250 Pro, I'm under Mageia Linux 2.

INFO: Display Vendor: Tungsten Graphics, Inc.
INFO: Display Renderer: Mesa DRI R200 (RV280 5C61) x86/MMX+/3DNow!+/SSE TCL DRI2
INFO: Display Version: 1.3 Mesa 8.0.4

This is the exception thrown when using Ardor3D:
ATTENTION: (card unsupported) Attempted to apply texture with size that is not power of 2: 213 x 213
24 févr. 2013 15:14:12 com.ardor3d.scene.state.jogl.JoglTextureStateUtil update
ATTENTION: Rescaling image to 256 x 256 !!!
24 févr. 2013 15:14:12 com.ardor3d.extension.ui.UIHud draw(Renderer)
GRAVE: Exception
java.nio.BufferUnderflowException
        at java.nio.Buffer.nextGetIndex(Buffer.java:491)
        at java.nio.DirectByteBuffer.get(DirectByteBuffer.java:223)
        at jogamp.opengl.glu.mipmap.Image.fill_image(Image.java:237)
        at jogamp.opengl.glu.mipmap.Mipmap.gluScaleImage(Mipmap.java:585)
        at javax.media.opengl.glu.gl2.GLUgl2.gluScaleImageJava(GLUgl2.java:393)
        at javax.media.opengl.glu.gl2.GLUgl2.gluScaleImage(GLUgl2.java:528)
        at com.ardor3d.scene.state.jogl.JoglTextureStateUtil.update(JoglTextureStateUtil.java:189)
        at com.ardor3d.scene.state.jogl.JoglTextureStateUtil.load(JoglTextureStateUtil.java:114)
        at com.ardor3d.scene.state.jogl.JoglTextureStateUtil.apply(JoglTextureStateUtil.java:662)
        at com.ardor3d.renderer.jogl.JoglRenderer.doApplyState(JoglRenderer.java:1610)
        at com.ardor3d.renderer.AbstractRenderer.applyState(AbstractRenderer.java:82)
        at com.ardor3d.scenegraph.Mesh.render(Mesh.java:266)
        at com.ardor3d.scenegraph.Mesh.render(Mesh.java:243)
        at com.ardor3d.extension.ui.util.SubTexUtil.drawSubTex(SubTexUtil.java:289)
        at com.ardor3d.extension.ui.util.SubTexUtil.drawSubTex(SubTexUtil.java:127)
        at com.ardor3d.extension.ui.backdrop.ImageBackdrop.draw(ImageBackdrop.java:89)
        at com.ardor3d.extension.ui.UIComponent.draw(UIComponent.java:1111)
        at com.ardor3d.extension.ui.UIContainer.draw(UIContainer.java:305)
        at com.ardor3d.scenegraph.Spatial.onDraw(Spatial.java:739)
        at com.ardor3d.extension.ui.UIContainer.drawComponent(UIContainer.java:291)
        at com.ardor3d.extension.ui.UIComponent.draw(UIComponent.java:1122)
        at com.ardor3d.extension.ui.UIContainer.draw(UIContainer.java:305)
        at com.ardor3d.scenegraph.Spatial.onDraw(Spatial.java:739)
        at com.ardor3d.extension.ui.UIHud.draw(UIHud.java:339)
        at com.ardor3d.scenegraph.Spatial.onDraw(Spatial.java:739)
        at com.ardor3d.renderer.jogl.JoglRenderer.draw(JoglRenderer.java:289)
        at com.ardor3d.example.renderer.GeneratedTexturesExample.renderExample(GeneratedTexturesExample.java:134)
        at com.ardor3d.example.ExampleBase.renderUnto(ExampleBase.java:273)
        at com.ardor3d.framework.jogl.JoglCanvasRenderer.draw(JoglCanvasRenderer.java:211)
        at com.ardor3d.framework.jogl.JoglDrawerRunnable.run(JoglDrawerRunnable.java:16)
        at jogamp.opengl.GLRunnableTask.run(GLRunnableTask.java:59)
        at jogamp.opengl.GLDrawableHelper.execGLRunnables(GLDrawableHelper.java:619)
        at jogamp.opengl.GLDrawableHelper.display(GLDrawableHelper.java:559)
        at jogamp.opengl.GLAutoDrawableBase$2.run(GLAutoDrawableBase.java:286)
        at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:1021)
        at jogamp.opengl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:896)
        at com.jogamp.newt.opengl.GLWindow.display(GLWindow.java:545)
        at jogamp.opengl.GLDrawableHelper.invoke(GLDrawableHelper.java:716)
        at jogamp.opengl.GLAutoDrawableBase.invoke(GLAutoDrawableBase.java:427)
        at com.ardor3d.framework.jogl.JoglNewtWindow.draw(JoglNewtWindow.java:191)
        at com.ardor3d.framework.FrameHandler.updateFrame(FrameHandler.java:90)
        at com.ardor3d.example.ExampleBase.run(ExampleBase.java:147)
        at java.lang.Thread.run(Thread.java:679)
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Problem with gluScaleImage

gouessej
Administrator
I have reported this bug (see bug 694) and provided a unit test.
Julien Gouesse | Personal blog | Website