/* * Author: Sven Gothel * Copyright Gothel Software e.K. * * SPDX-License-Identifier: MIT * * This Source Code Form is subject to the terms of the MIT License * If a copy of the MIT was not distributed with this file, * you can obtain one at https://opensource.org/license/mit/. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace jau::enums; using namespace jau::math; using jau::math::geom::Winding; using jau::math::geom::AABBox3f; using jau::math::geom::plane::AffineTransform; using namespace gamp::graph; using namespace gamp::graph::gl; // // // jau::sc_atomic_int gamp::graph::gl::RenderState::nextID; GraphRenderer::GLCallback GraphRenderer::defaultBlendEnable = [](GL&, GraphRenderer& renderer) { if( renderer.renderState().hintBitsSet(RenderState::BITHINT_GLOBAL_DEPTH_TEST_ENABLED) ) { ::glDepthMask(false); // ::glDisable(GL_DEPTH_TEST); // ::glDepthFunc(GL_ALWAYS); } ::glEnable(GL_BLEND); ::glBlendEquation(GL_FUNC_ADD); // default renderer.renderState().setHintBits(RenderState::BITHINT_BLENDING_ENABLED); }; GraphRenderer::GLCallback GraphRenderer::defaultBlendDisable = [](GL&, GraphRenderer& renderer) { renderer.renderState().clearHintBits(RenderState::BITHINT_BLENDING_ENABLED); ::glDisable(GL_BLEND); if( renderer.renderState().hintBitsSet(RenderState::BITHINT_GLOBAL_DEPTH_TEST_ENABLED) ) { // ::glEnable(GL_DEPTH_TEST); // ::glDepthFunc(GL_LESS); ::glDepthMask(true); } };