Hey guys,
I'm trying to develop an engine that supports consoles, as well as all PCs. I also wanted the users in windows, Mac, and Linux to use different graphics libraries. To that end I need to support many different windowing and graphics systems. To deal with that, I simply abstract them using Polymorphism, creating a base class as an interface before I inherit all the actual functions and data in another class. This approach is so far bad for data locality as I have to use pointers to objects and new rather than putting the data directly in arrays. While I'm going to use indirect multi draw and command buffers to alleviate this issue, it's still an issue. And in the case of compiling the libraries statically, I'd have to ship multiple, larger executables.
To reiterate: Is there a way to use dynamic module based Polymorphism without requiring pointers to objects? If not, would the data locality issues be significant enough to warrant just making my libraries static and shipping multiple executables per graphics system (ie: Vulkan, Opengl, and Directx on Windows).
↧