void BlendEquationImplOGL::clear(const BlendEquation& eqn) const { if(eqn != BlendEquation()) { ASSERT_LOG(!get_equation_stack().empty(), "Something went badly wrong blend mode stack was empty."); get_equation_stack().pop(); BlendEquation& eqn = get_equation_stack().top(); glBlendEquationSeparate(convert_eqn(eqn.getRgbEquation()), convert_eqn(eqn.getAlphaEquation())); } }
BlendEquationScopeOGL::BlendEquationScopeOGL(const ScopeableValue& sv) : stored_(false) { const BlendEquation& eqn = sv.getBlendEquation(); if(sv.isBlendEquationSet() && eqn != BlendEquation()) { get_equation_stack().emplace(eqn); glBlendEquationSeparate(convert_eqn(eqn.getRgbEquation()), convert_eqn(eqn.getAlphaEquation())); stored_ = true; } }
void BlendEquationImplOGL::apply(const BlendEquation& eqn) const { if(eqn != BlendEquation()) { if(get_equation_stack().empty()) { get_equation_stack().emplace(BlendEquationConstants::BE_ADD, BlendEquationConstants::BE_ADD); } get_equation_stack().emplace(eqn); glBlendEquationSeparate(convert_eqn(eqn.getRgbEquation()), convert_eqn(eqn.getAlphaEquation())); } }
BlendEquation *BlendEquation::getOrCreate(GLenum func) { return getOrCreateImpl(BlendEquation(func)); }