Can't run sketches with offscreen PGraphics #3259

Closed
JakubValtar opened this Issue May 9, 2015 · 3 comments

Comments

Projects
None yet
4 participants
@JakubValtar
Contributor

JakubValtar commented May 9, 2015

OpenGL (broken in 9e3fb32):

Window appears and freezes, PDE just displays NullPointerException in the status bar and highlights beginDraw(), Eclipse shows this stack:

Exception in thread "Animation Thread" java.lang.NullPointerException
    at processing.opengl.PGraphicsOpenGL.initOffscreen(PGraphicsOpenGL.java:6526)
    at processing.opengl.PGraphicsOpenGL.beginOffscreenDraw(PGraphicsOpenGL.java:6556)
    at processing.opengl.PGraphicsOpenGL.beginDraw(PGraphicsOpenGL.java:1724)
    at tests.SortTest.draw(SortTest.java:33)
    at processing.core.PApplet.handleDraw(PApplet.java:1872)
    at processing.opengl.PSurfaceLWJGL$AnimationThread.run(PSurfaceLWJGL.java:555)
PGraphics buffer;

void setup() {
  size(1280, 720, P3D);
  buffer = createGraphics(width, height, P3D);
}

void draw() {
  buffer.beginDraw();
  buffer.endDraw();
}

JAVA2D (broken before 3.0a6 tag, don't have time to find exact commit):

No window appears, GraphicsConfiguration null in initImage() prints into the console

PGraphics buffer;

void setup() {
  size(1280, 720);
  buffer = createGraphics(width, height);
}

void draw() {
  buffer.beginDraw();
  buffer.endDraw();
}
@codeanticode

This comment has been minimized.

Show comment
Hide comment
@codeanticode

codeanticode May 15, 2015

Member

solved after 56e67c9

Member

codeanticode commented May 15, 2015

solved after 56e67c9

@madsrune

This comment has been minimized.

Show comment
Hide comment
@madsrune

madsrune May 19, 2015

When running this sketch on 3.0a8:

PGraphics buffer;

void setup() {
  size(1280, 720, P3D);
  buffer = createGraphics(width, height, P3D);
}

void draw() {
  buffer.beginDraw();
  buffer.endDraw();
}

I get:

Exception in thread "Thread-2" java.lang.NullPointerException
    at processing.opengl.PGraphicsOpenGL.getPixelScale(PGraphicsOpenGL.java:703)
    at processing.opengl.PJOGL.viewport(PJOGL.java:1895)
    at processing.opengl.PGraphicsOpenGL.setViewport(PGraphicsOpenGL.java:6627)
    at processing.opengl.PGraphicsOpenGL.beginDraw(PGraphicsOpenGL.java:1728)
    at sketch_150518b.draw(sketch_150518b.java:25)
    at processing.core.PApplet.handleDraw(PApplet.java:1969)
    at processing.opengl.PSurfaceJOGL$DrawListener.display(PSurfaceJOGL.java:518)
    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)

When running this sketch on 3.0a8:

PGraphics buffer;

void setup() {
  size(1280, 720, P3D);
  buffer = createGraphics(width, height, P3D);
}

void draw() {
  buffer.beginDraw();
  buffer.endDraw();
}

I get:

Exception in thread "Thread-2" java.lang.NullPointerException
    at processing.opengl.PGraphicsOpenGL.getPixelScale(PGraphicsOpenGL.java:703)
    at processing.opengl.PJOGL.viewport(PJOGL.java:1895)
    at processing.opengl.PGraphicsOpenGL.setViewport(PGraphicsOpenGL.java:6627)
    at processing.opengl.PGraphicsOpenGL.beginDraw(PGraphicsOpenGL.java:1728)
    at sketch_150518b.draw(sketch_150518b.java:25)
    at processing.core.PApplet.handleDraw(PApplet.java:1969)
    at processing.opengl.PSurfaceJOGL$DrawListener.display(PSurfaceJOGL.java:518)
    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

This comment has been minimized.

Show comment
Hide comment
@codeanticode

codeanticode May 19, 2015

Member

It was a regression in 3.0a8, will be fixed in a9 #3292

Member

codeanticode commented May 19, 2015

It was a regression in 3.0a8, will be fixed in a9 #3292

@benfry benfry added duplicate and removed duplicate labels May 19, 2015

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