Aaaargggg. Looks like the above is not a fix, after all. I am still getting the crash on the PC compile.
I’ve tried unpacking the methods but it isn’t getting me very far. The below is what I have at present. This is crashing on PC in release mode, but doesn’t seem to in debug mode. On Mac it runs fine.
ofFloatPixels checkPixels;
int hSafe = fboX.getTextureReference().getHeight();
int wSafe = fboX.getTextureReference().getWidth();
ofTexture texturePass = fboX.getTexture();
checkPixels.allocate(wSafe, hSafe, ofGetImageTypeFromGLType(GL_RGBA32F));
#ifndef TARGET_OPENGLES
ofSetPixelStoreiAlignment(GL_PACK_ALIGNMENT, checkPixels.getWidth(), checkPixels.getBytesPerChannel(), checkPixels.getNumChannels());
glBindTexture(texturePass.texData.textureTarget, texturePass.texData.textureID);
glGetTexImage(texturePass.texData.textureTarget, 0, ofGetGlFormat(checkPixels), GL_FLOAT, checkPixels.getData());
glBindTexture(texturePass.texData.textureTarget, 0);
#else
fboX.bind();
int format = ofGetGLFormatFromInternal(GL_RGBA32F);
glReadPixels(0, 0, wSafe, hSafe, format, GL_FLOAT, checkPixels.getData());
fboX.unbind();
#endif
It also seems as though when I just call fboX.readtoPixels() to ofPixels, not ofFloatPixels, the crash on PC doesn’t occur either.
As I mentioned before, the error message is a ‘std::bad_alloc at memory location…’ one, which if I am guessing correctly, may be to do with the pixel allocation. But I may just be wrong.
Can anyone help? It is driving me a bit mad.
In hope
Sam
[update] I’ve been running cout<< checks, from which it looks like the PC version consistently crashes on the checkPixels.allocate() line, the second time it calls it.