public void EndToEndTest() { // Arrange. var device = new Device(); var logger = new TracefileBuilder(device); var expectedData = RenderScene(device); var stringWriter = new StringWriter(); logger.WriteTo(stringWriter); var loggedJson = stringWriter.ToString(); var logReader = new StringReader(loggedJson); var tracefile = Tracefile.FromTextReader(logReader); // Act. var swapChainPresenter = new RawSwapChainPresenter(); var replayer = new Replayer( tracefile.Frames[0], tracefile.Frames[0].Events.Last(), swapChainPresenter); replayer.Replay(); var actualData = swapChainPresenter.Data; // Assert. Assert.That(actualData, Is.EqualTo(expectedData)); }
public Replayer(TracefileFrame frame, TracefileEvent lastEvent, ISwapChainPresenter swapChainPresenter, int? renderTargetViewID = null, int? renderTargetArrayIndex = null, int? pixelX = null, int? pixelY = null) { _frame = frame; _lastEvent = lastEvent; _swapChainPresenter = swapChainPresenter; _device = new Device(); _deviceContext = _device.ImmediateContext; _logger = new TracefileBuilder(_device, renderTargetViewID, renderTargetArrayIndex, pixelX, pixelY); }
public Replayer(TracefileFrame frame, TracefileEvent lastEvent, ISwapChainPresenter swapChainPresenter, int?renderTargetViewID = null, int?renderTargetArrayIndex = null, int?pixelX = null, int?pixelY = null) { _frame = frame; _lastEvent = lastEvent; _swapChainPresenter = swapChainPresenter; _device = new Device(); _deviceContext = _device.ImmediateContext; _logger = new TracefileBuilder(_device, renderTargetViewID, renderTargetArrayIndex, pixelX, pixelY); }
public void AnalyzeLastFrame() { // Create new instance of sample object. var newSample = (SampleBase) Activator.CreateInstance(_sample.GetType()); IoC.BuildUp(newSample); // Create logger. var device = new Device(); var logger = new TracefileBuilder(device); // Initialize and draw. newSample.Initialize(device); newSample.Draw(_totalTime); var tracefileDocument = new TracefileViewerViewModel( IoC.Get<ISelectionService>(), "[Sample " + _sample.Name + "]", logger.Tracefile); IoC.Get<IShell>().OpenDocument(tracefileDocument); }