diff options
author | dec05eba <dec05eba@protonmail.com> | 2024-08-02 06:01:36 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2024-08-02 06:01:36 +0200 |
commit | f2da59054cedd1c07779e72537da4d7b14616b48 (patch) | |
tree | b6c8606c1e7494d2fc17439552db30f55b97fd26 /src/graphics/sprite.c | |
parent | 470dac0e891c1ec59dfe52e77861cf068837976d (diff) |
Ensure correct blending function for transparent window
Diffstat (limited to 'src/graphics/sprite.c')
-rw-r--r-- | src/graphics/sprite.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/graphics/sprite.c b/src/graphics/sprite.c index 3110cf9..613ec4c 100644 --- a/src/graphics/sprite.c +++ b/src/graphics/sprite.c @@ -1,5 +1,6 @@ #include "../../include/mgl/graphics/sprite.h" #include "../../include/mgl/graphics/texture.h" +#include "../../include/mgl/window/window.h" #include "../../include/mgl/mgl.h" void mgl_sprite_init(mgl_sprite *self, mgl_texture *texture) { @@ -60,6 +61,8 @@ void mgl_sprite_draw(mgl_context *context, mgl_sprite *sprite) { if(!sprite->texture) return; + mgl_window_set_texture_blend_func(context->current_window); + float texture_right = 1.0f; float texture_bottom = 1.0f; if(sprite->texture->pixel_coordinates) { @@ -86,4 +89,6 @@ void mgl_sprite_draw(mgl_context *context, mgl_sprite *sprite) { context->gl.glEnd(); mgl_texture_use(NULL); context->gl.glLoadIdentity(); /* TODO: Remove, but what about glRotatef above */ + + mgl_window_set_render_blend_func(context->current_window); } |