>>109507844
Pretty sure there already exists function to get string out of opengl error number.
Anyways for other such cases, this is what you do.
enum muh_error {
MUH_ERROR_0,
MUH_ERROR_1,
MUH_ERROR_END
};
static const char *muh_error_str[] = {
[MUH_ERROR_0] = "some gay error message",
};
static const char *get_much_error_str(enum muh_error err) {
if(err >= MUH_ERROR_END) {
return NULL;
}
return muh_error_str[err];
}
If you don't want to return NULL you can replace that with "N/A" string.
If you try to compile that with c++ compiler, well you are a mighty faggot.