specifying an object type at runtime
- by lapin
I've written a Vbo template class to work with opengl.
I'd like to set the type from a config file at runtime.
e.g.
<vbo type="bump_vt" ... />
Vbo* pVbo = new Vbo(bump_vt, ...);
Is there some way I can do this without a large if else block e.g.
if( sType.compareTo("bump_vt") == 0 )
Vbo* pVbo = new Vbo(bump_vt, ...);
else if
...
I'm writing for multiple platforms in c++.
thanks