diff --git a/graphics/tinygl/api.cpp b/graphics/tinygl/api.cpp index dd42ece6687..c5970ca5c1d 100644 --- a/graphics/tinygl/api.cpp +++ b/graphics/tinygl/api.cpp @@ -165,6 +165,16 @@ void tglColorMask(TGLboolean r, TGLboolean g, TGLboolean b, TGLboolean a) { TinyGL::gl_add_op(p); } +void tglBlendFunc(TGLenum sfactor, TGLenum dfactor) { + TinyGL::GLParam p[3]; + + p[0].op = TinyGL::OP_BlendFunc; + p[1].i = sfactor; + p[2].i = dfactor; + + TinyGL::gl_add_op(p); +} + void tglPolygonMode(int face, int mode) { TinyGL::GLParam p[3]; diff --git a/graphics/tinygl/gl.h b/graphics/tinygl/gl.h index 399abe50bfa..51d39f28136 100644 --- a/graphics/tinygl/gl.h +++ b/graphics/tinygl/gl.h @@ -791,6 +791,7 @@ void tglGetIntegerv(int pname, int *params); void tglGetFloatv(int pname, float *v); void tglFrontFace(int mode); void tglColorMask(TGLboolean r, TGLboolean g, TGLboolean b, TGLboolean a); +void tglBlendFunc(TGLenum sfactor, TGLenum dfactor); void tglSetShadowMaskBuf(unsigned char *buf); void tglSetShadowColor(unsigned char r, unsigned char g, unsigned char b); diff --git a/graphics/tinygl/init.cpp b/graphics/tinygl/init.cpp index 8a3b904ec1c..65c617dffe9 100644 --- a/graphics/tinygl/init.cpp +++ b/graphics/tinygl/init.cpp @@ -125,6 +125,7 @@ void glInit(void *zbuffer1) { c->render_mode = TGL_RENDER; c->select_buffer = NULL; c->name_stack_size = 0; + c->enable_blend = false; // matrix c->matrix_mode = 0; diff --git a/graphics/tinygl/misc.cpp b/graphics/tinygl/misc.cpp index b86b52fcd65..748f65c89b6 100644 --- a/graphics/tinygl/misc.cpp +++ b/graphics/tinygl/misc.cpp @@ -61,6 +61,9 @@ void glopEnableDisable(GLContext *c, GLParam *p) { case TGL_DEPTH_TEST: c->depth_test = v; break; + case TGL_BLEND: + c->enable_blend = v; + break; case TGL_POLYGON_OFFSET_FILL: if (v) c->offset_states |= TGL_OFFSET_FILL; @@ -101,6 +104,9 @@ void glopEnableDisable(GLContext *c, GLParam *p) { } } +void glopBlendFunc(GLContext *c, GLParam *p) { +} + void glopShadeModel(GLContext *c, GLParam *p) { int code = p[1].i; c->current_shade_model = code; diff --git a/graphics/tinygl/opinfo.h b/graphics/tinygl/opinfo.h index ce506088d79..8f9ee99bb9a 100644 --- a/graphics/tinygl/opinfo.h +++ b/graphics/tinygl/opinfo.h @@ -49,6 +49,7 @@ ADD_OP(CullFace, 1, "%C") ADD_OP(FrontFace, 1, "%C") ADD_OP(PolygonMode, 2, "%C %C") ADD_OP(ColorMask, 1, "%08x") +ADD_OP(BlendFunc, 2, "%d %d") ADD_OP(CallList, 1, "%d") ADD_OP(Hint, 2, "%C %C") diff --git a/graphics/tinygl/zgl.h b/graphics/tinygl/zgl.h index b706e955911..afbd2f55a19 100644 --- a/graphics/tinygl/zgl.h +++ b/graphics/tinygl/zgl.h @@ -209,6 +209,7 @@ struct GLContext { gl_draw_triangle_func draw_triangle_front, draw_triangle_back; // selection + bool enable_blend; int render_mode; unsigned int *select_buffer; int select_size;