Skip to content

Commit 2fe252f

Browse files
Merge pull request #3 from suve/add-missing-blend-enums
Add missing blend enums
2 parents 4dfb389 + 36c56c8 commit 2fe252f

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

sdlblendmode.inc

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,48 @@ const
1313
SDL_BLENDMODE_BLEND = $00000001; {**< dst = (src * A) + (dst * (1-A)) *}
1414
SDL_BLENDMODE_ADD = $00000002; {**< dst = (src * A) + dst *}
1515
SDL_BLENDMODE_MOD = $00000004; {**< dst = src * dst *}
16+
17+
type
18+
PSDL_BlendOperation = ^TSDL_BlendOperation;
19+
TSDL_BlendOperation = DWord;
20+
21+
const
22+
SDL_BLENDOPERATION_ADD = $1; {**< dst + src: supported by all renderers *}
23+
SDL_BLENDOPERATION_SUBTRACT = $2; {**< dst - src : supported by D3D9, D3D11, OpenGL, OpenGLES}
24+
SDL_BLENDOPERATION_REV_SUBTRACT = $3; {**< src - dst : supported by D3D9, D3D11, OpenGL, OpenGLES}
25+
SDL_BLENDOPERATION_MINIMUM = $4; {**< min(dst, src) : supported by D3D11 *}
26+
SDL_BLENDOPERATION_MAXIMUM = $5; {**< max(dst, src) : supported by D3D11 *}
27+
28+
type
29+
PSDL_BlendFactor = ^TSDL_BlendFactor;
30+
TSDL_BlendFactor = DWord;
31+
32+
const
33+
SDL_BLENDFACTOR_ZERO = $1; {**< 0, 0, 0, 0 *}
34+
SDL_BLENDFACTOR_ONE = $2; {**< 1, 1, 1, 1 *}
35+
SDL_BLENDFACTOR_SRC_COLOR = $3; {**< srcR, srcG, srcB, srcA *}
36+
SDL_BLENDFACTOR_ONE_MINUS_SRC_COLOR = $4; {**< 1-srcR, 1-srcG, 1-srcB, 1-srcA *}
37+
SDL_BLENDFACTOR_SRC_ALPHA = $5; {**< srcA, srcA, srcA, srcA *}
38+
SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA = $6; {**< 1-srcA, 1-srcA, 1-srcA, 1-srcA *}
39+
SDL_BLENDFACTOR_DST_COLOR = $7; {**< dstR, dstG, dstB, dstA *}
40+
SDL_BLENDFACTOR_ONE_MINUS_DST_COLOR = $8; {**< 1-dstR, 1-dstG, 1-dstB, 1-dstA *}
41+
SDL_BLENDFACTOR_DST_ALPHA = $9; {**< dstA, dstA, dstA, dstA *}
42+
SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA = $A; {**< 1-dstA, 1-dstA, 1-dstA, 1-dstA *}
43+
44+
{**
45+
* \brief Create a custom blend mode, which may or may not be supported by a given renderer
46+
*
47+
* \param srcColorFactor source color factor
48+
* \param dstColorFactor destination color factor
49+
* \param colorOperation color operation
50+
* \param srcAlphaFactor source alpha factor
51+
* \param dstAlphaFactor destination alpha factor
52+
* \param alphaOperation alpha operation
53+
*
54+
* The result of the blend mode operation will be:
55+
* dstRGB = dstRGB * dstColorFactor colorOperation srcRGB * srcColorFactor
56+
* and
57+
* dstA = dstA * dstAlphaFactor alphaOperation srcA * srcAlphaFactor
58+
*}
59+
Function SDL_ComposeCustomBlendMode(srcColorFactor, dstColorFactor : TSDL_BlendFactor; colorOperation : TSDL_BlendOperation; srcAlphaFactor, dstAlphaFactor : TSDL_BlendFactor; alphaOperation : TSDL_BlendOperation) : TSDL_BlendMode cdecl;
60+
external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_ComposeCustomBlendMode' {$ENDIF} {$ENDIF};

0 commit comments

Comments
 (0)