Closing a second window

Here is my project, kind of in an early development stage right now. The idea is you left click to select a color from the spritesheet(or group of squares on the left), and rightclick to replace that color with whatever color is under the mouse pointer.

I’m trying to apply my PShader called highlight to both frames.

If you run the program, toggle the box labeled highlight, and left click on the spritesheet or the colored squares on the left, you’ll see my shader highlight the pixels and it all works fine.

Then if you click the histogram button, it opens the new window, and things get screwy. White and black random rectangles and sometimes GL errors. The filter is applied to the new window on line 53 of histogram.pde. If highlight is disabled, it works fine.

Usually but not always the error is GLException: array vertex_buffer_object must be bound to call this method