/// <summary>
/// Allows the game to perform any initialization it needs to before starting to run.
/// This is where it can query for any required services and load any non-graphic
/// related content. Calling base.Initialize will enumerate through any components
/// and initialize them as well.
/// </summary>
protected override void Initialize()
{
FlatRedBallServices.InitializeFlatRedBall(this, graphics);
InitializeIoc();
this.TargetElapsedTime = TimeSpan.FromSeconds(1 / 30.0);
mToolForm = new ToolForm();
mToolForm.Owner = (Form)(Form.FromHandle(FlatRedBallServices.WindowHandle));
mToolForm.ItemCollapsedOrExpanded += HandleToolFormItemCollapsedOrExpanded;
Plugin.PluginManager.Initialize();
IsMouseVisible = true;
IsFixedTimeStep = false;
GuiData.Initialize();
RegisterAdditionalAssemblies();
AvailableAssetTypes.Self.Initialize(FileManager.RelativeDirectory);
#region Set up resizing
mFormMethods = new FormMethods(0, 0, 0, 0);
#endregion
SpriteManager.Camera.BackgroundColor = Color.Gray;
FlatRedBall.Math.Geometry.Polygon.TolerateEmptyPolygons = true;
ExposedVariableManager.Initialize();
try
{
RemotingServer.SetupPort(8686);
RemotingServer.SetupInterface <FlatRedBall.Glue.SelectionInterface>();
RemotingServer.SetupInterface <RegisterInterface>();
}
catch (Exception e)
{
System.Windows.Forms.MessageBox.Show("GlueView could not start, please make sure GlueView is not already running on your computer \n \n Exception: \n" + e.ToString());
FlatRedBall.FlatRedBallServices.Game.Exit();
}
mToolForm.Show();
GluxManager.ContentManagerName = "GlueView";
EditorLogic.Initialize();
CommandLineManager.Self.ProcessCommandLineArgs(this.mToolForm);
mainForm = Form.FromHandle(FlatRedBallServices.WindowHandle) as Form;
mainForm.Resize += HandleResize;
base.Initialize();
}