I have to use a macro multiple times inside a function and the macro that needs to be used depends on a number I pass into the function.
e.g.
function(int number) {
switch(number) {
case 0: doStuff(MACRO0); break;
case 1: doStuff(MACRO1); break;
}
}
The problem is: I have a lot stuff to do per switch statement with the same macro. Is there are more elegant solution then having all that stuff in the switch statement? Like passing the macro itself to the function? I have read about eval() like methods in C++ but they just don't feel right to me. Another way could be do determine into what the macro expands but I haven't found any info on this.
Oh, it's openGL actually.