#include <BlendMode.hpp>
Blending modes for drawing.
When drawing something into a smk::RenderTarget, the smk::BlendMode represents how the colors are mixed with the colors already in the color buffer.
SMK provides 6 predefined common BlendMode:
This struct wrap all the parameters used by: https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glBlendEquation.xhtml
They define how the destination "dst" pixel is computed, knowing the source "src" pixel value.
Definition at line 62 of file BlendMode.hpp.
Public Member Functions | |
bool | operator== (const BlendMode &) const |
bool | operator!= (const BlendMode &) const |
Public Attributes | |
GLenum | equation_rgb = GL_FUNC_ADD |
GLenum | equation_alpha = GL_FUNC_ADD |
GLenum | src_rgb = GL_SRC_ALPHA |
GLenum | dst_rgb = GL_ONE_MINUS_SRC_ALPHA |
GLenum | src_alpha = GL_ONE |
GLenum | dst_alpha = GL_ONE |
Static Public Attributes | |
static const BlendMode | Replace |
destination = source. More... | |
static const BlendMode | Add |
destination += source. More... | |
static const BlendMode | Subtract |
destination -= source. More... | |
static const BlendMode | Multiply |
destination *= source More... | |
static const BlendMode | Alpha |
destination = source * source.a + destination * (1 - souce.a) More... | |
static const BlendMode | Invert |
destination = 1 - destination More... | |
bool smk::BlendMode::operator!= | ( | const BlendMode & | o | ) | const |
Definition at line 60 of file BlendMode.cpp.
bool smk::BlendMode::operator== | ( | const BlendMode & | o | ) | const |
Definition at line 51 of file BlendMode.cpp.
|
static |
destination += source.
Definition at line 65 of file BlendMode.hpp.
|
static |
destination = source * source.a + destination * (1 - souce.a)
Definition at line 68 of file BlendMode.hpp.
GLenum smk::BlendMode::dst_alpha = GL_ONE |
Definition at line 79 of file BlendMode.hpp.
GLenum smk::BlendMode::dst_rgb = GL_ONE_MINUS_SRC_ALPHA |
Definition at line 77 of file BlendMode.hpp.
GLenum smk::BlendMode::equation_alpha = GL_FUNC_ADD |
Definition at line 73 of file BlendMode.hpp.
GLenum smk::BlendMode::equation_rgb = GL_FUNC_ADD |
Definition at line 72 of file BlendMode.hpp.
|
static |
destination = 1 - destination
Definition at line 69 of file BlendMode.hpp.
|
static |
destination *= source
Definition at line 67 of file BlendMode.hpp.
|
static |
destination = source.
Definition at line 64 of file BlendMode.hpp.
GLenum smk::BlendMode::src_alpha = GL_ONE |
Definition at line 78 of file BlendMode.hpp.
GLenum smk::BlendMode::src_rgb = GL_SRC_ALPHA |
Definition at line 76 of file BlendMode.hpp.
|
static |
destination -= source.
Definition at line 66 of file BlendMode.hpp.