diff options
Diffstat (limited to 'source/blender/blenfont')
-rw-r--r-- | source/blender/blenfont/intern/blf.c | 8 | ||||
-rw-r--r-- | source/blender/blenfont/intern/blf_glyph.c | 11 |
2 files changed, 13 insertions, 6 deletions
diff --git a/source/blender/blenfont/intern/blf.c b/source/blender/blenfont/intern/blf.c index ab7c831f95c..d4bd1502417 100644 --- a/source/blender/blenfont/intern/blf.c +++ b/source/blender/blenfont/intern/blf.c @@ -552,10 +552,10 @@ static void blf_draw_gl__start(FontBLF *font) glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - gpuMatrixBegin3D_legacy(); + gpuPushMatrix(); if (font->flags & BLF_MATRIX) - gpuMultMatrix3D((float (*)[4])font->m); + gpuMultMatrix3D(font->m); gpuTranslate3fv(font->pos); @@ -563,7 +563,7 @@ static void blf_draw_gl__start(FontBLF *font) gpuScale3fv(font->aspect); if (font->flags & BLF_ROTATION) /* radians -> degrees */ - gpuRotateAxis(RAD2DEG(font->angle), 'Z'); + gpuRotateAxis(RAD2DEG(font->angle), 'Z'); /* TODO: use gpuRotate2D here? */ #ifndef BLF_STANDALONE VertexFormat *format = immVertexFormat(); @@ -584,7 +584,7 @@ static void blf_draw_gl__start(FontBLF *font) static void blf_draw_gl__end(void) { - gpuMatrixEnd(); + gpuPopMatrix(); #ifndef BLF_STANDALONE immUnbindProgram(); 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); |