I was working on a little painting program that re-generates a bitmap on every frame, using a PImage object. This seems to cause the sketch to gobble up more and more RAM on each frame, until it runs out of memory and I get an error. Here is an example code that does the same thing but rendering random pixels:
PImage img;
void setup(){ size(250,250); }
void draw(){ newImg(); image(img,0,0); }
void newImg(){ img = createImage(250,250,ARGB); img.loadPixels(); for(int x = 0; x < img.width; x++){ for(int y = 0; y < img.height; y++){ img.pixels[y * img.width + x] = color(random(255)); } } img.updatePixels(); }
If you watch the amount of RAM java is using when this sketch runs it just consumes more and more until it crashes. Any idea of what I can do to fix this?
Just started using Processing 2.0b7, when I attempt to use either the P3D renderer or P2D renderer I get the same exact error:
"No framebuffer objects available"
My graphics card : NVIDIA GeForce 9800GTX+
Is it my graphics card driver?
Here is the full error text:
Exception in thread "Animation Thread" java.lang.RuntimeException: No framebuffer objects available
at processing.opengl.PGL$PGLListener.init(PGL.java:2487)
at jogamp.opengl.GLDrawableHelper.init(GLDrawableHelper.java:507)
at jogamp.opengl.GLDrawableHelper.displayImpl(GLDrawableHelper.java:546)
at jogamp.opengl.GLDrawableHelper.display(GLDrawableHelper.java:533)
at jogamp.opengl.GLAutoDrawableBase$2.run(GLAutoDrawableBase.java:280)
at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:904)
at jogamp.opengl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:822)
at com.jogamp.newt.opengl.GLWindow.display(GLWindow.java:543)
at processing.opengl.PGL.requestDraw(PGL.java:814)
at processing.opengl.PGraphicsOpenGL.requestDraw(PGraphicsOpenGL.java:1566)
at processing.core.PApplet.run(PApplet.java:2020)
at java.lang.Thread.run(Thread.java:662)
I am trying to finish a submission for the writtenimages.net project, but the exported exe application simply hangs when it should save the generated image, yet it works correctly within the processing writing program.
To add to the frustration, it works correctly on one computer but not on another. On my home computer with windows 7 everything works correctly, but on my work computer with windows vista it hangs.
If I switch the renderer to Opengl it works on the vista computer, but when I send the exe to the guys at writtenimages.net they say it doesn't work. It also works correctly on both the win7 and vista computer if I change the image size to be 1/4 the final needed size.
So is there some trick to getting processing exported .exe's to save really large images? I am at the end of my rope and the deadline for the submissions is today.