public void Render(Buffer buf, Rectangle rect, Flushing flush) { var dirty = new int[] { rect.Left, rect.Top, rect.Width, rect.Height }; if (screen_post_window(handle, buf.handle, 1, dirty, flush) != 0) { throw new Exception("Unable to render buffer to window!!"); } }
public async Task SendFrame() { var tiles = AuroraClient.Layout.Tiles; Flushing?.Invoke(this, AuroraClient.Layout); Tile[] changes = tiles.Where(x => x.HasChanges).ToArray(); if (changes.Length == 0) { return; } byte[] bytes = GetFrameBytes(changes); Console.WriteLine($"Streaming {bytes.Length} bytes ({changes.Length} panels)"); await SendAsync(bytes, bytes.Length, AuroraClient.EndPoint.Uri.Host, Port); foreach (Tile tile in changes) { tile.HasChanges = false; } }
public void Evaluate(int spreadMax) { Synchronizing?.Invoke(this, EventArgs.Empty); var buildResult = FBuildResult; if (buildResult.Error != null) { // This way the vvvv plugin node stays red PluginHost.LastRuntimeError = buildResult.Error; return; } else if (!string.IsNullOrEmpty(buildResult.SymbolError)) { PluginHost.LastRuntimeError = buildResult.SymbolError; } var runtimeHost = FRuntimeHost; if (runtimeHost.Mode == RunMode.Paused || runtimeHost.Mode == RunMode.Stopped) { if (FMessages.Errors.Any()) { PluginHost.LastRuntimeError = FMessages.Errors.FirstOrDefault().What; } return; } var x = Clocks.FrameClock.Time; // hack. make sure that somebody is interested in time. otherwise HDEFrameClock observable will not trigger. try { RuntimeGraph.HandleException(NodeId); spreadMax = StreamUtils.GetSpreadMax(FInStreams); // Prepare internal state if (FInstances.Length != spreadMax) { var instanceType = buildResult.InstanceType; if (instanceType != null) { FInstances.Resize(spreadMax, () => buildResult.Factory.CreateInstance(instanceType, FInstanceId), value => Dispose(value)); } else { FInstances.Resize(spreadMax, () => null, value => Dispose(value)); } } buildResult.EvaluateAction(spreadMax, FInstances, FInStreams, FOutStreams); } catch (RuntimeException exception) { // Collect the exception messages foreach (var p in exception.ExtractElementMessages(runtimeHost.Compilation.Compilation)) { FMessages.Add(p.Key.TracingId, MessageSeverity.Error, p.Value); } // Let others know about it runtimeHost.RaiseOnException(exception); // And finally tell vvvv about it throw exception.Original; } finally { Flushing?.Invoke(this, EventArgs.Empty); } }
static extern int screen_post_window(IntPtr win, IntPtr buffer, int rect_count, [In] int[] dirty_rects, Flushing flushing);
public void Render(Buffer buf, Rectangle rect, Flushing flush) { var dirty = new int[] { rect.Left, rect.Top, rect.Width, rect.Height }; if (screen_post_window (handle, buf.handle, 1, dirty, flush) != 0) { throw new Exception ("Unable to render buffer to window!!"); } }
static extern int screen_flush_blits(IntPtr ctx, Flushing flags);
static extern int screen_flush_context(IntPtr ctx, Flushing flags);
void IStreamInspector.Flushing() { Flushing?.Invoke(); }