register main framework objects as services with ServiceContainer

This commit is contained in:
Gered 2013-08-24 14:10:21 -04:00
parent a5a83dd7dc
commit cbec3ddd90
2 changed files with 13 additions and 0 deletions

View file

@ -147,6 +147,8 @@ namespace Blarg.GameFramework
Framework.Set(this);
Logger.Info(LOG_TAG, "Framework initialization complete, beginning game application set up.");
OnInit();
OnNewContext();
OnResize(ScreenOrientation.Rotation0, _windowInfo.ClientRectangle);

View file

@ -49,6 +49,17 @@ namespace Blarg.GameFramework
GraphicsDevice = new GraphicsDevice(GL);
GraphicsDevice.OnInit();
Logger.Info(LOG_TAG, "Registering framework objects with services container.");
Services.Register(Logger);
Services.Register(FileSystem);
if (Keyboard != null)
Services.Register(Keyboard);
if (Mouse != null)
Services.Register(Mouse);
if (TouchScreen != null)
Services.Register(TouchScreen);
Services.Register(GraphicsDevice);
Logger.Info(LOG_TAG, "Game app init.");
GameApp.OnInit();
}