What is this data type?
intptr
It’s on the new extension ext_bindable_uniform and I can’t find what GL data type this is supposed to be. Thanks
What is this data type?
intptr
It’s on the new extension ext_bindable_uniform and I can’t find what GL data type this is supposed to be. Thanks
naively, I would guess :
typedef *int GLintptr;
I would to ZbuffeR but MSVC shows typedef ptrdiff_t
I have never seen that before…
Well here is the lowd down.
C and C++ define a special type for pointer arithmetic, namely ptrdiff_t, which is a typedef of a platform-specific signed integral type. You can use a variable of type ptrdiff_t to store the result of subtracting and adding pointers. For example:
#include <stdlib.h>
int main()
{
int buff[4];
ptrdiff_t diff = (&buff[3]) - buff; // diff = 3
diff = buff -(&buff[3]); // -3
}
What are the advantages of using ptrdiff_t? First, the name ptrdiff_t is self-documenting and helps the reader understand that the variable is used in pointer arithmetic exclusively. Secondly, ptrdiff_t is portable: its underlying type may vary across platforms, but you don’t need to make changes in the code when porting it.
Thanks for the clarifications.