diff options
Diffstat (limited to 'source/blender/blenfont/intern/blf_font.c')
-rw-r--r-- | source/blender/blenfont/intern/blf_font.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/source/blender/blenfont/intern/blf_font.c b/source/blender/blenfont/intern/blf_font.c index 1289dc6c5a6..13c857b0d4b 100644 --- a/source/blender/blenfont/intern/blf_font.c +++ b/source/blender/blenfont/intern/blf_font.c @@ -183,16 +183,13 @@ void blf_batch_draw(void) if (g_batch.glyph_len == 0) return; - glEnable(GL_BLEND); - glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA); + GPU_blend(true); + GPU_blend_set_func_separate(GPU_SRC_ALPHA, GPU_ONE_MINUS_SRC_ALPHA, GPU_ONE, GPU_ONE_MINUS_SRC_ALPHA); /* We need to flush widget base first to ensure correct ordering. */ UI_widgetbase_draw_cache_flush(); - BLI_assert(g_batch.tex_bind_state != 0); /* must still be valid */ - glActiveTexture(GL_TEXTURE0); - glBindTexture(GL_TEXTURE_2D, g_batch.tex_bind_state); - + GPU_texture_bind(g_batch.tex_bind_state, 0); GWN_vertbuf_vertex_count_set(g_batch.verts, g_batch.glyph_len); GWN_vertbuf_use(g_batch.verts); /* send data */ @@ -201,7 +198,7 @@ void blf_batch_draw(void) GWN_batch_uniform_1i(g_batch.batch, "glyph", 0); GWN_batch_draw(g_batch.batch); - glDisable(GL_BLEND); + GPU_blend(false); /* restart to 1st vertex data pointers */ GWN_vertbuf_attr_get_raw_data(g_batch.verts, g_batch.pos_loc, &g_batch.pos_step); |