Last active
          December 13, 2015 19:59 
        
      - 
      
- 
        Save Groogy/4967104 to your computer and use it in GitHub Desktop. 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | 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 | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | 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); | |
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | 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