1 module bindbc.opengl.bind.khr.khr_01;
2 
3 import bindbc.loader;
4 import bindbc.opengl.config,
5        bindbc.opengl.context;
6 import bindbc.opengl.bind.types;
7 
8 
9 // KHR_blend_equation_advanced
10 version(GL_KHR) enum useKHRBlendEquationAdvanced = true;
11 else version(GL_KHR_blend_equation_advanced) enum useKHRBlendEquationAdvanced = true;
12 else version(GL_KHR_blend_equation_advanced_coherent) enum useKHRBlendEquationAdvanced = true;
13 else enum useKHRBlendEquationAdvanced = false;
14 
15 static if(useKHRBlendEquationAdvanced) {
16     private bool _hasKHRBlendEquationAdvanced;
17     private bool _hasKHRBlendEquationAdvancedCoherent;
18     @nogc nothrow bool hasKHRBlendEquationAdvanced() { return _hasKHRBlendEquationAdvanced; }
19     @nogc nothrow bool hasKHRBlendEquationAdvancedCoherent() { return _hasKHRBlendEquationAdvancedCoherent; }
20 
21     enum uint GL_BLEND_ADVANCED_COHERENT_KHR = 0x9285;
22     
23     enum uint GL_MULTIPLY_KHR = 0x9294;
24     enum uint GL_SCREEN_KHR = 0x9295;
25     enum uint GL_OVERLAY_KHR = 0x9296;
26     enum uint GL_DARKEN_KHR = 0x9297;
27     enum uint GL_LIGHTEN_KHR = 0x9298;
28     enum uint GL_COLORDODGE_KHR = 0x9299;
29     enum uint GL_COLORBURN_KHR = 0x929A;
30     enum uint GL_HARDLIGHT_KHR = 0x929B;
31     enum uint GL_SOFTLIGHT_KHR = 0x929C;
32     enum uint GL_DIFFERENCE_KHR = 0x929E;
33     enum uint GL_EXCLUSION_KHR = 0x92A0;
34     enum uint GL_HSL_HUE_KHR = 0x92AD;
35     enum uint GL_HSL_SATURATION_KHR = 0x92AE;
36     enum uint GL_HSL_COLOR_KHR = 0x92AF;
37     enum uint GL_HSL_LUMINOSITY_KHR = 0x92B0;
38 
39 
40     extern(System) @nogc nothrow  {
41         alias pglBlendBarrierKHR = void function();
42     }
43 
44     __gshared {
45         pglBlendBarrierKHR glBlendBarrierKHR;
46     }
47 
48     private @nogc nothrow
49     bool loadKHRBlendEquationAdvanced(SharedLib lib, GLSupport contextVersion)
50     {
51         lib.bindGLSymbol(cast(void**)&glBlendBarrierKHR, "glBlendBarrierKHR");
52         return resetErrorCountGL();
53     }
54 } else {
55     enum hasKHRBlendEquationAdvanced = false;
56     enum hasKHRBlendEquationAdvancedCoherent = false;
57 }
58 
59 package @nogc nothrow
60 void loadKHR_01(SharedLib lib, GLSupport contextVersion) {
61     static if(useKHRBlendEquationAdvanced) {
62         _hasKHRBlendEquationAdvanced =
63             hasExtension(contextVersion, "GL_KHR_blend_equation_advanced") &&
64             lib.loadKHRBlendEquationAdvanced(contextVersion);
65         _hasKHRBlendEquationAdvancedCoherent = hasExtension(contextVersion, "GL_KHR_blend_equation_advanced_coherent");
66     }
67 }