but it seemed no use.
I still can’t use the blendmode:
SDL_BlendMode GLBblendmode02 = SDL_ComposeCustomBlendMode(SDL_BLENDFACTOR_SRC_ALPHA, SDL_BLENDFACTOR_ONE, SDL_BLENDOPERATION_MAXIMUM,
SDL_BLENDFACTOR_ZERO, SDL_BLENDFACTOR_ONE, SDL_BLENDOPERATION_MAXIMUM);
The documentation states that Direct3D supports only SDL_BLENDOPERATION_ADD and that Direct3D11 may “produce unexpected results” with SDL_BLENDOPERATION_MAXIMUM, so perhaps that is not surprising.
You should be able to change the alpha operation to SDL_BLENDOPERATION_ADD without it affecting anything because the maximum of zero and dstAlpha is the same as the sum of zero and dstAlpha.
But when I use the code：
I even can’t use the SDL_BLENDOPERATION_SUBTRACT :
SDL_BlendMode GLBblendmode01 = SDL_ComposeCustomBlendMode(SDL_BLENDFACTOR_SRC_ALPHA, SDL_BLENDFACTOR_ONE, SDL_BLENDOPERATION_SUBTRACT,SDL_BLENDFACTOR_ZERO, SDL_BLENDFACTOR_ONE, SDL_BLENDOPERATION_SUBTRACT);
So I think maybe I’m not really using direct3d as the renderer driver.
And now I solved the problem by another way.
I implemented a blendmode called ‘Linear dodge’,
the function is max(A+B-255, 0)
and it equals to 255 - min(255, (255-A) + (255-B) ).
SDL_BLENDOPERATION_ADD can calculate min(255, A + B). XD