Tuesday, 6 May 2014

A note on docs

If you are reasonably diligent in commenting your code using the doxygen markup convention, it can spit out some pretty meaningful and helpful documentation for you.

Here's an example of some documentation for the camera class. Everything is automatically generated, even the diagrams.

This gives you a good overview of the capabilities of the camera, and an indication of where you might want to go to make changes.

The diagram shows that the camera can follow a physical object (like a ball or a player). A physical object has the atrributes acceleration, position and velocity. The camera is itself a physical object!

It has rectangles to represent its viewport (visible area) and bounds (total world space).

The diagram also (correctly) indicates that the camera is a singleton class with an instance pointer to itself. I don't really like singletons so we'll be changing that. Besides, in this case a singleton isn't a good solution, since it's entirely logical to have more than one camera.

Pretty reasonable and informative!

No comments:

Post a Comment