In my game engine that I'm writing I have a Engine class that connects to Allegro library and handles intermediary things like game loop, update, render and events. Specifically to handle input and it's events (from Engine class) I created Input class. This class is instantiated using a global pointer (which I know is... bad) which is passed to Engine class, so that engine could connect it with Allegro.
I wanted to create Input class to be as much independent and modular so I inherited it from IInput interface. Engine class knows only about this IInput so that in future I could switch Input class with some other class from IInput.
My question is how I could remove this global pointer of Input class? I thought of converting Input to an static class, but than I can't get a pointer to it which I need as a param to Engine class (through IInput). I also thought of making Input a singleton but I'd rather not do that.
The final goal I had in mind is to have multiple classes that are completely independent of each other and inherited of various interfaces, like IInput, IAi and ISomethingElse, so that in future I can replace Input, AI with some other implementations of same interface.