engine design

Started by
12 comments, last by AcePilot 17 years, 11 months ago
I don't know if you've already seen it or not, but Superpig's Enginuity article series has some good tips. Might be worth your time to read through them:

Part I
Part II
Part III
Part IV
Part V
Advertisement
Personally, in my solution file, I have 3 projects: my engine code, my engine unit tests, and the actual game code. The unit tests and game just compile normally; however, the engine itself is set to compile to a static library and the other projects are supposed to link against it's object files, rather than the actual library. I also make the solutions directory a part of my include path so I can do things like #include <Engine/File.h>.
Quote:Original post by AcePilot
Instead, you should have functions that operate on the device, so the client program does not know or have access to the underlying device.


What do you mean functions that operate on the device? If I call a function that requires the device to execute, how should it get access to the device? Thanks...
I'm assuming that all your graphics functions are going to be inside the CGfxObj class. That way, they already have access to the private d3ddev, so they dont need a getter function. If you have a sprite class, then that sprite class probably needs direct access to the device. In that case, put something like
friend class Sprite;
in your CGfxObj so the device is availible to the Sprite class.

This topic is closed to new replies.

Advertisement