io.rst 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. .. default-domain:: C
  2. io (input / output e.g. print)
  3. ================================================================================
  4. Header: cglm/io.h
  5. There are some built-in print functions which may save your time,
  6. especially for debugging.
  7. All functions accept **FILE** parameter which makes very flexible.
  8. You can even print it to file on disk.
  9. In general you will want to print them to console to see results.
  10. You can use **stdout** and **stderr** to write results to console.
  11. Some programs may occupy **stdout** but you can still use **stderr**.
  12. Using **stderr** is suggested.
  13. Example to print mat4 matrix:
  14. .. code-block:: c
  15. mat4 transform;
  16. /* ... */
  17. glm_mat4_print(transform, stderr);
  18. **NOTE:** print functions use **%0.4f** precision if you need more
  19. (you probably will in some cases), you can change it temporary.
  20. cglm may provide precision parameter in the future
  21. Table of contents (click to go):
  22. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  23. Functions:
  24. 1. :c:func:`glm_mat4_print`
  25. #. :c:func:`glm_mat3_print`
  26. #. :c:func:`glm_vec4_print`
  27. #. :c:func:`glm_vec3_print`
  28. #. :c:func:`glm_ivec3_print`
  29. #. :c:func:`glm_versor_print`
  30. #. :c:func:`glm_aabb_print`
  31. Functions documentation
  32. ~~~~~~~~~~~~~~~~~~~~~~~
  33. .. c:function:: void glm_mat4_print(mat4 matrix, FILE * __restrict ostream)
  34. | print mat4 to given stream
  35. Parameters:
  36. | *[in]* **matrix** matrix
  37. | *[in]* **ostream** FILE to write
  38. .. c:function:: void glm_mat3_print(mat3 matrix, FILE * __restrict ostream)
  39. | print mat3 to given stream
  40. Parameters:
  41. | *[in]* **matrix** matrix
  42. | *[in]* **ostream** FILE to write
  43. .. c:function:: void glm_vec4_print(vec4 vec, FILE * __restrict ostream)
  44. | print vec4 to given stream
  45. Parameters:
  46. | *[in]* **vec** vector
  47. | *[in]* **ostream** FILE to write
  48. .. c:function:: void glm_vec3_print(vec3 vec, FILE * __restrict ostream)
  49. | print vec3 to given stream
  50. Parameters:
  51. | *[in]* **vec** vector
  52. | *[in]* **ostream** FILE to write
  53. .. c:function:: void glm_ivec3_print(ivec3 vec, FILE * __restrict ostream)
  54. | print ivec3 to given stream
  55. Parameters:
  56. | *[in]* **vec** vector
  57. | *[in]* **ostream** FILE to write
  58. .. c:function:: void glm_versor_print(versor vec, FILE * __restrict ostream)
  59. | print quaternion to given stream
  60. Parameters:
  61. | *[in]* **vec** quaternion
  62. | *[in]* **ostream** FILE to write
  63. .. c:function:: void glm_aabb_print(versor vec, const char * __restrict tag, FILE * __restrict ostream)
  64. | print aabb to given stream
  65. Parameters:
  66. | *[in]* **vec** aabb (axis-aligned bounding box)
  67. | *[in]* **tag** tag to find it more easly in logs
  68. | *[in]* **ostream** FILE to write