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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pixelDensity() and createGraphics() with P3D #4039

kvvzr opened this Issue Oct 21, 2015 · 1 comment


None yet
2 participants

kvvzr commented Oct 21, 2015

When using pixelDensity(2) and createGraphics(x1, y1), createGraphics(x2, y2, P3D), here's code returns ArrayIndexOutOfBoundsException.

PGraphics p1, p2;

void setup() {
  size(400, 400, P3D);

  p1 = createGraphics(200, 400, P3D);
  p1.translate(100, 200);

  p2 = createGraphics(200, 400);
  p2.background(255, 0, 0);

void draw() {
  image(p1, 0, 0);
  image(p2, 200, 0);
java.lang.ArrayIndexOutOfBoundsException: 80000
    at processing.opengl.Texture.convertToRGBA(
    at processing.opengl.Texture.set(
    at processing.opengl.Texture.set(
    at processing.opengl.PGraphicsOpenGL.initCache(
    at processing.opengl.PGraphicsOpenGL.getTexture(
    at processing.opengl.PGraphicsOpenGL$TexCache.getTexture(
    at processing.opengl.PGraphicsOpenGL.flushPolys(
    at processing.opengl.PGraphicsOpenGL.flush(
    at processing.opengl.PGraphicsOpenGL.endDraw(
    at processing.core.PApplet.handleDraw(
    at processing.opengl.PSurfaceJOGL$DrawListener.display(
    at jogamp.opengl.GLDrawableHelper.displayImpl(
    at jogamp.opengl.GLDrawableHelper.display(
    at jogamp.opengl.GLAutoDrawableBase$
    at jogamp.opengl.GLDrawableHelper.invokeGLImpl(
    at jogamp.opengl.GLDrawableHelper.invokeGL(
    at com.jogamp.newt.opengl.GLWindow.display(
    at com.jogamp.opengl.util.AWTAnimatorImpl.display(
    at com.jogamp.opengl.util.AnimatorBase.display(
    at com.jogamp.opengl.util.FPSAnimator$
    at java.util.TimerThread.mainLoop(

@codeanticode codeanticode added the opengl label Oct 21, 2015

@codeanticode codeanticode self-assigned this Oct 21, 2015


This comment has been minimized.

Show comment
Hide comment

codeanticode Oct 21, 2015


@kvvzr thanks for the report! It is fixed with 1d16319. Next version of Processing will include this fix.


codeanticode commented Oct 21, 2015

@kvvzr thanks for the report! It is fixed with 1d16319. Next version of Processing will include this fix.

@benfry benfry changed the title from pixelDensity() and createGraphics() to pixelDensity() and createGraphics() with P3D Feb 13, 2016

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