New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

IndexOutOfBoundsException with pixelDensity(2) and P2D #3568

Closed
radeise opened this Issue Aug 10, 2015 · 5 comments

Comments

Projects
None yet
3 participants
@radeise

radeise commented Aug 10, 2015

void setup(){

    size(500,700,P2D);
    pixelDensity(2);
}

java.lang.IndexOutOfBoundsException: Required 5600000 remaining bytes in buffer, only had 2800000

馃悡 馃

@codeanticode codeanticode added the opengl label Aug 10, 2015

@codeanticode

This comment has been minimized.

Show comment
Hide comment
@codeanticode

codeanticode Aug 10, 2015

Member

What is the OS?

Also, could you add the entire error message that shows up in the console?

Member

codeanticode commented Aug 10, 2015

What is the OS?

Also, could you add the entire error message that shows up in the console?

@LachiePhilipson

This comment has been minimized.

Show comment
Hide comment
@LachiePhilipson

LachiePhilipson Aug 10, 2015

I have the same issue, on OS X 10.10.4. Here is the console error message in full:

java.lang.IndexOutOfBoundsException: Required 2560000 remaining bytes in buffer, only had 1280000
at com.jogamp.common.nio.Buffers.rangeCheckBytes(Buffers.java:1056)
at jogamp.opengl.gl4.GL4bcImpl.glTexSubImage2D(GL4bcImpl.java:29089)
at processing.opengl.PJOGL.texSubImage2D(PJOGL.java:2043)
at processing.opengl.PGL.copyToTexture(PGL.java:1017)
at processing.opengl.PGraphicsOpenGL.drawPixels(PGraphicsOpenGL.java:6041)
at processing.opengl.PGraphicsOpenGL.restoreSurfaceFromPixels(PGraphicsOpenGL.java:5964)
at processing.opengl.PGraphicsOpenGL.setDrawDefaults(PGraphicsOpenGL.java:7111)
at processing.opengl.PGraphicsOpenGL.beginDraw(PGraphicsOpenGL.java:2047)
at processing.core.PApplet.handleDraw(PApplet.java:2358)
at processing.opengl.PSurfaceJOGL$DrawListener.display(PSurfaceJOGL.java:654)
at jogamp.opengl.GLDrawableHelper.displayImpl(GLDrawableHelper.java:691)
at jogamp.opengl.GLDrawableHelper.display(GLDrawableHelper.java:673)
at jogamp.opengl.GLAutoDrawableBase$2.run(GLAutoDrawableBase.java:442)
at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:1277)
at jogamp.opengl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:1131)
at com.jogamp.newt.opengl.GLWindow.display(GLWindow.java:680)
at com.jogamp.opengl.util.AWTAnimatorImpl.display(AWTAnimatorImpl.java:77)
at com.jogamp.opengl.util.AnimatorBase.display(AnimatorBase.java:451)
at com.jogamp.opengl.util.FPSAnimator$MainTask.run(FPSAnimator.java:178)
at java.util.TimerThread.mainLoop(Timer.java:555)
at java.util.TimerThread.run(Timer.java:505)

LachiePhilipson commented Aug 10, 2015

I have the same issue, on OS X 10.10.4. Here is the console error message in full:

java.lang.IndexOutOfBoundsException: Required 2560000 remaining bytes in buffer, only had 1280000
at com.jogamp.common.nio.Buffers.rangeCheckBytes(Buffers.java:1056)
at jogamp.opengl.gl4.GL4bcImpl.glTexSubImage2D(GL4bcImpl.java:29089)
at processing.opengl.PJOGL.texSubImage2D(PJOGL.java:2043)
at processing.opengl.PGL.copyToTexture(PGL.java:1017)
at processing.opengl.PGraphicsOpenGL.drawPixels(PGraphicsOpenGL.java:6041)
at processing.opengl.PGraphicsOpenGL.restoreSurfaceFromPixels(PGraphicsOpenGL.java:5964)
at processing.opengl.PGraphicsOpenGL.setDrawDefaults(PGraphicsOpenGL.java:7111)
at processing.opengl.PGraphicsOpenGL.beginDraw(PGraphicsOpenGL.java:2047)
at processing.core.PApplet.handleDraw(PApplet.java:2358)
at processing.opengl.PSurfaceJOGL$DrawListener.display(PSurfaceJOGL.java:654)
at jogamp.opengl.GLDrawableHelper.displayImpl(GLDrawableHelper.java:691)
at jogamp.opengl.GLDrawableHelper.display(GLDrawableHelper.java:673)
at jogamp.opengl.GLAutoDrawableBase$2.run(GLAutoDrawableBase.java:442)
at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:1277)
at jogamp.opengl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:1131)
at com.jogamp.newt.opengl.GLWindow.display(GLWindow.java:680)
at com.jogamp.opengl.util.AWTAnimatorImpl.display(AWTAnimatorImpl.java:77)
at com.jogamp.opengl.util.AnimatorBase.display(AnimatorBase.java:451)
at com.jogamp.opengl.util.FPSAnimator$MainTask.run(FPSAnimator.java:178)
at java.util.TimerThread.mainLoop(Timer.java:555)
at java.util.TimerThread.run(Timer.java:505)

@LachiePhilipson

This comment has been minimized.

Show comment
Hide comment
@LachiePhilipson

LachiePhilipson Aug 10, 2015

I also get a similar error with the P3D render mode.

void setup() {
    size(400, 400, P3D);    
    pixelDensity(2);    
}

java.lang.IndexOutOfBoundsException: Required 2560000 remaining bytes in buffer, only had 1280000
at com.jogamp.common.nio.Buffers.rangeCheckBytes(Buffers.java:1056)
at jogamp.opengl.gl4.GL4bcImpl.glTexSubImage2D(GL4bcImpl.java:29089)
at processing.opengl.PJOGL.texSubImage2D(PJOGL.java:2043)
at processing.opengl.PGL.copyToTexture(PGL.java:1017)
at processing.opengl.PGraphicsOpenGL.drawPixels(PGraphicsOpenGL.java:6041)
at processing.opengl.PGraphicsOpenGL.restoreSurfaceFromPixels(PGraphicsOpenGL.java:5964)
at processing.opengl.PGraphicsOpenGL.setDrawDefaults(PGraphicsOpenGL.java:7111)
at processing.opengl.PGraphicsOpenGL.beginDraw(PGraphicsOpenGL.java:2047)
at processing.core.PApplet.handleDraw(PApplet.java:2358)
at processing.opengl.PSurfaceJOGL$DrawListener.display(PSurfaceJOGL.java:654)
at jogamp.opengl.GLDrawableHelper.displayImpl(GLDrawableHelper.java:691)
at jogamp.opengl.GLDrawableHelper.display(GLDrawableHelper.java:673)
at jogamp.opengl.GLAutoDrawableBase$2.run(GLAutoDrawableBase.java:442)
at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:1277)
at jogamp.opengl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:1131)
at com.jogamp.newt.opengl.GLWindow.display(GLWindow.java:680)
at com.jogamp.opengl.util.AWTAnimatorImpl.display(AWTAnimatorImpl.java:77)
at com.jogamp.opengl.util.AnimatorBase.display(AnimatorBase.java:451)
at com.jogamp.opengl.util.FPSAnimator$MainTask.run(FPSAnimator.java:178)
at java.util.TimerThread.mainLoop(Timer.java:555)
at java.util.TimerThread.run(Timer.java:505)

LachiePhilipson commented Aug 10, 2015

I also get a similar error with the P3D render mode.

void setup() {
    size(400, 400, P3D);    
    pixelDensity(2);    
}

java.lang.IndexOutOfBoundsException: Required 2560000 remaining bytes in buffer, only had 1280000
at com.jogamp.common.nio.Buffers.rangeCheckBytes(Buffers.java:1056)
at jogamp.opengl.gl4.GL4bcImpl.glTexSubImage2D(GL4bcImpl.java:29089)
at processing.opengl.PJOGL.texSubImage2D(PJOGL.java:2043)
at processing.opengl.PGL.copyToTexture(PGL.java:1017)
at processing.opengl.PGraphicsOpenGL.drawPixels(PGraphicsOpenGL.java:6041)
at processing.opengl.PGraphicsOpenGL.restoreSurfaceFromPixels(PGraphicsOpenGL.java:5964)
at processing.opengl.PGraphicsOpenGL.setDrawDefaults(PGraphicsOpenGL.java:7111)
at processing.opengl.PGraphicsOpenGL.beginDraw(PGraphicsOpenGL.java:2047)
at processing.core.PApplet.handleDraw(PApplet.java:2358)
at processing.opengl.PSurfaceJOGL$DrawListener.display(PSurfaceJOGL.java:654)
at jogamp.opengl.GLDrawableHelper.displayImpl(GLDrawableHelper.java:691)
at jogamp.opengl.GLDrawableHelper.display(GLDrawableHelper.java:673)
at jogamp.opengl.GLAutoDrawableBase$2.run(GLAutoDrawableBase.java:442)
at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:1277)
at jogamp.opengl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:1131)
at com.jogamp.newt.opengl.GLWindow.display(GLWindow.java:680)
at com.jogamp.opengl.util.AWTAnimatorImpl.display(AWTAnimatorImpl.java:77)
at com.jogamp.opengl.util.AnimatorBase.display(AnimatorBase.java:451)
at com.jogamp.opengl.util.FPSAnimator$MainTask.run(FPSAnimator.java:178)
at java.util.TimerThread.mainLoop(Timer.java:555)
at java.util.TimerThread.run(Timer.java:505)

@radeise

This comment has been minimized.

Show comment
Hide comment
@radeise

radeise Aug 11, 2015

Sorry, i'm on OS X 10.10.4 too, with the same error message.

radeise commented Aug 11, 2015

Sorry, i'm on OS X 10.10.4 too, with the same error message.

@codeanticode

This comment has been minimized.

Show comment
Hide comment
@codeanticode

codeanticode Aug 11, 2015

Member

Thanks for all the info!
Solved with 6b85d25, beta 3 will incorporate this fix.

Member

codeanticode commented Aug 11, 2015

Thanks for all the info!
Solved with 6b85d25, beta 3 will incorporate this fix.

@benfry benfry changed the title from PixelDensity(2) problem with P2D to `pixelDensity(2)` problem with P2D Aug 11, 2015

@benfry benfry changed the title from `pixelDensity(2)` problem with P2D to IndexOutOfBoundsException with pixelDensity(2) and P2D Aug 11, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment