My disclaimer was a good call when I had posted that last article. In my rush to post an article about the Scavenge and Game classes (Scavenge will eventually have a class) I forgot to make a destructor for Game, and delete the world, context, and window.
Game::~Game()
{
delete world;
delete context;
delete window;
}
This is called in Scavenge when the game loop is ended (game->Power() == false) and delete game; is executed before exiting. Memory leaks aside I'm ready to go.
Compared to the example code provided by Leadwerks Project Manager there is a "System" static class that includes "AppName", "LoadSettings()", "AppPath", "ParseCommandLine()", "GetProperty()", "SaveSettings()", and "Print()." I will take a look into the API documentation and expand my Game class.
I want to take advantage of settings if Leadwerks already provides a class. I might as well take as much advantage of Leadwerks as possible, and I can also take advantage of "Print()" to do a bit of custom logging.
Back to work I go!
No comments:
Post a Comment