[Bf-blender-cvs] [5eac4e3057a] blender2.8: Immediate Mode: glPop/glPushClientAttrib
Dalai Felinto
noreply at git.blender.org
Tue Apr 4 14:31:09 CEST 2017
Commit: 5eac4e3057aff7e58f46285d90e0c8b15e1c8fff
Author: Dalai Felinto
Date: Tue Apr 4 10:45:03 2017 +0200
Branches: blender2.8
https://developer.blender.org/rB5eac4e3057aff7e58f46285d90e0c8b15e1c8fff
Immediate Mode: glPop/glPushClientAttrib
===================================================================
M source/blender/blenfont/intern/blf_glyph.c
===================================================================
diff --git a/source/blender/blenfont/intern/blf_glyph.c b/source/blender/blenfont/intern/blf_glyph.c
index b1bab13f3ae..fa37f88d91f 100644
--- a/source/blender/blenfont/intern/blf_glyph.c
+++ b/source/blender/blenfont/intern/blf_glyph.c
@@ -438,14 +438,21 @@ void blf_glyph_render(FontBLF *font, GlyphBLF *g, float x, float y)
}
- glPushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT);
+ GLint lsb_first, row_length, alignment;
+ glGetIntegerv(GL_UNPACK_LSB_FIRST, &lsb_first);
+ glGetIntegerv(GL_UNPACK_ROW_LENGTH, &row_length);
+ glGetIntegerv(GL_UNPACK_ALIGNMENT, &alignment);
+
glPixelStorei(GL_UNPACK_LSB_FIRST, GL_FALSE);
glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
glBindTexture(GL_TEXTURE_2D, g->tex);
glTexSubImage2D(GL_TEXTURE_2D, 0, g->xoff, g->yoff, g->width, g->height, GL_ALPHA, GL_UNSIGNED_BYTE, g->bitmap);
- glPopClientAttrib();
+
+ glPixelStorei(GL_UNPACK_LSB_FIRST, lsb_first);
+ glPixelStorei(GL_UNPACK_ROW_LENGTH, row_length);
+ glPixelStorei(GL_UNPACK_ALIGNMENT, alignment);
g->uv[0][0] = ((float)g->xoff) / ((float)gc->p2_width);
g->uv[0][1] = ((float)g->yoff) / ((float)gc->p2_height);
More information about the Bf-blender-cvs
mailing list