A previous question has asked for how to cast between integer types and GLvoid*
in C++11 (based on the tags for that question) but here I'm interested in C++20.
Now that there is std::bit_cast
as an option for doing type conversion, I'm wondering if it would be the "correct" way to use integers with OpenGL functions that for historical reasons take a GLvoid*
to represent a byte offset (e.g. glDrawRangeElements), or whether the methods referenced at the previous question should be used instead.