Quantcast
Channel: Processing Forum
Viewing all articles
Browse latest Browse all 1768

PApplet.shape() NullPointer Exception

$
0
0
I am creating a project in Eclipse and am using git for version control.

I am building off of Shiffman's ParticleSystem code. 

On one version of my project my display function runs:

      public void display() {

          parent.shape(particleShape); //parent == PApplet , particleShape == PShape

        }


on the other branch it throws a NullPointer Exception. I think that there is a nuance about PShapes that I am missing.
Any insights on why I am getting a NullPointer Exception on one branch and not another?

Error Report:

Exception in thread "Animation Thread" java.lang.NullPointerException

at processing.opengl.Texture.<init>(Texture.java:150)

at processing.opengl.PGraphicsOpenGL.addTexture(PGraphicsOpenGL.java:5693)

at processing.opengl.PGraphicsOpenGL.addTexture(PGraphicsOpenGL.java:5681)

at processing.opengl.PGraphicsOpenGL.initCache(PGraphicsOpenGL.java:5644)

at processing.opengl.PGraphicsOpenGL.getTexture(PGraphicsOpenGL.java:5616)

at processing.opengl.PShapeOpenGL.renderPolys(PShapeOpenGL.java:4074)

at processing.opengl.PShapeOpenGL.render(PShapeOpenGL.java:4045)

at processing.opengl.PShapeOpenGL.draw(PShapeOpenGL.java:3975)

at processing.opengl.PShapeOpenGL.draw(PShapeOpenGL.java:3964)

at processing.core.PGraphics.shape(PGraphics.java:3716)

at processing.opengl.PGraphics2D.shape(PGraphics2D.java:192)

at processing.core.PApplet.shape(PApplet.java:12307)

at particleHandler.ParticleSystem.display(ParticleSystem.java:80)

at circlepdemo.CirclePDemo.draw(CirclePDemo.java:91)

at processing.core.PApplet.handleDraw(PApplet.java:2266)

at processing.opengl.PGL$PGLListener.display(PGL.java:3240)

at jogamp.opengl.GLDrawableHelper.displayImpl(GLDrawableHelper.java:573)

at jogamp.opengl.GLDrawableHelper.display(GLDrawableHelper.java:558)

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 processing.opengl.PGL.requestDraw(PGL.java:1197)

at processing.opengl.PGraphicsOpenGL.requestDraw(PGraphicsOpenGL.java:1550)

at processing.core.PApplet.run(PApplet.java:2140)

at java.lang.Thread.run(Thread.java:680)


Viewing all articles
Browse latest Browse all 1768

Trending Articles