Gamp v0.0.7-54-gccdc599
Gamp: Graphics, Audio, Multimedia and Processing
Loading...
Searching...
No Matches
gamp_graph_gl.cpp
Go to the documentation of this file.
1/*
2 * Author: Sven Gothel <sgothel@jausoft.com>
3 * Copyright Gothel Software e.K.
4 *
5 * SPDX-License-Identifier: MIT
6 *
7 * This Source Code Form is subject to the terms of the MIT License
8 * If a copy of the MIT was not distributed with this file,
9 * you can obtain one at https://opensource.org/license/mit/.
10 */
11
12#include <ctime>
13#include <jau/debug.hpp>
14#include <jau/environment.hpp>
15#include <jau/file_util.hpp>
16#include <jau/string_util.hpp>
17
23
24#include <gamp/graph/Graph.hpp>
27
30
31using namespace jau::enums;
32using namespace jau::math;
36
37using namespace gamp::graph;
38using namespace gamp::graph::gl;
39
40//
41//
42//
43
44jau::sc_atomic_int gamp::graph::gl::RenderState::nextID;
45
47 if( renderer.renderState().hintBitsSet(RenderState::BITHINT_GLOBAL_DEPTH_TEST_ENABLED) ) {
48 ::glDepthMask(false);
49 // ::glDisable(GL_DEPTH_TEST);
50 // ::glDepthFunc(GL_ALWAYS);
51 }
52 ::glEnable(GL_BLEND);
53 ::glBlendEquation(GL_FUNC_ADD); // default
54 renderer.renderState().setHintBits(RenderState::BITHINT_BLENDING_ENABLED);
55};
56
58 renderer.renderState().clearHintBits(RenderState::BITHINT_BLENDING_ENABLED);
59 ::glDisable(GL_BLEND);
60 if( renderer.renderState().hintBitsSet(RenderState::BITHINT_GLOBAL_DEPTH_TEST_ENABLED) ) {
61 // ::glEnable(GL_DEPTH_TEST);
62 // ::glDepthFunc(GL_LESS);
63 ::glDepthMask(true);
64 }
65};
static GLCallback defaultBlendEnable
Default GL#GL_BLEND enable GLCallback, turning-off depth writing via GL#glDepthMask(bool) if RenderSt...
jau::function< bool(GL &gl, GraphRenderer &renderer)> GLCallback
May be passed to <?
static GLCallback defaultBlendDisable
Default GL#GL_BLEND disable GLCallback, simply turning-off the GL#GL_BLEND state and turning-on depth...
static constexpr int BITHINT_GLOBAL_DEPTH_TEST_ENABLED
Bitfield hint, if set stating globally enabled GL#GL_DEPTH_TEST, otherwise disabled.
static constexpr int BITHINT_BLENDING_ENABLED
Bitfield hint, if set stating enabled GL#GL_BLEND, otherwise disabled.
Axis Aligned Bounding Box.
Definition aabbox3f.hpp:43
Represents a affine 2x3 transformation matrix in column major order (memory layout).
ordered_atomic< int, std::memory_order_seq_cst > sc_atomic_int
SC atomic integral scalar integer.
Author: Sven Gothel sgothel@jausoft.com Copyright Gothel Software e.K.
Definition enum_util.hpp:65