1 2 // Copyright 2018 - 2021 Michael D. Parker 3 // Distributed under the Boost Software License, Version 1.0. 4 // (See accompanying file LICENSE_1_0.txt or copy at 5 // http://www.boost.org/LICENSE_1_0.txt) 6 7 module bindbc.sdl.bind.sdlblendmode; 8 9 import bindbc.sdl.config; 10 11 // SDL_BlendMode 12 enum SDL_BLENDMODE_NONE = 0x00000000; 13 enum SDL_BLENDMODE_BLEND = 0x00000001; 14 enum SDL_BLENDMODE_ADD = 0x00000002; 15 enum SDL_BLENDMODE_MOD = 0x00000004; 16 static if(sdlSupport >= SDLSupport.sdl2012) { 17 enum SDL_BLENDMODE_MUL = 0x00000008; 18 } 19 static if(sdlSupport >= SDLSupport.sdl206) { 20 enum SDL_BLENDMODE_INVALID = 0x7FFFFFFF; 21 } 22 alias SDL_BlendMode = int; 23 24 static if(sdlSupport >= SDLSupport.sdl206) { 25 enum SDL_BlendOperation { 26 SDL_BLENDOPERATION_ADD = 0x1, 27 SDL_BLENDOPERATION_SUBTRACT = 0x2, 28 SDL_BLENDOPERATION_REV_SUBTRACT = 0x3, 29 SDL_BLENDOPERATION_MINIMUM = 0x4, 30 SDL_BLENDOPERATION_MAXIMUM = 0x5, 31 } 32 mixin(expandEnum!SDL_BlendOperation); 33 34 enum SDL_BlendFactor { 35 SDL_BLENDFACTOR_ZERO = 0x1, 36 SDL_BLENDFACTOR_ONE = 0x2, 37 SDL_BLENDFACTOR_SRC_COLOR = 0x3, 38 SDL_BLENDFACTOR_ONE_MINUS_SRC_COLOR = 0x4, 39 SDL_BLENDFACTOR_SRC_ALPHA = 0x5, 40 SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA = 0x6, 41 SDL_BLENDFACTOR_DST_COLOR = 0x7, 42 SDL_BLENDFACTOR_ONE_MINUS_DST_COLOR = 0x8, 43 SDL_BLENDFACTOR_DST_ALPHA = 0x9, 44 SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA = 0xA, 45 } 46 mixin(expandEnum!SDL_BlendFactor); 47 } 48 49 static if(staticBinding) { 50 extern(C) @nogc nothrow { 51 static if(sdlSupport >= SDLSupport.sdl206) { 52 SDL_BlendMode SDL_ComposeCustomBlendMode(SDL_BlendFactor srcColorFactor, SDL_BlendFactor dstColorFactor, SDL_BlendOperation colorOperation, SDL_BlendFactor srcAlphaFactor, SDL_BlendFactor dstAlphaFactor, SDL_BlendOperation alphaOperation); 53 } 54 } 55 } 56 else { 57 static if(sdlSupport >= SDLSupport.sdl206) { 58 extern(C) @nogc nothrow { 59 alias pSDL_ComposeCustomBlendMode = SDL_BlendMode function(SDL_BlendFactor srcColorFactor, SDL_BlendFactor dstColorFactor, SDL_BlendOperation colorOperation, SDL_BlendFactor srcAlphaFactor, SDL_BlendFactor dstAlphaFactor, SDL_BlendOperation alphaOperation); 60 } 61 62 __gshared { 63 pSDL_ComposeCustomBlendMode SDL_ComposeCustomBlendMode; 64 } 65 } 66 }