Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the advantage of using GLuint instead of unsigned int?

Tags:

c++

opengl

I like to be more standard as possible, so why should I "constrain" my classes defining it's members as OpenGL types when I can use primitive types? Is there any advantage?

like image 515
JSeven Avatar asked Jan 19 '12 20:01

JSeven


1 Answers

The type "unsigned int" has a different size depending on the platform you're building on. I expect this to normally be 32 bits, however it could be 16 or 64 (or something else -- depending on the platform).

Library-specific types are often created to be typedef'd according to platform-specific rules. This allows a generic application to use the right type without having to be aware of the platform it will be built for. Instead, the platform-specific knowledge is constrained to a single common header file.

like image 81
mah Avatar answered Oct 14 '22 12:10

mah