Ok I've got a huge class hierarchy here and I'm getting myself confused over what's going on.
Here is the structure.
All constructors contain no code -> just default constructors.Code:class D3D {}; class DirectDraw {}; class DXGraphics:public D3D, public DirectDraw {}; class DXInput {}; class DXMouse:public DXInput {}; class DXEngine:public DXGraphics,public DXInput {}; class TileEngine:public DXEngine {};
The Init() function of each class actually inits the class -> left out for clarity's sake.
Here is my problem. Let's say I wanted to use the mouse. The mouse requires the DirectInput object to be created first. Then you use that object to then create the Mouse object. The Mouse object requires you to pass the HINSTANCE of the application so that it can set the priority level for this instance.
Problem with this setup is that I cannot create a mouse at all. What is happening when I instantiate TileEngine? Does it not instantiate DXMouse? Since I know it does, how then do I actually create the Mouse object. Every time I try to place a pointer to the mouse object inside of TileEngine and instantiate it, I get an illegal operation message box - or the code simply exits with no error. Since DXMouse is actually a part of TileEngine, why should I even include a class pointer to DXMouse? How do I actually create the DXMouse object?
Here is what happens when I instantiate TileEngine.
D3D is instantiated.
DirectDraw is instantiated.
DXGraphics is instantiated.
DXInput is instantiated.
DXMouse is instantiated.
DXEngine is instantiated.
It's easy to use DirectDraw and D3D because these are mere function calls. Hmm. Maybe I just answered my own question. Since I can directly use DirectX and D3D from TileEngine could I also not just directly use the mouse with no pointer? In other words simply call its functions to use it?
All this inheritance crapola is for the birds. Perhaps I will use pointers to these objects instead of deriving from everything and using multiple base classes.