The trick is to find format matches and enter the result of the correct data layout.
Allowed formats and types do not display the 1: 1 format in image formats, and will not allow more obscure formats, such as GL_R3_G3_B2, without additional conversion.
It will be GL_RGB, GL_UNSIGNED_BYTE_3_3_2
Also, the correct definition of type C for basic internal formats (for example, GL_RGB without size) implies some nontrivial work.
Yes Yes. * put on sunglasses * Deal with this !;)
As for the internal format. Hereby refers to
glGetTexLevelParameter(GL_TEXTURE_β¦, β¦, GL_TEXTURE_INTERNAL_FORMAT,β¦); glGetTexLevelParameter(GL_TEXTURE_β¦, β¦, GL_TEXTURE_{RED,GREEN,BLUE,ALPHA,DEPTH}_TYPE, β¦); glGetTexLevelParameter(GL_TEXTURE_β¦, β¦, GL_TEXTURE_{RED,GREEN,BLUE,ALPHA,DEPTH}_SIZE, β¦);
source share