The way OpenGL Datatypes are used there confuses me a bit. There is for example the unsigned integer "GLuint" and is is used for shader-objects as well as various different buffers-objects. What is this GLuint and what are these datatypes about?
Asked
Active
Viewed 263 times
1
-
4They're all listed [here](https://www.khronos.org/opengl/wiki/OpenGL_Type) with their meaning – Debaug Mar 09 '22 at 12:38
-
2Please refer to a [good tutorial](https://learnopengl.com/). – G.M. Mar 09 '22 at 12:46
-
2GLuint is just an unsigned integer as you write. Nothing more or less. It's used internally as an ID to reference a specific resource. – Ted Klein Bergman Mar 09 '22 at 12:57
1 Answers
0
They are, in general, just aliases for different types. For example GLuint is normally a regular uint. The reason they exist is because the graphics driver expects a specific integer size, e.g. a uint64_t, but data types like int are not necessarily consistent across compilers and architectures.
Thus OpenGL provides it's own type aliases to ensure that handles are always exactly the size it needs to function properly.

Makogan
- 8,208
- 7
- 44
- 112