Hi, i’ve done some development in opengl (especially on the implementation of a glx low level renderer in juce), and i discovered i practically can’t use opengl textures straight away from juce Image cause the internal format isn’t properly understood by the opengl driver which expect a RGBA (at least RGB or APHA_LUMINANCE) but not BGRA framebuffer (and no way for ARGB which is a rather uncommon colour pixel format from what i see around in other graphics libraries).
The juce image framebuffer structure is platform dependant, and on x86 machine is actually BGRA (which there isn’t any format in openGL right away, unless you use obscure and undocumented opengl extension, namely GL_BGRA_EXT which is also not present in a lot of video drivers implementation).
At the moment it is not possible to do a proper creation of a texture image using glTexImage2D without involving a colour space conversion before it (which is quite cpu consuming when you have big textures, generally a useless waste of cpu cycles).
The problem is visible also in the JuceDemo:
the background image behind the rotating cube is practically wrong cause the orange should not be blue (you can see the png to verify).
What should be the right way to mix the power of juce Images (ease of loading/saving, manipulation through Graphic class) and opengl textures without involving too much conversions or memory allocations ? Should a proper PixelRGBA format be added to the library ? Or there are some obscure opengl formats or special keywords i don’t know ?