Rendering text, not that simple at all. (part 1)

It was a kind of surprise to discover that there’s no straightforward way to render text using OpenGL, for people new to graphics programming like me drawing a text looks like a very primitive functionality which I expect to be available by default as functions like glDrawText(some context,const char*). But that’s not the case, and rendering text […]

Unexpected stuff!

Let’s have a look at this code:

And let’s compile it with g++ using the flag -O3, what’s going to happen? Before answering, let’s have a look at the assembly, shall we?

This is actually only a portion of the whole assembly, what I care to show you is the main loop and what’s […]