public void Dispose() { if (this._pipelineDispatcher != null) { this._pipelineDispatcher.Dispose(); this._pipelineDispatcher = null; } if (this._backgroundDispatcher != null) { this._backgroundDispatcher.Dispose(); this._backgroundDispatcher = null; } if (this._gameThreadDispatcher != null) { this._gameThreadDispatcher.Dispose(); this._gameThreadDispatcher = null; } }
public void VerifyQueueActionWillQueueAndRunOnceRenderFrameFired() { var fakeDecalEventsProxy = new Fakes.FakeDecalEventsProxy(); bool actionCalled = false; using (var dispatcher = new GameThreadDispatcher(fakeDecalEventsProxy)) { dispatcher.QueueAction(() => { actionCalled = true; }); Assert.AreEqual(1, dispatcher.QueueCount); // Fire the render event to simulate what decal would do fakeDecalEventsProxy.FireRenderFrame(new EventArgs()); Assert.IsTrue(actionCalled); Assert.AreEqual(0, dispatcher.QueueCount); } }
public DispatchManager(IDecalEventsProxy decalEventsProxy) { this._backgroundDispatcher = new BackgroundDispatcher(); this._gameThreadDispatcher = new GameThreadDispatcher(decalEventsProxy); this._pipelineDispatcher = new PipelineDispatcher(decalEventsProxy); }