jtsiomb / libdrawtext

Simple library for fast anti-aliased text rendering in OpenGL
GNU Lesser General Public License v3.0
86 stars 13 forks source link

Rotating the text? #8

Closed ReallyComeOn closed 6 years ago

ReallyComeOn commented 6 years ago

Okay so, in my project I changed the glOrtho like so (it's a must):

   glOrtho(-x/2, x/2, -y/2, y/2, -1, 1); // from
   glOrtho(0, x, y, 0, 0, 1); // to

And as expected, the text is now flipped and upside down. No matter what I do; I can't seem to get the text to flip/rotate. I have rotated textures in the past with OpenGL, but for some reason my methods will not work with dtx_string.

jtsiomb commented 6 years ago

This is not an issue with libdrawtext. Libdrawtext simply renders textured quads. You can use the OpenGL matrix stack to transform them in any way you like. See the the "simple" example which draws arbitrarilly transformed text, if you are uncertain about how to do it.