Adding GPU_BLEND_MULTIPLY_COLOR
This pull request adds GPU_BLEND_MULTIPLY_COLOR, which is functionally identical to SDL_BLENDMODE_MOD (see https://wiki.libsdl.org/SDL_BlendMode).
SDL_BLENDMODE_MOD
color modulate
dstRGB = srcRGB * dstRGB
dstA = dstA
I also omitted value initialization from the GPU_BlendPresetEnum enumerated list to make for quicker editing in the future. This is because
typedef enum {
A,
B,
C
} ABCenum;
is treated identically to
typedef enum {
A = 0,
B = 1,
C = 2
} ABCenum;
by compilers. The same code is generated, but it's now easier to add, say, A2 between A and B without having to manually go through and say B=2 and C=3 now.
I hope that makes sense and that this helps. Keep up the great work on this API!
I'll take another look at this. The feature is a good one.
The value initialization is intentional in order to preserve value compatibility. If a new value is added, it should not change the values of the ones that already exist unless a breaking change is acceptable.