Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/blenfont/intern/blf_glyph.c')
-rw-r--r--source/blender/blenfont/intern/blf_glyph.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/blenfont/intern/blf_glyph.c b/source/blender/blenfont/intern/blf_glyph.c
index f0cfcdc97b9..f8c589a7051 100644
--- a/source/blender/blenfont/intern/blf_glyph.c
+++ b/source/blender/blenfont/intern/blf_glyph.c
@@ -368,6 +368,7 @@ int blf_glyph_render(FontBLF *font, GlyphBLF *g, float x, float y)
float dx, dx1;
float y1, y2;
float xo, yo;
+ GLint param;
if ((!g->width) || (!g->height))
return 1;
@@ -449,6 +450,11 @@ int blf_glyph_render(FontBLF *font, GlyphBLF *g, float x, float y)
glBindTexture(GL_TEXTURE_2D, (font->tex_bind_state= g->tex));
}
+ /* Save the current parameter to restore it later. */
+ glGetTexEnviv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, &param);
+ if (param != GL_MODULATE)
+ glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
+
if (font->flags & BLF_SHADOW) {
switch(font->shadow) {
@@ -487,5 +493,9 @@ int blf_glyph_render(FontBLF *font, GlyphBLF *g, float x, float y)
break;
}
+ /* and restore the original value. */
+ if (param != GL_MODULATE)
+ glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, param);
+
return 1;
}