Is there some way to send a struct like:
struct COLOR {
float r, g, b, a;
};
directly into glColor*() function as one parameter? Would make the code nicer.
I could make own function and send separetely each R,G,B,A values onto glColor4f() but that wouldnt be that nice. So im looking a way to send it the most optimal way as possible.
Update:
I wouldn’t recommend creating an inline function, however, you could use GLfloat in your struct to get the expression clearer. Use &color.r to avoid a compiler warning.