I have an fbo wrapping my camera in my 3d scene and use readToPixels to get the fbo’s pixels.
//enemy camera draw fbo.begin(); enemyCam.begin(view); drawAll(); enemyCam.end(); fbo.end(); ofPixels pixels; fbo.readToPixels(pixels); ofSaveImage(pixels, "save.png", OF_IMAGE_QUALITY_BEST);
however when I call ofSaveImage I get the error
ofImage: saveImage(): couldn’t save ‘’‘save.png’’ pixels are not allocated
This makes me think the fbo isn’t being given what the camera is seeing properly, but i’m not sure.
Is there perhaps a better way I could be manipulating the pixels object?
Thanks for any help.
EDIT: This is all in the draw() function of my ofApp if that has any relevance.