From 6b21438ce81c0f9e05e318469eb74463d9252f97 Mon Sep 17 00:00:00 2001 From: RandomErrorMessage <35673979+RandomErrorMessage@users.noreply.github.com> Date: Sat, 16 May 2020 01:25:14 -0700 Subject: [PATCH] added BLEND_SET --- src/raylib.h | 3 ++- src/rlgl.h | 8 +++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/raylib.h b/src/raylib.h index d75855d09..876ee7dd8 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -806,7 +806,8 @@ typedef enum { typedef enum { BLEND_ALPHA = 0, // Blend textures considering alpha (default) BLEND_ADDITIVE, // Blend textures adding colors - BLEND_MULTIPLIED // Blend textures multiplying colors + BLEND_MULTIPLIED, // Blend textures multiplying colors + BLEND_SET // Blend textures by setting colors } BlendMode; // Gestures type diff --git a/src/rlgl.h b/src/rlgl.h index acf2270d2..4ce34dbda 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -382,7 +382,8 @@ typedef unsigned char byte; typedef enum { BLEND_ALPHA = 0, BLEND_ADDITIVE, - BLEND_MULTIPLIED + BLEND_MULTIPLIED, + BLEND_SET } BlendMode; // Shader location point type @@ -3558,15 +3559,16 @@ void BeginBlendMode(int mode) { static int blendMode = 0; // Track current blending mode - if ((blendMode != mode) && (mode < 3)) + if ((blendMode != mode) && (mode < 4)) { rlglDraw(); switch (mode) { 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_SET: glBlendFunc(GL_ONE, GL_ONE); break; default: break; }