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:
authorDiego Borghetti <bdiego@gmail.com>2010-12-09 07:36:58 +0300
committerDiego Borghetti <bdiego@gmail.com>2010-12-09 07:36:58 +0300
commitb25c32393d42c314c073ef2244cde1fabb7b64af (patch)
treea295abf9b556d1fdc8ed2d8d555f602bc1f874ce /source/blender/blenfont/intern/blf_font.c
parent36175f37c9d3ea128cfdcebd1c1b438494b34433 (diff)
Add the possibility to set a 4x4 matrix to be used on blf.
This option allow the user to set a 4x4 matrix to be multiplied before draw the text, for example: double *m; /* Get the matrix or build it! */ BLF_matrix(m); BLF_enable(BLF_MATRIX); /* set color, size, etc and draw! */ BLF_disable(BLF_MATRIX); You don't need the last line (disable), but remember that if you use the font to draw in any other place, the matrix will be used!. The GL code is: glPushMatrix(); glMultMatrixd(m); glTranslatef(); glScalef(); glRotatef(); glPopMatrix(); Let's Dalai test this!!! :D
Diffstat (limited to 'source/blender/blenfont/intern/blf_font.c')
-rw-r--r--source/blender/blenfont/intern/blf_font.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/source/blender/blenfont/intern/blf_font.c b/source/blender/blenfont/intern/blf_font.c
index 1ae654cc5bc..3adda7bb6f1 100644
--- a/source/blender/blenfont/intern/blf_font.c
+++ b/source/blender/blenfont/intern/blf_font.c
@@ -493,11 +493,16 @@ void blf_font_free(FontBLF *font)
static void blf_font_fill(FontBLF *font)
{
+ int i;
+
font->aspect= 1.0f;
font->pos[0]= 0.0f;
font->pos[1]= 0.0f;
font->angle= 0.0f;
- unit_m4(font->mat);
+
+ for (i= 0; i < 16; i++)
+ font->m[i]= 0;
+
font->clip_rec.xmin= 0.0f;
font->clip_rec.xmax= 0.0f;
font->clip_rec.ymin= 0.0f;