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