io.rst 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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. Functions documentation
  31. ~~~~~~~~~~~~~~~~~~~~~~~
  32. .. c:function:: void glm_mat4_print(mat4 matrix, FILE * __restrict ostream)
  33. | print mat4 to given stream
  34. Parameters:
  35. | *[in]* **matrix** matrix
  36. | *[in]* **ostream** FILE to write
  37. .. c:function:: void glm_mat3_print(mat3 matrix, FILE * __restrict ostream)
  38. | print mat3 to given stream
  39. Parameters:
  40. | *[in]* **matrix** matrix
  41. | *[in]* **ostream** FILE to write
  42. .. c:function:: void glm_vec4_print(vec4 vec, FILE * __restrict ostream)
  43. | print vec4 to given stream
  44. Parameters:
  45. | *[in]* **vec** vector
  46. | *[in]* **ostream** FILE to write
  47. .. c:function:: void glm_vec3_print(vec3 vec, FILE * __restrict ostream)
  48. | print vec3 to given stream
  49. Parameters:
  50. | *[in]* **vec** vector
  51. | *[in]* **ostream** FILE to write
  52. .. c:function:: void glm_ivec3_print(ivec3 vec, FILE * __restrict ostream)
  53. | print ivec3 to given stream
  54. Parameters:
  55. | *[in]* **vec** vector
  56. | *[in]* **ostream** FILE to write
  57. .. c:function:: void glm_versor_print(versor vec, FILE * __restrict ostream)
  58. | print quaternion to given stream
  59. Parameters:
  60. | *[in]* **vec** quaternion
  61. | *[in]* **ostream** FILE to write