aboutsummaryrefslogtreecommitdiff
path: root/src/graphics
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2024-12-27 21:02:43 +0100
committerdec05eba <dec05eba@protonmail.com>2024-12-27 21:02:43 +0100
commit0d5743ae8a077c284c0cad2e3f9dc52c6eed0a40 (patch)
treef0be64f3046b33f1d87648da369b469e8dff1a5b /src/graphics
parent26aa794b4260afcac0d4a9377c0218e474b051df (diff)
Use correct alpha blending for transparent window
Diffstat (limited to 'src/graphics')
-rw-r--r--src/graphics/sprite.c5
-rw-r--r--src/graphics/text.c5
-rw-r--r--src/graphics/vertex.c5
3 files changed, 0 insertions, 15 deletions
diff --git a/src/graphics/sprite.c b/src/graphics/sprite.c
index ce2566e..7ef81af 100644
--- a/src/graphics/sprite.c
+++ b/src/graphics/sprite.c
@@ -1,6 +1,5 @@
#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) {
@@ -69,8 +68,6 @@ 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) {
@@ -97,6 +94,4 @@ 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);
}
diff --git a/src/graphics/text.c b/src/graphics/text.c
index 0280edb..2aa3bb4 100644
--- a/src/graphics/text.c
+++ b/src/graphics/text.c
@@ -1,7 +1,6 @@
#include "../../include/mgl/graphics/text.h"
#include "../../include/mgl/graphics/font.h"
#include "../../include/mgl/system/utf8.h"
-#include "../../include/mgl/window/window.h"
#include "../../include/mgl/mgl.h"
#include <stdio.h>
@@ -248,14 +247,10 @@ void mgl_text_draw(mgl_context *context, mgl_text *text) {
text_draw_userdata.text = text;
text_draw_userdata.context = context;
- mgl_window_set_texture_blend_func(context->current_window);
-
context->gl.glColor4ub(text->color.r, text->color.g, text->color.b, text->color.a);
mgl_texture_use(&text->font->texture);
context->gl.glBegin(GL_QUADS);
mgl_text_for_each_codepoint(text, text_draw_callback, &text_draw_userdata);
context->gl.glEnd();
mgl_texture_use(NULL);
-
- mgl_window_set_render_blend_func(context->current_window);
}
diff --git a/src/graphics/vertex.c b/src/graphics/vertex.c
index 92a6e93..e55c180 100644
--- a/src/graphics/vertex.c
+++ b/src/graphics/vertex.c
@@ -1,14 +1,11 @@
#include "../../include/mgl/graphics/vertex.h"
#include "../../include/mgl/graphics/texture.h"
-#include "../../include/mgl/window/window.h"
#include "../../include/mgl/mgl.h"
void mgl_vertices_draw(mgl_context *context, const mgl_vertex *vertices, size_t vertex_count, mgl_primitive_type primitive_type, mgl_vec2f position) {
if(vertex_count == 0)
return;
- mgl_window_set_texture_blend_func(context->current_window);
-
context->gl.glPushMatrix();
if(!mgl_texture_current_texture()) {
@@ -25,6 +22,4 @@ void mgl_vertices_draw(mgl_context *context, const mgl_vertex *vertices, size_t
context->gl.glDrawArrays(mgl_primitive_type_to_gl_mode(primitive_type), 0, vertex_count);
context->gl.glPopMatrix();
-
- mgl_window_set_render_blend_func(context->current_window);
}