How do I flip upside down fonts in FTGL

微笑、不失礼 提交于 2019-12-13 07:38:14

问题


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.

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..

来源:https://stackoverflow.com/questions/22111457/how-do-i-flip-upside-down-fonts-in-ftgl

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!