api_inline_array.rst 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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. mat3
  39. mat4
  40. vec2
  41. vec2-ext
  42. vec3
  43. vec3-ext
  44. vec4
  45. vec4-ext
  46. ivec2
  47. ivec3
  48. ivec4
  49. color
  50. plane
  51. project
  52. util
  53. io
  54. call
  55. sphere
  56. curve
  57. bezier
  58. version
  59. ray