[AD] blender operations SRC and DST |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
- To: Coordination of admins/developers of the game programming library Allegro <alleg-developers@xxxxxxxxxx>
- Subject: [AD] blender operations SRC and DST
- From: Jon Rafkind <workmin@xxxxxxxxxx>
- Date: Mon, 06 Jun 2011 17:39:10 -0600
This patch adds source and destination color as factors for opengl/d3d
blending. I haven't tested the d3d code because I don't have a windows
environment set up. Also the documents aren't updated in this patch but
I can do so after the patch is applied.
Index: include/allegro5/bitmap.h
===================================================================
--- include/allegro5/bitmap.h (revision 14764)
+++ include/allegro5/bitmap.h (working copy)
@@ -91,7 +91,9 @@
ALLEGRO_ZERO = 0,
ALLEGRO_ONE = 1,
ALLEGRO_ALPHA = 2,
- ALLEGRO_INVERSE_ALPHA = 3
+ ALLEGRO_INVERSE_ALPHA = 3,
+ ALLEGRO_SRC_COLOR = 4,
+ ALLEGRO_DST_COLOR = 5,
};
enum ALLEGRO_BLEND_OPERATIONS {
Index: src/opengl/ogl_bitmap.c
===================================================================
--- src/opengl/ogl_bitmap.c (revision 14764)
+++ src/opengl/ogl_bitmap.c (working copy)
@@ -173,8 +173,9 @@
static INLINE bool setup_blending(ALLEGRO_DISPLAY *ogl_disp)
{
int op, src_color, dst_color, op_alpha, src_alpha, dst_alpha;
- const int blend_modes[4] = {
- GL_ZERO, GL_ONE, GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA
+ const int blend_modes[6] = {
+ GL_ZERO, GL_ONE, GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA,
+ GL_SRC_COLOR, GL_DST_COLOR
};
const int blend_equations[3] = {
GL_FUNC_ADD, GL_FUNC_SUBTRACT, GL_FUNC_REVERSE_SUBTRACT
Index: src/win/d3d_disp.cpp
===================================================================
--- src/win/d3d_disp.cpp (revision 14764)
+++ src/win/d3d_disp.cpp (working copy)
@@ -2049,20 +2049,24 @@
static int d3d_al_blender_to_d3d(int al_mode)
{
- int num_modes = 4;
+ int num_modes = 6;
int allegro_modes[] = {
ALLEGRO_ZERO,
ALLEGRO_ONE,
ALLEGRO_ALPHA,
- ALLEGRO_INVERSE_ALPHA
+ ALLEGRO_INVERSE_ALPHA,
+ ALLEGRO_SRC_COLOR,
+ ALLEGRO_DST_COLOR
};
int d3d_modes[] = {
D3DBLEND_ZERO,
D3DBLEND_ONE,
D3DBLEND_SRCALPHA,
- D3DBLEND_INVSRCALPHA
+ D3DBLEND_INVSRCALPHA,
+ D3DBLEND_SRCCOLOR,
+ D3DBLEND_DESTCCOLOR
};
int i;