2
0

api_inline_array.rst 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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:`struct-api` 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. quat
  36. euler
  37. mat2
  38. mat2x3
  39. mat2x4
  40. mat3
  41. mat3x2
  42. mat3x4
  43. mat4
  44. mat4x2
  45. mat4x3
  46. vec2
  47. vec2-ext
  48. vec3
  49. vec3-ext
  50. vec4
  51. vec4-ext
  52. ivec2
  53. ivec3
  54. ivec4
  55. color
  56. plane
  57. project
  58. util
  59. io
  60. call
  61. sphere
  62. curve
  63. bezier
  64. version
  65. ray