Hello everybody I'm back again with another task I'm attempting to solve. So I'm at a point in my project where I was working on cleaning up some early code that I was using for testing rendering of maps to the screen and I started to realize that I have several of the sub systems for my game engine using a pointer to a graphics object to send their own drawing commands to the graphics system. I'm looking at this code and I'm wondering if I should let it continue working this way or is their a better way?
My original goal for the game engine and the game as a whole was to have each sub system handle one specific task, Graphics, Input, Audio, etc... with the idea that the main class for the game right now simply being called Game having an object for each sub system and the game class would call each systems update method each frame if needed. The idea being that the Game class would handle calling all drawing commands, it would check for key entry and if so it would update all systems that need to know about it, etc...
The problem I'm running into with this so far is that there are several sub systems that need to draw things to the screen and up until now I haven't figured out what the best way would be for them to pass drawing commands without having a pointer to the graphics system object and just calling drawing commands them selves. So far I have been doing just that passing a pointer around to the systems and letting each system draw but I feel like this may not be the best idea for how to handle this?
I'm wondering what everybody's thoughts are? Am I overthinking this and should just let each system have access to drawing or is there a great way to handle this? I'm not afraid of researching and writing any complex systems if I need to but I am just not sure what the best way to handle this is?
Thanks in advance for any and all advice on this topic.