Skip to content

Instantly share code, notes, and snippets.

@Groogy
Last active December 13, 2015 19:59
Show Gist options
  • Save Groogy/4967104 to your computer and use it in GitHub Desktop.
Save Groogy/4967104 to your computer and use it in GitHub Desktop.
describe Tyr::Application do
context "minial application" do
subject { Tyr::Application.new() }
it "should load the default module" do
subject.num_controllers.should == 0
subject.num_renderers.should == 0
subject.load(:default)
subject.modules.should include(:default)
subject.num_controllers.should == 1
subject.num_renderers.should == 1
end
end
end
Tyr::Application::builtInPlugins = [
{"default", "InitPlugin_default"}
]
Tyr::Application::load(const std::string& name)
{
auto plugin = getPlugin(name);
plugin.initialize(this);
}
void InitPlugin_default(tyr::Application* application)
{
DefaultController* controller = tyr::allocate<DefaultController>();
SceneRenderer* renderer = tyr::allocate<SceneRenderer>();
application->addController(controller);
application->addRenderer(renderer);
}
application = Tyr::Application.new
application.load("default")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment