Ejemplo n.º 1
0
        public BufferViewer(Core core, bool meshview)
        {
            InitializeComponent();

            Icon = global::renderdocui.Properties.Resources.icon;

            UI_SetupDocks(meshview);

            m_Zeroes = new byte[512];
            for (int i = 0; i < 512; i++) m_Zeroes[i] = 0;

            m_VSIn.m_GridView = vsInBufferView;
            m_VSOut.m_GridView = vsOutBufferView;
            m_GSOut.m_GridView = gsOutBufferView;

            m_ContextUIState = m_VSIn;

            DockHandler.GetPersistStringCallback = PersistString;

            exportToToolStripMenuItem.Enabled = exportToolItem.Enabled = false;

            m_Core = core;

            this.DoubleBuffered = true;

            SetStyle(ControlStyles.OptimizedDoubleBuffer, true);

            RenderHandle = render.Handle;

            render.Painting = true;

            render.MouseWheel += render_MouseWheel;
            render.MouseWheelHandler = render_MouseWheel;
            (render as Control).KeyDown += new KeyEventHandler(BufferViewer_KeyDown);
            (render as Control).KeyUp += new KeyEventHandler(BufferViewer_KeyUp);

            m_OutConfig.m_Type = OutputType.MeshDisplay;

            m_MeshDisplay.type = MeshDataStage.VSIn;
            m_MeshDisplay.fov = 90.0f;

            m_MeshDisplay.solidShadeMode = SolidShadeMode.None;
            solidShading.SelectedIndex = 0;

            m_MeshDisplay.thisDrawOnly = true;
            drawRange.SelectedIndex = 0;

            m_MeshDisplay.currentMeshColour = new FloatVector(1, 0, 0, 1);
            m_MeshDisplay.prevMeshColour = new FloatVector(0, 0, 0, 1);

            m_Arcball = new ArcballCamera(m_Camera);
            m_Flycam = new FlyCamera(m_Camera);
            m_CurrentCamera = m_Arcball;
            m_Updater = new TimedUpdate(10, TimerUpdate);

            m_Arcball.SpeedMultiplier = m_Flycam.SpeedMultiplier = (float)camSpeed.Value;

            fovGuess.Text = m_MeshDisplay.fov.ToString("G");
            controlType.SelectedIndex = 0;

            MeshView = meshview;

            if (!MeshView)
            {
                debugVertexToolItem.Visible = debugSep.Visible = false;
                instLabel.Visible = instSep.Visible = instanceIdxToolitem.Visible = false;
                syncViewsToolItem.Visible = false;
                byteOffset.Text = "0";

                Text = "Buffer Contents";
            }
            else
            {
                byteOffset.Visible = false; byteOffsLab.Visible = false;
                byteOffset.Text = "0";

                Text = "Mesh Output";
            }

            m_Core.AddLogViewer(this);
        }
Ejemplo n.º 2
0
        private void ResetConfig()
        {
            m_OutConfig.m_Type = OutputType.MeshDisplay;

            m_MeshDisplay = new MeshDisplay();
            m_MeshDisplay.type = MeshDataStage.VSIn;
            m_MeshDisplay.fov = 90.0f;

            m_MeshDisplay.solidShadeMode = SolidShadeMode.None;
            solidShading.SelectedIndex = 0;

            m_MeshDisplay.thisDrawOnly = true;
            drawRange.SelectedIndex = 0;

            m_MeshDisplay.currentMeshColour = new FloatVector(1, 0, 0, 1);
            m_MeshDisplay.prevMeshColour = new FloatVector(0, 0, 0, 1);

            if (m_Arcball != null)
                m_Arcball.Camera.Shutdown();
            if (m_Flycam != null)
                m_Flycam.Camera.Shutdown();

            m_Arcball = new ArcballCamera();
            m_Flycam = new FlyCamera();
            m_CurrentCamera = m_Arcball;
            m_Updater = new TimedUpdate(10, TimerUpdate);

            m_Arcball.SpeedMultiplier = m_Flycam.SpeedMultiplier = (float)camSpeed.Value;

            fovGuess.Text = m_MeshDisplay.fov.ToString("G");
            controlType.SelectedIndex = 0;
        }
Ejemplo n.º 3
0
        private void ResetConfig()
        {
            m_OutConfig.m_Type = OutputType.MeshDisplay;

            m_MeshDisplay = new MeshDisplay();
            m_MeshDisplay.type = MeshDataStage.VSIn;
            m_MeshDisplay.fov = 90.0f;

            m_MeshDisplay.solidShadeMode = SolidShadeMode.None;
            solidShading.SelectedIndex = 0;

            m_MeshDisplay.showPrevInstances = false;
            m_MeshDisplay.showAllInstances = false;
            m_MeshDisplay.showWholePass = false;
            drawRange.SelectedIndex = 0;

            if (m_Arcball != null)
                m_Arcball.Camera.Shutdown();
            if (m_Flycam != null)
                m_Flycam.Camera.Shutdown();

            m_Arcball = new ArcballCamera();
            m_Flycam = new FlyCamera();
            m_CurrentCamera = m_Arcball;
            m_Updater = new TimedUpdate(10, TimerUpdate);

            m_Arcball.SpeedMultiplier = m_Flycam.SpeedMultiplier = (float)camSpeed.Value;

            fovGuess.Text = m_MeshDisplay.fov.ToString("G");
            controlType.SelectedIndex = 0;
        }