added BLEND_SET (#1251)
* added BLEND_SET * renamed BLEND_SET to BLEND_ADD_COLORS
This commit is contained in:
parent
abb94bd2ff
commit
d9a96c4ca0
2 changed files with 7 additions and 4 deletions
|
@ -806,7 +806,8 @@ typedef enum {
|
||||||
typedef enum {
|
typedef enum {
|
||||||
BLEND_ALPHA = 0, // Blend textures considering alpha (default)
|
BLEND_ALPHA = 0, // Blend textures considering alpha (default)
|
||||||
BLEND_ADDITIVE, // Blend textures adding colors
|
BLEND_ADDITIVE, // Blend textures adding colors
|
||||||
BLEND_MULTIPLIED // Blend textures multiplying colors
|
BLEND_MULTIPLIED, // Blend textures multiplying colors
|
||||||
|
BLEND_ADD_COLORS // Blend textures adding colors (alternative)
|
||||||
} BlendMode;
|
} BlendMode;
|
||||||
|
|
||||||
// Gestures type
|
// Gestures type
|
||||||
|
|
|
@ -382,7 +382,8 @@ typedef unsigned char byte;
|
||||||
typedef enum {
|
typedef enum {
|
||||||
BLEND_ALPHA = 0,
|
BLEND_ALPHA = 0,
|
||||||
BLEND_ADDITIVE,
|
BLEND_ADDITIVE,
|
||||||
BLEND_MULTIPLIED
|
BLEND_MULTIPLIED,
|
||||||
|
BLEND_ADD_COLORS
|
||||||
} BlendMode;
|
} BlendMode;
|
||||||
|
|
||||||
// Shader location point type
|
// Shader location point type
|
||||||
|
@ -3558,15 +3559,16 @@ void BeginBlendMode(int mode)
|
||||||
{
|
{
|
||||||
static int blendMode = 0; // Track current blending mode
|
static int blendMode = 0; // Track current blending mode
|
||||||
|
|
||||||
if ((blendMode != mode) && (mode < 3))
|
if ((blendMode != mode) && (mode < 4))
|
||||||
{
|
{
|
||||||
rlglDraw();
|
rlglDraw();
|
||||||
|
|
||||||
switch (mode)
|
switch (mode)
|
||||||
{
|
{
|
||||||
case BLEND_ALPHA: glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); break;
|
case BLEND_ALPHA: glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); break;
|
||||||
case BLEND_ADDITIVE: glBlendFunc(GL_SRC_ALPHA, GL_ONE); break; // Alternative: glBlendFunc(GL_ONE, GL_ONE);
|
case BLEND_ADDITIVE: glBlendFunc(GL_SRC_ALPHA, GL_ONE); break;
|
||||||
case BLEND_MULTIPLIED: glBlendFunc(GL_DST_COLOR, GL_ONE_MINUS_SRC_ALPHA); break;
|
case BLEND_MULTIPLIED: glBlendFunc(GL_DST_COLOR, GL_ONE_MINUS_SRC_ALPHA); break;
|
||||||
|
case BLEND_ADD_COLORS: glBlendFunc(GL_ONE, GL_ONE); break;
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue