* @memberof ktxTexture2 @private * @~English * @brief Construct a ktxTexture from a ktxStream reading from a KTX source. * * The stream object is copied into the constructed ktxTexture2. * * The create flag KTX_TEXTURE_CREATE_LOAD_IMAGE_DATA_BIT should not be set, * if the ktxTexture is ultimately to be uploaded to OpenGL or Vulkan. This * will minimize memory usage by allowing, for exampl
| 1089 | * For other exceptions see ktxTexture2_constructFromStreamAndHeader(). |
| 1090 | */ |
| 1091 | static KTX_error_code |
| 1092 | ktxTexture2_constructFromStream(ktxTexture2* This, ktxStream* pStream, |
| 1093 | ktxTextureCreateFlags createFlags) |
| 1094 | { |
| 1095 | KTX_header2 header; |
| 1096 | KTX_error_code result; |
| 1097 | |
| 1098 | // Read header. |
| 1099 | result = pStream->read(pStream, &header, KTX2_HEADER_SIZE); |
| 1100 | if (result != KTX_SUCCESS) |
| 1101 | return result; |
| 1102 | |
| 1103 | #if IS_BIG_ENDIAN |
| 1104 | // byte swap the header |
| 1105 | #endif |
| 1106 | return ktxTexture2_constructFromStreamAndHeader(This, pStream, |
| 1107 | &header, createFlags); |
| 1108 | } |
| 1109 | |
| 1110 | /** |
| 1111 | * @memberof ktxTexture2 @private |
no test coverage detected