Reputation: 368
The target is to make a rendering engine, how could one manage to have both OpenGL and Direct3D and be able to switch from one renderer to the other. This is mostly a design problem. My best guess is some kind of polymorphic behavior.
Upvotes: 2
Views: 455
Reputation: 162164
how could one manage to have both OpenGL and Direct3D
Put each renderer into a dynamic library and have them export a common set of functions.
and be able to switch from one renderer to the other.
By loading the right library file. Prepare for major PITA if trying to do this at arbitrary times. It's easiest done at program startup.
Upvotes: 3