register main framework objects as services with ServiceContainer
This commit is contained in:
parent
a5a83dd7dc
commit
cbec3ddd90
|
@ -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);
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
Reference in a new issue