如何在FTGL中翻转字体

时间:2014-03-01 07:23:37

标签: c++ opengl coordinates ftgl

我只是使用FTGL在我的应用中使用它。我想使用版本FTBufferFont来渲染字体,但它以错误的方式呈现。字体(纹理?缓冲区?)在错误的轴上翻转。

enter image description here

我想使用这种拼写设置:

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

我希望窗口原点为top-left

我渲染这样的字体:

//No pushing and popping of matrices
//No translation

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

在其他论坛上,他们说,只是把它缩小到-1,但它不会在我的工作

我无法在google中看到像我这样的相关问题所以我决定再次在这里问这个问题。

更新

如何以适当的方式翻转轴。我可以想到编辑源代码并翻转纹理坐标,但不是很好。

我真的需要一个快速修复 ..

0 个答案:

没有答案
相关问题