* @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
| 1403 | * supported by OpenGL or Vulkan, e.g, a 3D array. |
| 1404 | */ |
| 1405 | KTX_error_code |
| 1406 | ktxTexture2_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 |
no test coverage detected