TheLionKing
09-17-2003, 12:08 PM
Hi,
I am creating a game in DirectX. I have tried to implement everything through classes. Here is how it goes:
class cApplication
{
...
...
...
private:
* * cDirectX DirectX;
* * cGame * *Game;
};
class cDirectX
{
...
...
...
private:
* * cDirect3D Direct3D;
};
class cDirect3D
{
...
...
...
private:
* * IDirect3DDevice9 *Device;
};
The problem is ... I want to use Device in cGame class. Device is setup in cDirect3D class.
An easy way is to create an external variable ... but that is not a classes approach :unsure: .
Is there anyway to access Device through cGame. I think its by pointers ... but how :confused: ... any guidelines :blush: ?
I am creating a game in DirectX. I have tried to implement everything through classes. Here is how it goes:
class cApplication
{
...
...
...
private:
* * cDirectX DirectX;
* * cGame * *Game;
};
class cDirectX
{
...
...
...
private:
* * cDirect3D Direct3D;
};
class cDirect3D
{
...
...
...
private:
* * IDirect3DDevice9 *Device;
};
The problem is ... I want to use Device in cGame class. Device is setup in cDirect3D class.
An easy way is to create an external variable ... but that is not a classes approach :unsure: .
Is there anyway to access Device through cGame. I think its by pointers ... but how :confused: ... any guidelines :blush: ?