Voxel game dev at night, AAA game dev during the day. I will never discuss my day job here, my opinions are my own, etc.
Mastodon: https://mastodon.gamedev.place/@PetorSFZ
Website: skipifzero.com
Vec myVec;
int index = 2;
float v;
memcpy(&v, ((const char*)&myVec) + index * sizeof(float), sizeof(float))
return v;
But like, no on wants to write code like that...
Vec myVec;
int index = 2;
float v;
memcpy(&v, ((const char*)&myVec) + index * sizeof(float), sizeof(float))
return v;
But like, no on wants to write code like that...
Personally, I think it's too dangerous to build C++ with strict aliasing on. Too much code that potentially breaks. The workarounds to make said code defined behavior is usually quite obnoxious.
Personally, I think it's too dangerous to build C++ with strict aliasing on. Too much code that potentially breaks. The workarounds to make said code defined behavior is usually quite obnoxious.
I'm using a custom immediate mode UI lib and gpu library which I have written myself:
github.com/PetorSFZ/sfz...
I'm using a custom immediate mode UI lib and gpu library which I have written myself:
github.com/PetorSFZ/sfz...