Original Post
I have a few questions regarding engine design.
I''ve got a good grasp on C++, but there are a few things which keep me from programming large projects like a game. I know they are minor, but i really need some input from the professionals out here.
First of all, i whas thinking about using namespaces to seperate the engine from game code. Is this how it''s done in huge projects?
like:
namespace Engine
{
class Window;
class CD3D;
}
namespace Game
{
class Window : public Engine::Window;
}
Secondly, how do you link objects to eachother?
Let''s say I''ve got 3 classes:
- CD3D
- CWindow
- CLog
The window class depends on the log class and the D3D class depends on the Window class, but on the Log class as well. Would i just give the Window class a public instance of the log class, so the D3D class can use that log object? (Doesn''t that undermine OOP rules?) Or is it better to pass a pointer or reference in each constructor?
Thirdly, is it logical to make a generic engine which can be used for multiple genres? Or is it better to make one engine for one game / genre?
Thanks for your input.