diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2018-04-08 02:14:43 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2018-04-08 02:14:43 +0300 |
commit | 0b5ebb3265b155658d441135e152f32ba11c001d (patch) | |
tree | a518d91a7292b63aa0406577b98afcccdcf12cac /source/blender/blenfont/intern/blf_glyph.c | |
parent | 3725d82cee97b980e514aed1b226deb91aae9fe6 (diff) |
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.
Diffstat (limited to 'source/blender/blenfont/intern/blf_glyph.c')
-rw-r--r-- | source/blender/blenfont/intern/blf_glyph.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/source/blender/blenfont/intern/blf_glyph.c b/source/blender/blenfont/intern/blf_glyph.c index ad7e482f8e0..21c11d96b07 100644 --- a/source/blender/blenfont/intern/blf_glyph.c +++ b/source/blender/blenfont/intern/blf_glyph.c @@ -520,6 +520,8 @@ void blf_glyph_render(FontBLF *font, GlyphBLF *g, float x, float y) glBindTexture(GL_TEXTURE_2D, (font->tex_bind_state = g->tex)); } + g_batch.tex_bind_state = g->tex; + if (font->flags & BLF_SHADOW) { rctf rect_ofs; blf_glyph_calc_rect(&rect_ofs, g, |