* @memberof ktxTexture1 @private * @brief Construct a ktxTexture1 from a ktxStream reading from a KTX source. * * The stream object is copied into the constructed ktxTexture1. * * The create flag KTX_TEXTURE_CREATE_LOAD_IMAGE_DATA_BIT should not be set, * if the ktxTexture1 is ultimately to be uploaded to OpenGL or Vulkan. This * will minimize memory usage by allowing, for example, loading
| 406 | * For other exceptions see ktxTexture1_constructFromStreamAndHeader(). |
| 407 | */ |
| 408 | static KTX_error_code |
| 409 | ktxTexture1_constructFromStream(ktxTexture1* This, ktxStream* pStream, |
| 410 | ktxTextureCreateFlags createFlags) |
| 411 | { |
| 412 | KTX_header header; |
| 413 | KTX_error_code result; |
| 414 | |
| 415 | // Read header. |
| 416 | result = pStream->read(pStream, &header, KTX_HEADER_SIZE); |
| 417 | if (result != KTX_SUCCESS) |
| 418 | return result; |
| 419 | |
| 420 | return ktxTexture1_constructFromStreamAndHeader(This, pStream, |
| 421 | &header, createFlags); |
| 422 | } |
| 423 | |
| 424 | /** |
| 425 | * @memberof ktxTexture1 @private |
no test coverage detected