From 0b5ebb3265b155658d441135e152f32ba11c001d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Foucault?= Date: Sun, 8 Apr 2018 01:14:43 +0200 Subject: BLF: Fix problem with bound texture. Previous code was assuming that the glyph texture would remain bound to GL_TEXTURE0 until the cache would be drawn. This is not always the case, so better save the texture and rebind it before drawing. --- source/blender/blenfont/intern/blf_font.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/blender/blenfont/intern/blf_font.c') diff --git a/source/blender/blenfont/intern/blf_font.c b/source/blender/blenfont/intern/blf_font.c index cc7eb336b21..301f06e22b5 100644 --- a/source/blender/blenfont/intern/blf_font.c +++ b/source/blender/blenfont/intern/blf_font.c @@ -189,9 +189,9 @@ void blf_batch_draw(void) /* We need to flush widget base first to ensure correct ordering. */ UI_widgetbase_draw_cache_flush(); - BLI_assert(g_batch.font->tex_bind_state != 0); /* must still be valid */ + BLI_assert(g_batch.tex_bind_state != 0); /* must still be valid */ glActiveTexture(GL_TEXTURE0); - glBindTexture(GL_TEXTURE_2D, g_batch.font->tex_bind_state); + glBindTexture(GL_TEXTURE_2D, g_batch.tex_bind_state); GWN_vertbuf_vertex_count_set(g_batch.verts, g_batch.glyph_len); GWN_vertbuf_use(g_batch.verts); /* send data */ -- cgit v1.2.3