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

Function ktxTexture2_CreateFromStdioStream

lib/texture2.c:1405–1427  ·  view source on GitHub ↗

* @memberof ktxTexture2 * @~English * @brief Create a ktxTexture2 from a stdio stream reading from a KTX source. * * The address of a newly created ktxTexture2 reflecting the contents of the * stdio stream is written to the location pointed at by @p newTex. * * The create flag KTX_TEXTURE_CREATE_LOAD_IMAGE_DATA_BIT should not be set, * if the ktxTexture is ultimately to be uploaded to Open

Source from the content-addressed store, hash-verified

1403 * supported by OpenGL or Vulkan, e.g, a 3D array.
1404 */
1405KTX_error_code
1406ktxTexture2_CreateFromStdioStream(FILE* stdioStream,
1407 ktxTextureCreateFlags createFlags,
1408 ktxTexture2** newTex)
1409{
1410 KTX_error_code result;
1411 if (newTex == NULL)
1412 return KTX_INVALID_VALUE;
1413
1414 ktxTexture2* tex = (ktxTexture2*)malloc(sizeof(ktxTexture2));
1415 if (tex == NULL)
1416 return KTX_OUT_OF_MEMORY;
1417
1418 result = ktxTexture2_constructFromStdioStream(tex, stdioStream,
1419 createFlags);
1420 if (result == KTX_SUCCESS)
1421 *newTex = (ktxTexture2*)tex;
1422 else {
1423 free(tex);
1424 *newTex = NULL;
1425 }
1426 return result;
1427}
1428
1429/**
1430 * @memberof ktxTexture2

Callers 3

patchWithLibKtxMethod · 0.85
createKTXTextureMethod · 0.85
mainMethod · 0.85

Tested by

no test coverage detected