Revision: 48496
          
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=48496
Author:   alexk
Date:     2012-07-02 15:38:27 +0000 (Mon, 02 Jul 2012)
Log Message:
-----------
Convert Fonts to software matrix stack.

Modified Paths:
--------------
    branches/soc-2012-swiss_cheese/source/blender/blenfont/intern/blf.c

Modified: branches/soc-2012-swiss_cheese/source/blender/blenfont/intern/blf.c
===================================================================
--- branches/soc-2012-swiss_cheese/source/blender/blenfont/intern/blf.c 
2012-07-02 15:26:47 UTC (rev 48495)
+++ branches/soc-2012-swiss_cheese/source/blender/blenfont/intern/blf.c 
2012-07-02 15:38:27 UTC (rev 48496)
@@ -51,6 +51,7 @@
 #include "blf_internal.h"
 
 #include "GPU_compatibility.h"
+#include "GPU_matrix.h"
 
 
 /* Max number of font in memory.
@@ -558,24 +559,27 @@
        }
 #endif
 
-       glMatrixMode(GL_TEXTURE);
-       glPushMatrix();
-       glLoadIdentity();
+       gpuMatrixLock();
 
-       glMatrixMode(GL_MODELVIEW);
-       glPushMatrix();
+       gpuMatrixMode(GPU_TEXTURE);
+       gpuPushMatrix();
+       gpuLoadIdentity();
 
+       gpuMatrixMode(GPU_MODELVIEW);
+       gpuPushMatrix();
+
+
        if (font->flags & BLF_MATRIX) {
-               glMultMatrixd((GLdouble *)&font->m);
+               gpuMultMatrixd((GLdouble *)&font->m);
        }
 
-       glTranslatef(font->pos[0], font->pos[1], font->pos[2]);
+       gpuTranslate(font->pos[0], font->pos[1], font->pos[2]);
 
        if (font->flags & BLF_ASPECT)
-               glScalef(font->aspect[0], font->aspect[1], font->aspect[2]);
+               gpuScale(font->aspect[0], font->aspect[1], font->aspect[2]);
 
        if (font->flags & BLF_ROTATION)
-               glRotatef(font->angle, 0.0f, 0.0f, 1.0f);
+               gpuRotateAxis(font->angle, 'Z');
 
        if (font->shadow || font->blur) 
                gpuGetCurrentColor4fv(font->orig_col);
@@ -583,6 +587,8 @@
        /* always bind the texture for the first glyph */
        font->tex_bind_state = -1;
 
+       gpuMatrixCommit();
+
        draw_lock(font);
 }
 
@@ -590,12 +596,14 @@
 {
        draw_unlock(font);
 
-       glMatrixMode(GL_TEXTURE);
-       glPopMatrix();
+       gpuMatrixMode(GPU_TEXTURE);
+       gpuPopMatrix();
 
-       glMatrixMode(GL_MODELVIEW);
-       glPopMatrix();
+       gpuMatrixMode(GPU_MODELVIEW);
+       gpuPopMatrix();
 
+       gpuMatrixUnlock();
+
        /* XXX: current color becomes undefined due to use of vertex arrays,
                but a lot of code relies on it remaining the same */
        if (font->shadow || font->blur) 

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to