Exemple #1
0
        public void ViewTexture(ResourceId ID, bool focus)
        {
            if (this.InvokeRequired)
            {
                this.BeginInvoke(new Action(() => { this.ViewTexture(ID, focus); }));
                return;
            }

            TextureViewer_Load(null, null);

            if (lockedTabs.ContainsKey(ID))
            {
                if (!lockedTabs[ID].IsDisposed && !lockedTabs[ID].IsHidden)
                {
                    if (focus)
                        Show();

                    lockedTabs[ID].Show();
                    m_Core.Renderer.BeginInvoke(RT_UpdateAndDisplay);
                    return;
                }

                lockedTabs.Remove(ID);
            }

            for (int i = 0; i < m_Core.CurTextures.Length; i++)
            {
                if (m_Core.CurTextures[i].ID == ID)
                {
                    FetchTexture current = m_Core.CurTextures[i];

                    var newPanel = Helpers.WrapDockContent(dockPanel, renderToolstripContainer, current.name);

                    newPanel.DockState = DockState.Document;
                    newPanel.AllowEndUserDocking = false;

                    newPanel.Icon = Icon.FromHandle(global::renderdocui.Properties.Resources.page_white_link.GetHicon());

                    newPanel.Tag = current;

                    newPanel.DockHandler.TabPageContextMenuStrip = tabContextMenu;
                    newPanel.FormClosing += new FormClosingEventHandler(PreviewPanel_FormClosing);

                    newPanel.Show(m_PreviewPanel.Pane, null);

                    newPanel.Show();

                    if (focus)
                        Show();

                    lockedTabs.Add(ID, newPanel);

                    m_Core.Renderer.BeginInvoke(RT_UpdateAndDisplay);
                    return;
                }
            }

            for (int i = 0; i < m_Core.CurBuffers.Length; i++)
            {
                if (m_Core.CurBuffers[i].ID == ID)
                {
                    var viewer = new BufferViewer(m_Core, false);
                    viewer.ViewRawBuffer(true, 0, ulong.MaxValue, ID);
                    viewer.Show(DockPanel);
                    return;
                }
            }
        }
Exemple #2
0
 private void viewTexBuffer_Click(object sender, EventArgs e)
 {
     if (CurrentTexture != null)
     {
         var viewer = new BufferViewer(m_Core, false);
         viewer.ViewRawBuffer(false, 0, ulong.MaxValue, CurrentTexture.ID);
         viewer.Show(this.DockPanel);
     }
 }
Exemple #3
0
        private void MainWindow_Load(object sender, EventArgs e)
        {
            bool loaded = LoadLayout(0);

            CheckUpdates();

            sendErrorReportToolStripMenuItem.Enabled = OfficialVersion;

            // create default layout if layout failed to load
            if (!loaded)
            {
                m_Core.GetAPIInspector().Show(dockPanel);
                m_Core.GetEventBrowser().Show(m_Core.GetAPIInspector().Pane, DockAlignment.Top, 0.5);

                m_Core.GetPipelineStateViewer().Show(dockPanel);

                var bv = new BufferViewer(m_Core, true);
                bv.InitFromPersistString("");
                bv.Show(dockPanel);

                var tv = m_Core.GetTextureViewer();
                tv.InitFromPersistString("");
                tv.Show(dockPanel);

                m_Core.GetTimelineBar().Show(dockPanel);

                if (m_Core.CaptureDialog == null)
                    m_Core.CaptureDialog = new Dialogs.CaptureDialog(m_Core, OnCaptureTrigger, OnInjectTrigger);

                m_Core.CaptureDialog.InjectMode = false;
                m_Core.CaptureDialog.Show(dockPanel);
            }

            PopulateRecentFiles();
            PopulateRecentCaptures();

            if (m_InitFilename != "")
            {
                if(Path.GetExtension(m_InitFilename) == ".rdc")
                    LoadLogAsync(m_InitFilename, false);
                else if (Path.GetExtension(m_InitFilename) == ".cap")
                {
                    if(m_Core.CaptureDialog == null)
                        m_Core.CaptureDialog = new Dialogs.CaptureDialog(m_Core, OnCaptureTrigger, OnInjectTrigger);

                    m_Core.CaptureDialog.LoadSettings(m_InitFilename);
                    m_Core.CaptureDialog.Show(dockPanel);

                    // workaround for Show() not doing this
                    if (m_Core.CaptureDialog.DockState == DockState.DockBottomAutoHide ||
                        m_Core.CaptureDialog.DockState == DockState.DockLeftAutoHide ||
                        m_Core.CaptureDialog.DockState == DockState.DockRightAutoHide ||
                        m_Core.CaptureDialog.DockState == DockState.DockTopAutoHide)
                    {
                        dockPanel.ActiveAutoHideContent = m_Core.CaptureDialog;
                    }
                }

                m_InitFilename = "";
            }
        }
Exemple #4
0
        private IDockContent GetContentFromPersistString(string persistString)
        {
            if (IsPersist(persistString, typeof(EventBrowser).ToString()))
            {
                var ret = m_Core.GetEventBrowser();
                ret.InitFromPersistString(persistString);
                return ret;
            }
            else if (IsPersist(persistString, typeof(TextureViewer).ToString()))
            {
                var ret = m_Core.GetTextureViewer();
                ret.InitFromPersistString(persistString);
                return ret;
            }
            else if (IsPersist(persistString, typeof(BufferViewer).ToString()))
            {
                var ret = new BufferViewer(m_Core, true);
                ret.InitFromPersistString(persistString);
                return ret;
            }
            else if (IsPersist(persistString, typeof(APIInspector).ToString()))
                return m_Core.GetAPIInspector();
            else if (IsPersist(persistString, typeof(PipelineState.PipelineStateViewer).ToString()))
            {
                var ret = m_Core.GetPipelineStateViewer();
                ret.InitFromPersistString(persistString);
                return ret;
            }
            else if (IsPersist(persistString, typeof(DebugMessages).ToString()))
                return m_Core.GetDebugMessages();
            else if (IsPersist(persistString, typeof(TimelineBar).ToString()))
                return m_Core.GetTimelineBar();
            else if (IsPersist(persistString, typeof(Dialogs.CaptureDialog).ToString()))
            {
                if (m_Core.CaptureDialog == null)
                    m_Core.CaptureDialog = new Dialogs.CaptureDialog(m_Core, OnCaptureTrigger, OnInjectTrigger);

                return m_Core.CaptureDialog;
            }
            else if (persistString != null && persistString != "")
                LoadCustomString(persistString);

            return null;
        }
Exemple #5
0
        private void meshOutputToolStripMenuItem_Click(object sender, EventArgs e)
        {
            BufferViewer b = new BufferViewer(m_Core, true);

            b.InitFromPersistString("");

            b.Show(dockPanel);
        }
Exemple #6
0
        public BufferViewer GetMeshViewer()
        {
            if (m_MeshViewer == null || m_MeshViewer.IsDisposed)
            {
                m_MeshViewer = new BufferViewer(this, true);
                AddLogViewer(m_MeshViewer);
            }

            return m_MeshViewer;
        }