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

前端 未结 4 1836
说谎
说谎 2021-01-03 18:15

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 advantag

4条回答
  •  佛祖请我去吃肉
    2021-01-03 18:40

    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.

提交回复
热议问题