Allow outside access of systems in SystemManager
So the topic of this issue is really more of just a potential solution to the problem I'm having. Basically, my systems have both a render method and an update method. This render method in each system needs to have access to Kha's graphics API. Obviously, baking this into a generic library like eskimo would be a bad idea.
SystemManager.update is not a complex function, and a rendering equivalent could be just as light. However, it of course needs to loop through the systems variable, which is private.
A simple solution might be just overriding SystemManager. This brings me to my second point, that the System class of course doesn't have a render method. How would you go about this?
From a philosophical stand-point, I give my RenderSystem a render function, and call it manually in the main Kha render function, in a sense it makes it explicit that only that system will be rendering things / I like to have more explicit control of render order, almost like a system on its own.
But I think the SystemManager could be made generic, and you could define your own base class, with a constraint on implementing at least an IUpdate interface or something. Not sure if that would be getting a bit over-architectured, but I think with good defaults it would be the same thing as currently, but with more customizable options. (This change would lead to both SystemManager and System becoming generic, both having the base System class as the generic parameter)
Becomes less verbose by using typedefs I guess...
I'll add this to my list of things to quickly add before pushing eskimo/next to master. I think it would be great to have this, and is relatively low overhead.
(Is it a hassle to manage your own list of systems that should render? You could use the SystemManager for normal updates, and maintain your own list of systems that implement IRender or something to control rendering, which is more application specific.)
Yep, all good. Awesome, thanks.