//Injected Engine public Game(D3DEngine engine, bool withDebugObjectTracking = false) { Engine = engine; if (Engine.isInitialized) { Engine.GameWindow.FormClosing += GameWindow_FormClosing; _visibleDrawable = new List <DrawableComponentHolder>(); _enabledUpdatable = new List <IUpdatableComponent>(); _gameComponents = ToDispose(new GameComponentCollection()); gameInitialize(withDebugObjectTracking); } }
//Constructed Engine public Game(Size startingWindowsSize, string WindowsCaption, SampleDescription sampleDescription, Size ResolutionSize = default(Size), bool withDebugObjectTracking = false) { Engine = ToDispose(new D3DEngine(startingWindowsSize, WindowsCaption, sampleDescription, ResolutionSize)); if (Engine.isInitialized) { Engine.GameWindow.FormClosing += GameWindow_FormClosing; _visibleDrawable = new List <DrawableComponentHolder>(); _enabledUpdatable = new List <IUpdatableComponent>(); _gameComponents = ToDispose(new GameComponentCollection()); gameInitialize(withDebugObjectTracking); } }