I am rendering text using the FreeType library allong with OpenGL, but say I want to render a long line of text, as seen in the following image:
The text continues on the same line until it goes off screen. In the above image, you can see that the window can fit the word "Test" 11 times, but the 12th goes of screen, so in a perfect world I would just be able to put \n (new line command in most systems) after the 11th word and the 12th would be rendered on a new line under the original. However, the command \n does not work the same in FreeType as it does for std::cout and printf.
Therefore my question is this - How could I render the text of one TextRenderer object on multiple lines, the same way the \n command works for single std::cout and printf calls? (I don't want to create a new object for each line of text, I can already do it this way but it seems wasteful) Maybe there is a way for FreeType to know it is at the edge of a window and if so render the next characters appropriately?
