Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 1 of 1

Thread: How do I flip upside down fonts in FTGL

  1. #1
    Junior Member Newbie
    Join Date
    Jul 2013
    Posts
    7

    How do I flip upside down fonts in FTGL

    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:

    Code :
        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:

    Code :
        //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:



    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)
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	fAGg1.jpg 
Views:	76 
Size:	6.2 KB 
ID:	1237  

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •