Shorten ogl_set_blending

This commit is contained in:
Kp 2016-02-12 04:02:28 +00:00
parent 230f2dbb19
commit 4aea3b8fdc

View file

@ -1189,19 +1189,24 @@ void ogl_toggle_depth_test(int enable)
*/
void ogl_set_blending(uint8_t cv_blend_func)
{
GLenum s, d;
switch (cv_blend_func)
{
case GR_BLEND_ADDITIVE_A:
glBlendFunc( GL_SRC_ALPHA, GL_ONE );
s = GL_SRC_ALPHA;
d = GL_ONE;
break;
case GR_BLEND_ADDITIVE_C:
glBlendFunc( GL_ONE, GL_ONE );
s = GL_ONE;
d = GL_ONE;
break;
case GR_BLEND_NORMAL:
default:
glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
s = GL_SRC_ALPHA;
d = GL_ONE_MINUS_SRC_ALPHA;
break;
}
glBlendFunc(s, d);
}
void ogl_start_frame(void){