trying to avoid using if statements - is this good idea ?
You are doing the (mostly) correct thing for the wrong reason.
#1: Multiple tested and failed if’s, paired with no fewer than 1 jump, will virtually never be faster than most table look-ups. Then again, there is the time it takes to check if the table has been made and to make it if not (not applicable to all platforms, including Windows®).
#2: Tables are easier to read and manage than multiple if’s. Tables are mainly useful because they offer a convenient way to convert any 0-based number into another number, and they are particularly easy to maintain. It is much easier to add to tables etc. and to update the conversion routine accordingly.
#1, however, is virtually a moot point, as any difference between them will be negligible. That isn’t why you use tables. #2 is why you use tables.
But your implementation leaves 2 main things to be desired.
#1: vertexToDrawModes should be static const, not just const. Your code will likely be much slower since it has to build the table every time the method/function is called.
#2: Never hard-code numbers. “3-1” should be some kind of named enumerated value.
L. Spiro