sdlblendmode.inc 4.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. //from "sdl_blendmode.h"
  2. {**
  3. * The blend mode used in SDL_RenderCopy() and drawing operations.
  4. *}
  5. type
  6. PPSDL_BlendMode = ^PSDL_BlendMode;
  7. PSDL_BlendMode = ^TSDL_BlendMode;
  8. TSDL_BlendMode = type DWord;
  9. const
  10. SDL_BLENDMODE_NONE = TSDL_BlendMode($00000000); {**< no blending
  11. dstRGBA = srcRGBA *}
  12. SDL_BLENDMODE_BLEND = TSDL_BlendMode($00000001); {**< alpha blending
  13. dstRGB = (srcRGB * srcA) + (dstRGB * (1-srcA))
  14. dstA = srcA + (dstA * (1-srcA)) *}
  15. SDL_BLENDMODE_ADD = TSDL_BlendMode($00000002); {**< additive blending
  16. dstRGB = (srcRGB * srcA) + dstRGB
  17. dstA = dstA *}
  18. SDL_BLENDMODE_MOD = TSDL_BlendMode($00000004); {**< color modulate
  19. dstRGB = srcRGB * dstRGB
  20. dstA = dstA *}
  21. SDL_BLENDMODE_MUL = TSDL_BlendMode($00000008); {**< color multiply
  22. dstRGB = (srcRGB * dstRGB) + (dstRGB * (1-srcA))
  23. dstA = (srcA * dstA) + (dstA * (1-srcA)) *}
  24. SDL_BLENDMODE_INVALID = TSDL_BlendMode($7FFFFFFF); { }
  25. {* Additional custom blend modes can be returned by SDL_ComposeCustomBlendMode() *}
  26. {**
  27. * \brief The blend operation used when combining source and destination pixel components
  28. *}
  29. type
  30. PPSDL_BlendOperation = ^PSDL_BlendOperation;
  31. PSDL_BlendOperation = ^TSDL_BlendOperation;
  32. TSDL_BlendOperation = type DWord;
  33. const
  34. SDL_BLENDOPERATION_ADD = TSDL_BlendOperation($1); {**< dst + src: supported by all renderers *}
  35. SDL_BLENDOPERATION_SUBTRACT = TSDL_BlendOperation($2); {**< dst - src : supported by D3D9, D3D11, OpenGL, OpenGLES}
  36. SDL_BLENDOPERATION_REV_SUBTRACT = TSDL_BlendOperation($3); {**< src - dst : supported by D3D9, D3D11, OpenGL, OpenGLES}
  37. SDL_BLENDOPERATION_MINIMUM = TSDL_BlendOperation($4); {**< min(dst, src) : supported by D3D11 *}
  38. SDL_BLENDOPERATION_MAXIMUM = TSDL_BlendOperation($5); {**< max(dst, src) : supported by D3D11 *}
  39. {**
  40. * \brief The normalized factor used to multiply pixel components
  41. *}
  42. type
  43. PPSDL_BlendFactor = ^PSDL_BlendFactor;
  44. PSDL_BlendFactor = ^TSDL_BlendFactor;
  45. TSDL_BlendFactor = type DWord;
  46. const
  47. SDL_BLENDFACTOR_ZERO = TSDL_BlendFactor($1); {**< 0, 0, 0, 0 *}
  48. SDL_BLENDFACTOR_ONE = TSDL_BlendFactor($2); {**< 1, 1, 1, 1 *}
  49. SDL_BLENDFACTOR_SRC_COLOR = TSDL_BlendFactor($3); {**< srcR, srcG, srcB, srcA *}
  50. SDL_BLENDFACTOR_ONE_MINUS_SRC_COLOR = TSDL_BlendFactor($4); {**< 1-srcR, 1-srcG, 1-srcB, 1-srcA *}
  51. SDL_BLENDFACTOR_SRC_ALPHA = TSDL_BlendFactor($5); {**< srcA, srcA, srcA, srcA *}
  52. SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA = TSDL_BlendFactor($6); {**< 1-srcA, 1-srcA, 1-srcA, 1-srcA *}
  53. SDL_BLENDFACTOR_DST_COLOR = TSDL_BlendFactor($7); {**< dstR, dstG, dstB, dstA *}
  54. SDL_BLENDFACTOR_ONE_MINUS_DST_COLOR = TSDL_BlendFactor($8); {**< 1-dstR, 1-dstG, 1-dstB, 1-dstA *}
  55. SDL_BLENDFACTOR_DST_ALPHA = TSDL_BlendFactor($9); {**< dstA, dstA, dstA, dstA *}
  56. SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA = TSDL_BlendFactor($A); {**< 1-dstA, 1-dstA, 1-dstA, 1-dstA *}
  57. {**
  58. * \brief Create a custom blend mode, which may or may not be supported by a given renderer
  59. *
  60. * \param srcColorFactor source color factor
  61. * \param dstColorFactor destination color factor
  62. * \param colorOperation color operation
  63. * \param srcAlphaFactor source alpha factor
  64. * \param dstAlphaFactor destination alpha factor
  65. * \param alphaOperation alpha operation
  66. *
  67. * The result of the blend mode operation will be:
  68. * dstRGB = dstRGB * dstColorFactor colorOperation srcRGB * srcColorFactor
  69. * and
  70. * dstA = dstA * dstAlphaFactor alphaOperation srcA * srcAlphaFactor
  71. *}
  72. function SDL_ComposeCustomBlendMode(srcColorFactor, dstColorFactor: TSDL_BlendFactor; colorOperation: TSDL_BlendOperation; srcAlphaFactor, dstAlphaFactor: TSDL_BlendFactor; alphaOperation: TSDL_BlendOperation): TSDL_BlendMode; cdecl;
  73. external {$IFDEF DYNAMIC_LINK}SDL_LibName{$ENDIF} {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_ComposeCustomBlendMode' {$ENDIF} {$ENDIF};