[solved] readFrameBuffer from BGRA8 (3.0) to RGBA8 (3.1)

Between 3.0 and 3.1, the format of readFrameBuffer from BGRA8 to RGB8 ?

In 3.0 readFrameBuffer:

Reads the pixels currently stored in the specified framebuffer
 into the given ByteBuffer object. 
 Only color pixels are transferred, the format is BGRA with 8 bits 
 per component. The given byte buffer should have at least
 fb.getWidth() * fb.getHeight() * 4 bytes remaining.

In 3.1Renderer.java:

     * Reads the pixels currently stored in the specified framebuffer
             * into the given ByteBuffer object. 
             * Only color pixels are transferred, the format is RGBA with 8 bits 
             * per component. The given byte buffer should have at least
             * fb.getWidth() * fb.getHeight() * 4 bytes remaining.

This breaking change introduce an additionnal conversion in JME3-JFX when jme is embedded into JavaFX (Javafx accept bgra as input but not rgba).

Will you accept a PR with a configurable readFrameBuffer (where we can specify the format) ?

EDIT: the PR is to add an other readFrameBuffer with addtionnal parameter or made public the underlying method with all parameter. And to keep the existing readFrameBuffer as is.

I’m fine with it and wished it had been done when the conversion was made… but I defer to @Momoko_Fan since there may have been a reason he didn’t do it that way.

I think i proposed to do it when the change occurred and Kirill didn’t want to. I don’t remember why though so that could just be my memory failing me.

Thanks to @Momoko_Fan. I only saw the private method readFrameBufferWithGLFormat, but he provided a public readFrameBufferWithFormat .