1 2 // Copyright Michael D. Parker 2018. 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 static if(sdlSupport >= SDLSupport.sdl206) { 12 enum SDL_BlendMode { 13 SDL_BLENDMODE_NONE = 0x00000000, 14 SDL_BLENDMODE_BLEND = 0x00000001, 15 SDL_BLENDMODE_ADD = 0x00000002, 16 SDL_BLENDMODE_MOD = 0x00000004, 17 SDL_BLENDMODE_INVALID = 0x7FFFFFFF, 18 } 19 20 enum SDL_BlendOperation { 21 SDL_BLENDOPERATION_ADD = 0x1, 22 SDL_BLENDOPERATION_SUBTRACT = 0x2, 23 SDL_BLENDOPERATION_REV_SUBTRACT = 0x3, 24 SDL_BLENDOPERATION_MINIMUM = 0x4, 25 SDL_BLENDOPERATION_MAXIMUM = 0x5, 26 } 27 mixin(expandEnum!SDL_BlendOperation); 28 29 enum SDL_BlendFactor { 30 SDL_BLENDFACTOR_ZERO = 0x1, 31 SDL_BLENDFACTOR_ONE = 0x2, 32 SDL_BLENDFACTOR_SRC_COLOR = 0x3, 33 SDL_BLENDFACTOR_ONE_MINUS_SRC_COLOR = 0x4, 34 SDL_BLENDFACTOR_SRC_ALPHA = 0x5, 35 SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA = 0x6, 36 SDL_BLENDFACTOR_DST_COLOR = 0x7, 37 SDL_BLENDFACTOR_ONE_MINUS_DST_COLOR = 0x8, 38 SDL_BLENDFACTOR_DST_ALPHA = 0x9, 39 SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA = 0xA, 40 } 41 mixin(expandEnum!SDL_BlendFactor); 42 } 43 else { 44 enum SDL_BlendMode { 45 SDL_BLENDMODE_NONE = 0x00000000, 46 SDL_BLENDMODE_BLEND = 0x00000001, 47 SDL_BLENDMODE_ADD = 0x00000002, 48 SDL_BLENDMODE_MOD = 0x00000004, 49 } 50 } 51 52 version(BindSDL_Static) { 53 extern(C) @nogc nothrow { 54 static if(sdlSupport >= SDLSupport.sdl206) { 55 SDL_BlendMode SDL_ComposeCustomBlendMode(SDL_BlendFactor,SDL_BlendFactor,SDL_BlendOperation,SDL_BlendFactor,SDL_BlendFactor,SDL_BlendOperation); 56 } 57 } 58 } 59 else { 60 static if(sdlSupport >= SDLSupport.sdl206) { 61 extern(C) @nogc nothrow { 62 alias pSDL_ComposeCustomBlendMode = SDL_BlendMode function(SDL_BlendFactor,SDL_BlendFactor,SDL_BlendOperation,SDL_BlendFactor,SDL_BlendFactor,SDL_BlendOperation); 63 } 64 65 __gshared { 66 pSDL_ComposeCustomBlendMode SDL_ComposeCustomBlendMode; 67 } 68 } 69 }