OpenGL define its own datatype. Such as GLint
or GLsizei
. And they are different across platforms. Where can I find limits for the types?
Added language tag to clarify domain. And I know that GL* types will be resolved into basic C types, but it can be different by platform. (actually that's why they are defined.) And even basic C types are not guaranteed to be fixed size on any platform. That's why the limit.h
is exist, and I expect there's also similar thing in GL itself for GL* types because they're semantically different with C types, and it means they need their own limit definitions.
Assuming you are using C++ you can use std::numeric_limits<GLint>::max()
to get the correct maximum value for a type or any other property of the type.
The spec doesn't guarantee that GLint
is actually an int
on any platform but only that it is an at least 32bit wide signed integral type, so MAX_INT is the lower size bound on a platform where int
is actually 32 bits wide (e.g. x86_64
).
EDIT: Note that as pmr points out from the OpenGL spec, it is not guaranteed that GLint
or GLsizei
will always be defined as int
. GLint
and GLsizei
are only guaranteed to be at least 32 bits.
from GL/gl.h
typedef int GLint;
typedef int GLsizei;
Those type are int's and sized according to the platform. To get the min and max values you can use INT_MIN and INT_MAX which should be found in limits.h ( assuming C ).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With