Q Prefix?

Locked
Silicone_Milk
Posts: 2237
Joined: Sat Mar 12, 2005 10:49 pm

Q Prefix?

Post by Silicone_Milk »

So I was just looking through the Q3 source code and found a file that renamed opengl functions by giving them a q prefix.
Something like this:

#define qglStencilMask glStencilMask

What exactly is the point of such a seemingly significant waste of time/code? (note that there's a whole list of these redefinitions. Even bool is redefined!)

So what's up guys? Is it iD just being quirky? Is it a copyright thing? Or was it for having a semi-uniform naming scheme?

I'm just kinda interested since it looks kinda silly to me.
^misantropia^
Posts: 4022
Joined: Sat Mar 12, 2005 6:24 pm

Post by ^misantropia^ »

It's a simple abstraction layer on top of OpenGL. Comes in handy when you want to write e.g. a software renderer like in Q1 and Q2.
Silicone_Milk
Posts: 2237
Joined: Sat Mar 12, 2005 10:49 pm

Post by Silicone_Milk »

I see.
Kinda ironic that they would do that considering Q3 doesn't have a software renderer :)

Thanks for the reply ^misantropia^
Locked