GL_UNSIGNED_INT_8_8_8_8_REV doesn’t seem to work… Not supported, even if my OpenGL-version is 1.4… But nevermind, new hardware on its way
GL_BGRA works but thru GL_BGR_EXT…
But is’t the only solution? glReadPixels?
–
Thanks for your replys, helps alot and point me in the right direction…
GL_BGR_EXT isn’t good enough as OpenGL will have to take a 32-bit framebuffer, go through it 4 bytes at a time, and drop one of those 4 bytes in order to get your data out. Depending on your driver this may be done entirely in software, meaning that it also needs to allocate (and subsequently free) another buffer of it’s own in order to read back the data in it’s original native format. This is one reason why so many people experience bad performance with glReadPixels - they’re not coding close enough to the hardware. You need to be using the same format and layout as your framebuffer, and that means that you need a 4-component format in BGRA (or BGRX, same thing for the purposes of this discussion) layout.
If you don’t have a define for GL_BGRA you can just add one to your program; this will work with OpenGL 1.2 or above so you don’t need to worry about support unless you’re targetting really really old (over 10 years old) hardware. Likewise with GL_UNSIGNED_INT_8_8_8_8_REV.