public void HighlightHistory(FetchTexture tex, Point pt, PixelModification[] modif) { m_HistoryTex = tex; m_HistoryPoint = pt; m_History = modif; panel.Invalidate(); }
// launch the appropriate kind of viewer, depending on the type of resource that's in this node private void textureCell_CellDoubleClick(TreelistView.Node node) { object tag = node.Tag; GLPipelineState.ShaderStage stage = GetStageForSender(node.OwnerView); if (stage == null) { return; } if (tag is FetchTexture) { FetchTexture tex = (FetchTexture)tag; var viewer = m_Core.GetTextureViewer(); viewer.Show(m_DockContent.DockPanel); if (!viewer.IsDisposed) { viewer.ViewTexture(tex.ID, true); } } else if (tag is FetchBuffer) { } }
public PixelHistoryView(Core core, FetchTexture tex, Point pt, UInt32 sampleIdx, float rangemin, float rangemax, bool[] channels) { InitializeComponent(); Icon = global::renderdocui.Properties.Resources.icon; m_Core = core; events.Font = core.Config.PreferredFont; texture = tex; pixel = pt; rangeMin = rangemin; rangeMax = rangemax; visibleChannels = channels; sample = sampleIdx; Text = String.Format("Pixel History on {0} for ({1}, {2})", tex.name, pt.X, pt.Y); if (tex.msSamp > 1) { Text += String.Format(" @ Sample {0}", sample); } string channelStr = ""; numChannels = 0; channelIdx = 0; if (channels[0]) { channelStr += "R"; numChannels++; channelIdx = 0; } if (channels[1]) { channelStr += "G"; numChannels++; channelIdx = 1; } if (channels[2]) { channelStr += "B"; numChannels++; channelIdx = 2; } channelStr += " channel"; if (numChannels > 1) { channelStr += "s"; } // if alpha channel is enabled it only does anything if the // other channels are all disabled. There is no RGBA preview if (numChannels == 0 && channels[3]) { channelStr = "Alpha"; numChannels = 1; channelIdx = 3; } historyContext.Text = String.Format("Preview colours displayed in visible range {0} - {1} with {2} visible.", Formatter.Format(rangemin), Formatter.Format(rangemax), channelStr) + Environment.NewLine; historyContext.Text += Environment.NewLine; historyContext.Text += "Double click to jump to an event." + Environment.NewLine; historyContext.Text += "Right click to debug an event, or hide failed events."; eventsHidden.Text = ""; modifications = null; events.BeginUpdate(); events.Nodes.Clear(); events.Nodes.Add(new object[] { "Loading...", "", "", "", "" }); events.EndUpdate(); }