|
1 | 1 | /** |
2 | 2 | * cgltf - a single-file glTF 2.0 parser written in C99. |
| 3 | + * |
| 4 | + * Version: 1.0 |
| 5 | + * |
| 6 | + * Website: https://github.com/jkuhlmann/cgltf |
| 7 | + * |
3 | 8 | * Distributed under the MIT License, see notice at the end of this file. |
| 9 | + * |
| 10 | + * Building: |
| 11 | + * Include this file where you need the struct and function |
| 12 | + * declarations. Have exactly one source file where you define |
| 13 | + * `CGLTF_IMPLEMENTATION` before including this file to get the |
| 14 | + * function definitions. |
| 15 | + * |
| 16 | + * Reference: |
| 17 | + * `cgltf_result cgltf_parse(const cgltf_options*, const void*, |
| 18 | + * cgltf_size, cgltf_data**)` parses both glTF and GLB data. If |
| 19 | + * this function returns `cgltf_result_success`, you have to call |
| 20 | + * `cgltf_free()` on the created `cgltf_data*` variable. |
| 21 | + * Note that contents of external files for buffers and images are not |
| 22 | + * automatically loaded. You'll need to read these files yourself using |
| 23 | + * URIs in the `cgltf_data` structure. |
| 24 | + * |
| 25 | + * `cgltf_options` is the struct passed to `cgltf_parse()` to control |
| 26 | + * parts of the parsing process. You can use it to force the file type |
| 27 | + * and provide memory allocation callbacks. Should be zero-initialized |
| 28 | + * to trigger default behavior. |
| 29 | + * |
| 30 | + * `cgltf_data` is the struct allocated and filled by `cgltf_parse()`. |
| 31 | + * It generally mirrors the glTF format as described by the spec (see |
| 32 | + * https://github.com/KhronosGroup/glTF/tree/master/specification/2.0). |
| 33 | + * |
| 34 | + * `void cgltf_free(cgltf_data*)` frees the allocated `cgltf_data` |
| 35 | + * variable. |
| 36 | + * |
| 37 | + * `cgltf_result cgltf_load_buffers(const cgltf_options*, cgltf_data*, |
| 38 | + * const char*)` can be optionally called to open and read buffer |
| 39 | + * files using the `FILE*` APIs. |
| 40 | + * |
| 41 | + * `cgltf_result cgltf_parse_file(const cgltf_options* options, const |
| 42 | + * char* path, cgltf_data** out_data)` can be used to open the given |
| 43 | + * file using `FILE*` APIs and parse the data using `cgltf_parse()`. |
| 44 | + * |
| 45 | + * `cgltf_result cgltf_validate(cgltf_data*)` can be used to do additional |
| 46 | + * checks to make sure the parsed glTF data is valid. |
4 | 47 | */ |
5 | 48 | #ifndef CGLTF_H_INCLUDED__ |
6 | 49 | #define CGLTF_H_INCLUDED__ |
|
0 commit comments