MCPcopy Create free account
hub / github.com/KhronosGroup/KTX-Software / ktxTexture1_constructFromStream

Function ktxTexture1_constructFromStream

lib/texture1.c:408–422  ·  view source on GitHub ↗

* @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

Source from the content-addressed store, hash-verified

406 * For other exceptions see ktxTexture1_constructFromStreamAndHeader().
407 */
408static KTX_error_code
409ktxTexture1_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

Calls 2

readMethod · 0.45

Tested by

no test coverage detected