[Bf-committers] Patched FTGL further
Ton Roosendaal
ton at blender.org
Sun Oct 3 12:43:17 CEST 2004
Hi,
I've added 2 more patches in FTGL;
1) Speedup by removing 'opengl push attributes' for each string that
draws
2) Enforcing pixel-aligned glBitMap offset, to prevent drawing errors.
This only works
perfect with the upcoming commit for Blender itself. :)
The diffs you can find below.
Also have included both changed source files completely as .tgz.
Platform managers can recompile ftgl and put it in the CVS lib
directory. I'll do for OSX.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ftgl.tgz
Type: application/x-gzip
Size: 1477 bytes
Desc: not available
Url : http://projects.blender.org/pipermail/bf-committers/attachments/20041003/495ba852/ftgl.bin
-------------- next part --------------
-Ton-
------------------ the diff for FTGL/src/FTGLPixmapFont.cpp
---------------
53,54c53,54
< glPushAttrib( GL_ENABLE_BIT | GL_PIXEL_MODE_BIT |
GL_COLOR_BUFFER_BIT);
< glPushClientAttrib( GL_CLIENT_PIXEL_STORE_BIT);
---
> //glPushAttrib( GL_ENABLE_BIT | GL_PIXEL_MODE_BIT |
GL_COLOR_BUFFER_BIT);
> // glPushClientAttrib( GL_CLIENT_PIXEL_STORE_BIT);
58c58
<
---
>
63,64c63,65
< glPopClientAttrib();
< glPopAttrib();
---
> glDisable(GL_BLEND);
> // glPopClientAttrib();
> // glPopAttrib();
>
>
------------------ the diff for FTGL/src/FTPixmapGlyph.cpp
---------------
33c33,34
< glGetFloatv( GL_CURRENT_COLOR, ftglColour);
---
> // glGetFloatv( GL_CURRENT_COLOR, ftglColour);
> ftglColour[0] = ftglColour[1] = ftglColour[2] =
ftglColour[3] = 1.0;
86c87
<
---
> #include <math.h>
90a92,96
> float dx, dy;
>
> dx= floor( (pen.x + pos.x ) );
> dy= ( (pen.y - pos.y ) );
>
92c98
< glBitmap( 0, 0, 0.0f, 0.0f, pen.x + pos.x, pen.y - pos.y,
(const GLubyte*)0);
---
> glBitmap( 0, 0, 0.0f, 0.0f, dx, dy, (const GLubyte*)0);
99c105
< glBitmap( 0, 0, 0.0f, 0.0f, -pen.x - pos.x, -pen.y + pos.y,
(const GLubyte*)0);
---
> glBitmap( 0, 0, 0.0f, 0.0f, -dx, -dy, (const GLubyte*)0);
>
------------------------------------------------------------------------
--
Ton Roosendaal Blender Foundation ton at blender.org
http://www.blender.org
More information about the Bf-committers
mailing list