Skip to content

Instantly share code, notes, and snippets.

@hugoam
Last active October 20, 2018 15:22
Show Gist options
  • Save hugoam/2c3385b90864472071fd673986d76345 to your computer and use it in GitHub Desktop.
Save hugoam/2c3385b90864472071fd673986d76345 to your computer and use it in GitHub Desktop.
minimal game
class MyGame : public GameModule
{
public:
MyGame(Module& module) : GameModule(module) {}
virtual void init(GameShell& app, Game& game) final
{
this->start(app, game);
}
virtual void start(GameShell& app, Game& game) final
{
}
virtual void pump(GameShell& app, Game& game, Widget& ui) final
{
}
};
int main(int argc, char *argv[])
{
GameShell app(carray<cstring, 1>{ TOY_RESOURCE_PATH }, argc, argv);
Module module = { "MyGame" };
MyGame game_module = { module };
app.run_game(game_module);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment