MCPcopy Create free account
hub / github.com/davideberly/GeometricTools / Enable

Method Enable

GTE/Graphics/GL46/GL46BlendState.cpp:50–100  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48}
49
50void GL46BlendState::Enable()
51{
52 if (mEnableAlphaToCoverage)
53 {
54 glEnable(GL_SAMPLE_COVERAGE);
55 }
56 else
57 {
58 glDisable(GL_SAMPLE_COVERAGE);
59 }
60
61 if (mEnableIndependentBlend)
62 {
63 for (uint32_t i = 0; i < BlendState::NUM_TARGETS; ++i)
64 {
65 Target const& target = mTarget[i];
66 if (target.enable)
67 {
68 glEnablei(GL_BLEND, i);
69 glBlendFuncSeparatei(i, target.srcColor, target.dstColor,
70 target.srcAlpha, target.dstAlpha);
71 glBlendEquationSeparatei(i, target.opColor, target.opAlpha);
72 }
73 else
74 {
75 glDisablei(GL_BLEND, i);
76 }
77 glColorMaski(i, target.rMask, target.gMask, target.bMask, target.aMask);
78 glSampleMaski(i, mSampleMask);
79 }
80 }
81 else
82 {
83 Target const& target = mTarget[0];
84 if (target.enable)
85 {
86 glEnable(GL_BLEND);
87 glBlendFuncSeparate(target.srcColor, target.dstColor,
88 target.srcAlpha, target.dstAlpha);
89 glBlendEquationSeparate(target.opColor, target.opAlpha);
90 }
91 else
92 {
93 glDisable(GL_BLEND);
94 }
95 glColorMask(target.rMask, target.gMask, target.bMask, target.aMask);
96 glSampleMaski(0, mSampleMask);
97 }
98
99 glBlendColor(mBlendColor[0], mBlendColor[1], mBlendColor[2], mBlendColor[3]);
100}
101
102
103std::array<GLenum const, 17> GL46BlendState::msMode =

Callers

nothing calls this directly

Calls 12

glEnableFunction · 0.85
glDisableFunction · 0.85
glEnableiFunction · 0.85
glBlendFuncSeparateiFunction · 0.85
glBlendEquationSeparateiFunction · 0.85
glDisableiFunction · 0.85
glColorMaskiFunction · 0.85
glSampleMaskiFunction · 0.85
glBlendFuncSeparateFunction · 0.85
glBlendEquationSeparateFunction · 0.85
glColorMaskFunction · 0.85
glBlendColorFunction · 0.85

Tested by

no test coverage detected