1 /+
2 +            Copyright 2022 – 2023 Aya Partridge
3 +          Copyright 2018 - 2022 Michael D. Parker
4 + Distributed under the Boost Software License, Version 1.0.
5 +     (See accompanying file LICENSE_1_0.txt or copy at
6 +           http://www.boost.org/LICENSE_1_0.txt)
7 +/
8 module sdl.blendmode;
9 
10 import bindbc.sdl.config;
11 import bindbc.sdl.codegen;
12 
13 // SDL_BlendMode
14 alias SDL_BlendMode = uint;
15 enum: SDL_BlendMode{
16 	SDL_BLENDMODE_NONE     = 0x00000000,
17 	SDL_BLENDMODE_BLEND    = 0x00000001,
18 	SDL_BLENDMODE_ADD      = 0x00000002,
19 	SDL_BLENDMODE_MOD      = 0x00000004,
20 }
21 static if(sdlSupport >= SDLSupport.v2_0_6)
22 enum: SDL_BlendMode{
23 	SDL_BLENDMODE_INVALID  = 0x7FFFFFFF,
24 }
25 static if(sdlSupport >= SDLSupport.v2_0_12)
26 enum: SDL_BlendMode{
27 	SDL_BLENDMODE_MUL      = 0x00000008,
28 }
29 
30 static if(sdlSupport >= SDLSupport.v2_0_6){
31 	alias SDL_BlendOperation = uint;
32 	enum: SDL_BlendOperation{
33 		SDL_BLENDOPERATION_ADD           = 0x1,
34 		SDL_BLENDOPERATION_SUBTRACT      = 0x2,
35 		SDL_BLENDOPERATION_REV_SUBTRACT  = 0x3,
36 		SDL_BLENDOPERATION_MINIMUM       = 0x4,
37 		SDL_BLENDOPERATION_MAXIMUM       = 0x5,
38 	}
39 	
40 	alias SDL_BlendFactor = uint;
41 	enum: SDL_BlendFactor{
42 		SDL_BLENDFACTOR_ZERO                 = 0x1,
43 		SDL_BLENDFACTOR_ONE                  = 0x2,
44 		SDL_BLENDFACTOR_SRC_COLOR            = 0x3,
45 		SDL_BLENDFACTOR_ONE_MINUS_SRC_COLOR  = 0x4,
46 		SDL_BLENDFACTOR_SRC_ALPHA            = 0x5,
47 		SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA  = 0x6,
48 		SDL_BLENDFACTOR_DST_COLOR            = 0x7,
49 		SDL_BLENDFACTOR_ONE_MINUS_DST_COLOR  = 0x8,
50 		SDL_BLENDFACTOR_DST_ALPHA            = 0x9,
51 		SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA  = 0xA,
52 		
53 		SDL_BLENDFACTOR_SRC_COLOUR           = SDL_BLENDFACTOR_SRC_COLOR,
54 		SDL_BLENDFACTOR_ONE_MINUS_SRC_COLOUR = SDL_BLENDFACTOR_ONE_MINUS_SRC_COLOR,
55 		SDL_BLENDFACTOR_DST_COLOUR           = SDL_BLENDFACTOR_DST_COLOR,
56 		SDL_BLENDFACTOR_ONE_MINUS_DST_COLOUR = SDL_BLENDFACTOR_ONE_MINUS_DST_COLOR,
57 	}
58 }
59 
60 mixin(joinFnBinds((){
61 	string[][] ret;
62 	static if(sdlSupport >= SDLSupport.v2_0_6){
63 		ret ~= makeFnBinds([
64 			[q{SDL_BlendMode}, q{SDL_ComposeCustomBlendMode}, q{SDL_BlendFactor srcColorFactor, SDL_BlendFactor dstColorFactor, SDL_BlendOperation colorOperation, SDL_BlendFactor srcAlphaFactor, SDL_BlendFactor dstAlphaFactor, SDL_BlendOperation alphaOperation}],
65 		]);
66 	}
67 	return ret;
68 }()));