api_inline_array.rst 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. Array API - Inline (Default)
  2. ========================================
  3. This is the default API of *cglm*. All functions are forced to be inlined
  4. and struct api, call api uses this inline api to share implementation.
  5. 📌 Call api is also array api but it is not inlined.
  6. In the future there may be option to forward struct api to call api instead of inline api to reduce binary size if needed.
  7. 📌 **USE this API docs for similar functions in struct and call api**
  8. 📌 In struct api you can omit namespace e.g :code:`glms_vec3_dot` can be called as :code:`vec3_dot` in struct api, see :doc:`api_struct` to configure struct api for more details.
  9. 📌 In struct api functions can return struct/union
  10. 📌 In struct api you can access items like **.x**, **.y**, **.z**, **.w**, **.r**, **.g**, **.b**, **.a**, **.m00**, **m01**...
  11. Some functions may exist twice, once for their namespace and once for global namespace
  12. to make easier to write very common functions
  13. For instance, in general we use :code:`glm_vec3_dot` to get dot product
  14. of two **vec3**. Now we can also do this with :code:`glm_dot`,
  15. same for *_cross* and so on...
  16. The original function stays where it is, the function in global namespace
  17. of same name is just an alias, so there is no call version of those functions.
  18. e.g there is no func like :code:`glmc_dot` because *glm_dot* is just alias for
  19. :code:`glm_vec3_dot`
  20. By including **cglm/cglm.h** header you will include all inline version
  21. of functions. Since functions in this header[s] are inline you don't need to
  22. build or link *cglm* against your project.
  23. But by including **cglm/call.h** header you will include all *non-inline*
  24. version of functions. You need to build *cglm* and link it.
  25. Follow the :doc:`build` documentation for this
  26. .. toctree::
  27. :maxdepth: 1
  28. :caption: API categories:
  29. affine
  30. affine-mat
  31. affine2d
  32. cam
  33. frustum
  34. box
  35. aabb2d
  36. quat
  37. euler
  38. mat2
  39. mat2x3
  40. mat2x4
  41. mat3
  42. mat3x2
  43. mat3x4
  44. mat4
  45. mat4x2
  46. mat4x3
  47. vec2
  48. vec2-ext
  49. vec3
  50. vec3-ext
  51. vec4
  52. vec4-ext
  53. ivec2
  54. ivec3
  55. ivec4
  56. color
  57. plane
  58. noise
  59. project
  60. util
  61. io
  62. call
  63. sphere
  64. curve
  65. bezier
  66. version
  67. ray