Type aliases

I had some code that used sizeof(GL_UNSIGNED_INT). But then I changed it to sizeof(GL_UNSIGNED_SHORT), but I couldn’t get it to work. It took me a couple of hours to identify the reason.

I am not asking for help, just writing to get rid of my frustration. Hopefully someone will enjoy it.

Are you sure this was the only reason?

GL_UNSIGNED_INT is defined as 0x1405 and GL_UNSIGNED_SHORT as 0x1403, both are integers, so sizeof will return 4 for both cases.

McLeary is right.

You are looking for sizeof(GLuint) and sizeof(GLushort).

Just read through GL/gl.h. It’s that simple.