2
0

temp.defines.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. /*
  2. * Copyright 2011-2025 Branimir Karadzic. All rights reserved.
  3. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
  4. */
  5. /*
  6. *
  7. * AUTO GENERATED FROM IDL! DO NOT EDIT! (source : $source)
  8. *
  9. * More info about IDL:
  10. * https://gist.github.com/bkaradzic/05a1c86a6dd57bf86e2d828878e88dc2#bgfx-is-switching-to-idl-to-generate-api
  11. *
  12. */
  13. #ifndef BGFX_DEFINES_H_HEADER_GUARD
  14. #define BGFX_DEFINES_H_HEADER_GUARD
  15. $version
  16. $cflags
  17. /// Blend function separate.
  18. #define BGFX_STATE_BLEND_FUNC_SEPARATE(_srcRGB, _dstRGB, _srcA, _dstA) (UINT64_C(0) \
  19. | ( ( (uint64_t)(_srcRGB)|( (uint64_t)(_dstRGB)<<4) ) ) \
  20. | ( ( (uint64_t)(_srcA )|( (uint64_t)(_dstA )<<4) )<<8) \
  21. )
  22. /// Blend equation separate.
  23. #define BGFX_STATE_BLEND_EQUATION_SEPARATE(_equationRGB, _equationA) ( (uint64_t)(_equationRGB)|( (uint64_t)(_equationA)<<3) )
  24. /// Blend function.
  25. #define BGFX_STATE_BLEND_FUNC(_src, _dst) BGFX_STATE_BLEND_FUNC_SEPARATE(_src, _dst, _src, _dst)
  26. /// Blend equation.
  27. #define BGFX_STATE_BLEND_EQUATION(_equation) BGFX_STATE_BLEND_EQUATION_SEPARATE(_equation, _equation)
  28. /// Utility predefined blend modes.
  29. /// Additive blending.
  30. #define BGFX_STATE_BLEND_ADD (0 \
  31. | BGFX_STATE_BLEND_FUNC(BGFX_STATE_BLEND_ONE, BGFX_STATE_BLEND_ONE) \
  32. )
  33. /// Alpha blend.
  34. #define BGFX_STATE_BLEND_ALPHA (0 \
  35. | BGFX_STATE_BLEND_FUNC(BGFX_STATE_BLEND_SRC_ALPHA, BGFX_STATE_BLEND_INV_SRC_ALPHA) \
  36. )
  37. /// Selects darker color of blend.
  38. #define BGFX_STATE_BLEND_DARKEN (0 \
  39. | BGFX_STATE_BLEND_FUNC(BGFX_STATE_BLEND_ONE, BGFX_STATE_BLEND_ONE) \
  40. | BGFX_STATE_BLEND_EQUATION(BGFX_STATE_BLEND_EQUATION_MIN) \
  41. )
  42. /// Selects lighter color of blend.
  43. #define BGFX_STATE_BLEND_LIGHTEN (0 \
  44. | BGFX_STATE_BLEND_FUNC(BGFX_STATE_BLEND_ONE, BGFX_STATE_BLEND_ONE) \
  45. | BGFX_STATE_BLEND_EQUATION(BGFX_STATE_BLEND_EQUATION_MAX) \
  46. )
  47. /// Multiplies colors.
  48. #define BGFX_STATE_BLEND_MULTIPLY (0 \
  49. | BGFX_STATE_BLEND_FUNC(BGFX_STATE_BLEND_DST_COLOR, BGFX_STATE_BLEND_ZERO) \
  50. )
  51. /// Opaque pixels will cover the pixels directly below them without any math or algorithm applied to them.
  52. #define BGFX_STATE_BLEND_NORMAL (0 \
  53. | BGFX_STATE_BLEND_FUNC(BGFX_STATE_BLEND_ONE, BGFX_STATE_BLEND_INV_SRC_ALPHA) \
  54. )
  55. /// Multiplies the inverse of the blend and base colors.
  56. #define BGFX_STATE_BLEND_SCREEN (0 \
  57. | BGFX_STATE_BLEND_FUNC(BGFX_STATE_BLEND_ONE, BGFX_STATE_BLEND_INV_SRC_COLOR) \
  58. )
  59. /// Decreases the brightness of the base color based on the value of the blend color.
  60. #define BGFX_STATE_BLEND_LINEAR_BURN (0 \
  61. | BGFX_STATE_BLEND_FUNC(BGFX_STATE_BLEND_DST_COLOR, BGFX_STATE_BLEND_INV_DST_COLOR) \
  62. | BGFX_STATE_BLEND_EQUATION(BGFX_STATE_BLEND_EQUATION_SUB) \
  63. )
  64. ///
  65. #define BGFX_STATE_BLEND_FUNC_RT_x(_src, _dst) (0 \
  66. | ( (uint32_t)( (_src)>>BGFX_STATE_BLEND_SHIFT) \
  67. | ( (uint32_t)( (_dst)>>BGFX_STATE_BLEND_SHIFT)<<4) ) \
  68. )
  69. ///
  70. #define BGFX_STATE_BLEND_FUNC_RT_xE(_src, _dst, _equation) (0 \
  71. | BGFX_STATE_BLEND_FUNC_RT_x(_src, _dst) \
  72. | ( (uint32_t)( (_equation)>>BGFX_STATE_BLEND_EQUATION_SHIFT)<<8) \
  73. )
  74. #define BGFX_STATE_BLEND_FUNC_RT_1(_src, _dst) (BGFX_STATE_BLEND_FUNC_RT_x(_src, _dst)<< 0)
  75. #define BGFX_STATE_BLEND_FUNC_RT_2(_src, _dst) (BGFX_STATE_BLEND_FUNC_RT_x(_src, _dst)<<11)
  76. #define BGFX_STATE_BLEND_FUNC_RT_3(_src, _dst) (BGFX_STATE_BLEND_FUNC_RT_x(_src, _dst)<<22)
  77. #define BGFX_STATE_BLEND_FUNC_RT_1E(_src, _dst, _equation) (BGFX_STATE_BLEND_FUNC_RT_xE(_src, _dst, _equation)<< 0)
  78. #define BGFX_STATE_BLEND_FUNC_RT_2E(_src, _dst, _equation) (BGFX_STATE_BLEND_FUNC_RT_xE(_src, _dst, _equation)<<11)
  79. #define BGFX_STATE_BLEND_FUNC_RT_3E(_src, _dst, _equation) (BGFX_STATE_BLEND_FUNC_RT_xE(_src, _dst, _equation)<<22)
  80. #endif // BGFX_DEFINES_H_HEADER_GUARD