I’m creating an application in OpenGL in which I’m using glOrtho() with origin in top left corner:
glOrtho(0.0, width, height, 0.0, 0.0, 1.0);
I haven’t found it was wrong until I tried to render outline font, which appeared upside-down. After searching information about it, I came across site on which I read that my origin should start from bottom left corner.
I knew OpenGL is using bottom left corner origin, but I found it easier for me to use top left one. I just had to flip all textures horizontally and everything was ok. But yes, the problem appeared with those outline fonts which are appearing upside-down.
Now to change origin place, I’d have to change a bunch of code so if it’s not necessary, I’d really like to avoid this.
So my question is:
Is my approach with top left origin very wrong? And if not, is there any way to make those outline fonts appear properly?
You are rendering that font somewhere, right? How are you rendering it, and what is stopping you from applying a vertical mirror transform matrix at that time?
I.e. if you are doing this the old-fashioned, obsolete way:
Or if you are using shaders, have your vertex Shader do something like this:
This all being pseudo-code, of course.