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);
|
Framework.Set(this);
|
||||||
|
|
||||||
|
Logger.Info(LOG_TAG, "Framework initialization complete, beginning game application set up.");
|
||||||
|
|
||||||
OnInit();
|
OnInit();
|
||||||
OnNewContext();
|
OnNewContext();
|
||||||
OnResize(ScreenOrientation.Rotation0, _windowInfo.ClientRectangle);
|
OnResize(ScreenOrientation.Rotation0, _windowInfo.ClientRectangle);
|
||||||
|
|
|
@ -49,6 +49,17 @@ namespace Blarg.GameFramework
|
||||||
GraphicsDevice = new GraphicsDevice(GL);
|
GraphicsDevice = new GraphicsDevice(GL);
|
||||||
GraphicsDevice.OnInit();
|
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.");
|
Logger.Info(LOG_TAG, "Game app init.");
|
||||||
GameApp.OnInit();
|
GameApp.OnInit();
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue