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

Closed
kvvzr opened this Issue Oct 21, 2015 · 1 comment

Comments

Projects
None yet
2 participants
@kvvzr

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);
  pixelDensity(2);

  p1 = createGraphics(200, 400, P3D);
  p1.beginDraw();
  p1.translate(100, 200);
  p1.sphere(150);
  p1.endDraw();

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

void draw() {
  image(p1, 0, 0);
  image(p2, 200, 0);
}
java.lang.ArrayIndexOutOfBoundsException: 80000
    at processing.opengl.Texture.convertToRGBA(Texture.java:1054)
    at processing.opengl.Texture.set(Texture.java:343)
    at processing.opengl.Texture.set(Texture.java:310)
    at processing.opengl.PGraphicsOpenGL.initCache(PGraphicsOpenGL.java:6411)
    at processing.opengl.PGraphicsOpenGL.getTexture(PGraphicsOpenGL.java:6363)
    at processing.opengl.PGraphicsOpenGL$TexCache.getTexture(PGraphicsOpenGL.java:7427)
    at processing.opengl.PGraphicsOpenGL.flushPolys(PGraphicsOpenGL.java:2449)
    at processing.opengl.PGraphicsOpenGL.flush(PGraphicsOpenGL.java:2390)
    at processing.opengl.PGraphicsOpenGL.endDraw(PGraphicsOpenGL.java:1571)
    at processing.core.PApplet.handleDraw(PApplet.java:2416)
    at processing.opengl.PSurfaceJOGL$DrawListener.display(PSurfaceJOGL.java:761)
    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)

@codeanticode codeanticode added the opengl label Oct 21, 2015

@codeanticode codeanticode self-assigned this Oct 21, 2015

@codeanticode

This comment has been minimized.

Show comment
Hide comment
@codeanticode

codeanticode Oct 21, 2015

Member

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

Member

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