PDA

View Full Version : How do I flip upside down fonts in FTGL



mr5zzz
03-01-2014, 06:39 AM
I just use FTGL (http://ftgl.sourceforge.net/) to use it in my app.
I want to use the version FTBufferFont to render font but it renders in the wrong way.
The font(texture?buffer?) is flipped in the wrong axis.

http://i.stack.imgur.com/SS8am.png

I want to use this kind of orthographic settings:



void enable2D(int w, int h)
{
winWidth = w;
winHeight = h;

glViewport(0, 0, w, h);

glMatrixMode(GL_PROJECTION);
glLoadIdentity();
//I don't even want to swap the 3rd and 4th param
//because I like to retain the top-left as the origin
glOrtho(0, w, h, 0, 0, +1);
glMatrixMode(GL_MODELVIEW);
}


I render the font like this:



//No pushing and popping of matrices

//No translation

font.Render("Hello World!", -1, position, spacing, FTGL::RenderMode::RENDER_FRONT);


On the other forums, they said, just scaled the y-axis down to -1, but it wont work in mine. Example:

http://i.stack.imgur.com/fAGg1.png

font is above the screen

I can't see relevant problem like in mine in google so I decide to ask this here again.

How can I invert texture's y-axis without modifying its source code ? (assume its read only)