29.9. Serializing the view and version

A difficulty in properly serializing a Pop Framework game is that we want to serialize the view information as well as the game information. If you’ve set your viewpoint to a certain location, direction, and zoom, you’d prefer to have it restored when you reload a saved game.

Since a document can have more than one view open, the default behavior for an MFC CDocument class is to not save any of the view information. The Pop Framework changes this by having a CPopDoc save the view information of the active view and, when loading, signal the active view to load its parameters from the archive being loaded.

Another point to worry about is versioning. When you make repeated builds of a program, you will occasionally ...

Get Software Engineering and Computer Games now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.