How do I flip upside down fonts in FTGL

657 Views Asked by At

I just use FTGL 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.

enter image description here

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);
}

And I want the window origin to be top-left

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 it down to -1, but it wont work in mine

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

Update:

How can I flip its axis in a proper way. I can think of like editing the source code and flip the texture coordinates but its not good.

I really need a quick fix..

0

There are 0 best solutions below