I noticed a post similar to this, but not sure if I am having the same problem.
In the game I am making, the player can move from one level to another. When this happens:
- the many small CGapiSurfaces created for the old level are destroyed, and the heap memory freed.
- the new level is loaded, and it's surfaces are created.
I would have expected that returning to the first level again would mean no extra memory would be needed, but the game seems to be drawing more and more from the device's physical and virtual memory every time the level changes, until I simply can't move to a different level anymore.
In order to monitor the heap, I have made my own private heap pool and overloaded the new and delete operators, and all of my new and delete statements seem to be doing fine. But I can't see what Gapidraw is doing when it creates and frees the surfaces.
It seems like Gapidraw is designed for all surfaces to be loaded at the start, rather than loading and freeing throughout the game. Perhaps this is the problem for me?
Any help would be appreciated.
Nathan